mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
example configurations.
This commit is contained in:
parent
6be2426f09
commit
af016709f4
4 changed files with 58 additions and 1 deletions
|
@ -19,7 +19,9 @@ Plugins are executed when the user clicks through the captive portal form, wheth
|
|||
|
||||
Plugins accept data from the request of the user, as of writing this is only wsgi environ data.
|
||||
|
||||
There is a sample plugin called logging.py. Plugins are merely rq jobs that are executed by an rq worker. As such they can only be so complex.
|
||||
Sample plugins prefixed with sample\_ are a good starting point for understanding the plugins.
|
||||
|
||||
Plugins can be made mandatory, or skipped by being disabled, see plugins.cfg for more configuration.
|
||||
|
||||
# Get started
|
||||
|
||||
|
@ -29,3 +31,7 @@ There is a sample plugin called logging.py. Plugins are merely rq jobs that are
|
|||
## RQ worker
|
||||
|
||||
rq worker -u redis://127.0.0.1:6379/
|
||||
|
||||
# Deployment
|
||||
|
||||
See examples in docs/examples directory.
|
||||
|
|
17
docs/examples/nginx/nginx.conf
Normal file
17
docs/examples/nginx/nginx.conf
Normal file
|
@ -0,0 +1,17 @@
|
|||
server {
|
||||
listen {{webportal_ip}}:80 default_server;
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
# Must fix the HTTP_X_FORWARDED_FOR value in WSGI environ.
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Server $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
if (!-f $request_filename) {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
14
docs/examples/supervisord/captiveportal.ini
Normal file
14
docs/examples/supervisord/captiveportal.ini
Normal file
|
@ -0,0 +1,14 @@
|
|||
[program:captiveportal]
|
||||
command={{global_virtualenv_path}}/bin/gunicorn portal --workers 3 --log-level DEBUG --bind 127.0.0.1:8080
|
||||
directory=/var/opt/captiveportal/portal
|
||||
pythonpath={{global_virtualenv_path}}/lib/python2.7/site-packages
|
||||
user={{captiveportal_username}}
|
||||
group=virtualenv
|
||||
umask=002
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/captiveportal_gunicorn.log
|
||||
loglevel=debug
|
||||
redirect_stderr=true
|
||||
stopsignal=QUIT
|
||||
environment=PATH={{global_virtualenv_path}}/bin:/bin:/sbin:/usr/bin:/usr/sbin
|
20
docs/examples/supervisord/rqworker.ini
Normal file
20
docs/examples/supervisord/rqworker.ini
Normal file
|
@ -0,0 +1,20 @@
|
|||
[program:rqworker]
|
||||
; Also, you probably want to include a settings module to configure this
|
||||
; worker. For more info on that, see http://python-rq.org/docs/workers/
|
||||
command={{global_virtualenv_path}}/bin/rq worker -u redis://127.0.0.1:6379/
|
||||
process_name=%(program_name)s
|
||||
numprocs=1
|
||||
|
||||
; This is the directory from which RQ is ran. Be sure to point this to the
|
||||
; directory where your source code is importable from
|
||||
directory={{captiveportal_install_dir}}/portal
|
||||
|
||||
; RQ requires the TERM signal to perform a warm shutdown. If RQ does not die
|
||||
; within 10 seconds, supervisor will forcefully kill it
|
||||
stopsignal=TERM
|
||||
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/rqworker_gunicorn.log
|
||||
environment=PATH={{global_virtualenv_path}}/bin:/bin:/sbin:/usr/bin:/usr/sbin
|
||||
|
Loading…
Reference in a new issue