2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

Add origin Header and site header to socket.io block

This commit is contained in:
Pratik Vyas 2015-07-22 10:56:32 +05:30
parent 7faad21fa4
commit b4db16ee46
3 changed files with 9 additions and 3 deletions

View File

@ -286,9 +286,10 @@ def restart():
restart_supervisor_processes()
@click.command('start')
def start():
@click.option('--no-dev', flag_value=True, type=bool)
def start(no_dev=False):
"Start Frappe development processes"
_start()
_start(no_dev=no_dev)
@click.command('migrate-3to4')
@click.argument('path')

View File

@ -28,6 +28,9 @@ upstream socketio-server {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Frappe-Site-Name {{ site.name }};
proxy_set_header Origin $http_host;
proxy_set_header Host $host;
}
location / {

View File

@ -241,11 +241,13 @@ def get_program(programs):
def get_process_manager():
return get_program(['foreman', 'forego', 'honcho'])
def start():
def start(no_dev=False):
program = get_process_manager()
if not program:
raise Exception("No process manager found")
os.environ['PYTHONUNBUFFERED'] = "true"
if not no_dev:
os.environ['DEV_SERVER'] = "true"
os.execv(program, [program, 'start'])
def check_cmd(cmd, cwd='.'):