diff --git a/automation/roles/bubble/tasks/main.yml b/automation/roles/bubble/tasks/main.yml index a7ccea44..357c6f75 100644 --- a/automation/roles/bubble/tasks/main.yml +++ b/automation/roles/bubble/tasks/main.yml @@ -41,12 +41,13 @@ - name: Install bubble jar copy: src: "{{ item }}" - dest: /home/bubble/bubble_{{ bubble_version }}/{{ item }} + dest: /home/bubble/bubble_{{ bubble_version }}/bubble.jar owner: bubble group: bubble mode: 0444 - with_items: - - bubble.jar + +- name: Unpack site files + shell: su - bubble -c "cd /home/bubble && unzip /home/bubble/bubble_{{ bubble_version }}/bubble.jar 'site/*'" - name: Install bubble self_node.json, sage_node.json and sage_key.json copy: diff --git a/automation/roles/bubble/templates/bubble.env.j2 b/automation/roles/bubble/templates/bubble.env.j2 index f96b9205..a381c638 100644 --- a/automation/roles/bubble/templates/bubble.env.j2 +++ b/automation/roles/bubble/templates/bubble.env.j2 @@ -1,4 +1,5 @@ export PUBLIC_BASE_URI={{ public_base_uri }} +export BUBBLE_ASSETS_DIR=/home/bubble/site export SELF_NODE={{ node_uuid }} export SAGE_NODE={{ sage_node }} export LETSENCRYPT_EMAIL={{ letsencrypt_email }} diff --git a/automation/roles/nginx/templates/site_node.conf.j2 b/automation/roles/nginx/templates/site_node.conf.j2 index 263e296b..fabd565d 100644 --- a/automation/roles/nginx/templates/site_node.conf.j2 +++ b/automation/roles/nginx/templates/site_node.conf.j2 @@ -3,7 +3,11 @@ server { listen {{ ssl_port }} ssl http2; location / { - proxy_pass http://127.0.0.1:{{ admin_port }}/; + root /home/bubble/site/; + } + + location /api { + proxy_pass http://127.0.0.1:{{ admin_port }}/api; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host {{ server_name }}; diff --git a/automation/roles/nginx/templates/site_node_alias.conf.j2 b/automation/roles/nginx/templates/site_node_alias.conf.j2 index ffbe0de6..546a62bd 100644 --- a/automation/roles/nginx/templates/site_node_alias.conf.j2 +++ b/automation/roles/nginx/templates/site_node_alias.conf.j2 @@ -3,6 +3,11 @@ server { listen {{ ssl_port }} ssl http2; location / { + root /home/bubble/site/; + } + + location /api { + proxy_pass http://127.0.0.1:{{ admin_port }}/api; proxy_pass http://127.0.0.1:{{ admin_port }}/; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; diff --git a/automation/roles/nginx/templates/site_sage.conf.j2 b/automation/roles/nginx/templates/site_sage.conf.j2 index e01fe66e..dcb5fad7 100644 --- a/automation/roles/nginx/templates/site_sage.conf.j2 +++ b/automation/roles/nginx/templates/site_sage.conf.j2 @@ -3,7 +3,11 @@ server { server_name {{ server_name }}; location / { - proxy_pass http://127.0.0.1:{{ admin_port }}/; + root /home/bubble/site/; + } + + location /api { + proxy_pass http://127.0.0.1:{{ admin_port }}/api; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host {{ server_name }}; diff --git a/automation/roles/nginx/templates/site_sage_alias.conf.j2 b/automation/roles/nginx/templates/site_sage_alias.conf.j2 index 336b22a7..0c677195 100644 --- a/automation/roles/nginx/templates/site_sage_alias.conf.j2 +++ b/automation/roles/nginx/templates/site_sage_alias.conf.j2 @@ -3,7 +3,11 @@ server { server_name {{ server_alias }}; location / { - proxy_pass http://127.0.0.1:{{ admin_port }}/; + root /home/bubble/site/; + } + + location /api { + proxy_pass http://127.0.0.1:{{ admin_port }}/api; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host {{ server_name }};