Skip to content
Snippets Groups Projects
Commit b844efca authored by Gallenkamp, Fabian's avatar Gallenkamp, Fabian
Browse files

added 403 option, if redirection not defined

parent f3b66c32
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@
owner: root
group: root
mode: "0644"
notify: restart nginx
- name: create symlinks for nginx vhosts confs
file:
......@@ -61,6 +62,7 @@
group: root
mode: "0644"
with_dict: "{{ otree_users }}"
notify: restart nginx
- name: create symlinks for nginx vhosts confs
file:
......@@ -87,5 +89,5 @@
- name: restart nginx
service:
name: nginx
state: restarted
state: reloaded
......@@ -134,7 +134,7 @@
chdir: "{{ home_path }}/{{ item.key }}/otree/"
executable: /bin/bash
environment:
DATABASE_URL: "{{ item.value.database }}"
DATABASE_URL: "postgres://{{ item.key }}:{{ item.value.admin_pw }}@localhost:5432/instance_{{ item.key }}"
REDIS_URL: "{{ item.value.redis }}"
OTREE_ADMIN_PASSWORD: "{{ item.value.admin_pw }}"
OTREE_AUTH_LEVEL: "{{ item.value.auth_level }}"
......
......@@ -21,7 +21,7 @@ server {
ssl_certificate_key {{ ssl_certificate_key_path }};
location / {
return 301 {{ default_redirection }};
return {% if default_redirection is defined %}301 {{ default_redirection }}{% else %}403{% endif %};
}
}
[program:{{ item.key }}]
directory={{ home_path }}/{{ item.key }}/otree/
command=/bin/bash -c "source {{ home_path }}/{{ item.key }}/.venv_otree/bin/activate && otree runprodserver"
environment=DATABASE_URL="{{ item.value.database }}",REDIS_URL="{{ item.value.redis }}",OTREE_ADMIN_PASSWORD="{{ item.value.admin_pw }}",OTREE_AUTH_LEVEL="{{ item.value.auth_level }}",OTREE_SECRET_KEY="{{ item.value.secret_key }}",OTREE_PRODUCTION="{{ item.value.production }}",PORT={{ item.value.port }}
environment=DATABASE_URL="postgres://{{ item.key }}:{{ item.value.admin_pw }}@localhost:5432/instance_{{ item.key }}",REDIS_URL="{{ item.value.redis }}",OTREE_ADMIN_PASSWORD="{{ item.value.admin_pw }}",OTREE_AUTH_LEVEL="{{ item.value.auth_level }}",OTREE_SECRET_KEY="{{ item.value.secret_key }}",OTREE_PRODUCTION="{{ item.value.production }}",PORT={{ item.value.port }}
autostart=true
autorestart=true
startretries=3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment