From 6b6e228c4077f4ef0c8253db7a3b9f68a6c35962 Mon Sep 17 00:00:00 2001 From: Lorena Hendrix Date: Wed, 13 Nov 2024 09:36:13 +0100 Subject: [PATCH] Created umami account --- .github/workflows/deploy.yml | 4 ++++ docker-compose-deploy.yml | 4 ++-- docker-compose.yml | 20 +++++++++++++++++--- gui/app.py | 3 --- gui/app_pages/Home.py | 5 +++++ nginx/project.conf | 2 ++ 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 83764b2..385e446 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -58,7 +58,11 @@ jobs: - name: Pull and Run Containers with Deploy File run: | ssh -p ${{ secrets.SSH_PORT }} ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "cd ${{ env.WORKDIR }} && \ + POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} \ + HASH_SALT=${{ secrets.HASH_SALT }} \ docker compose -f docker-compose-deploy.yml pull && \ + POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} \ + HASH_SALT=${{ secrets.HASH_SALT }} \ docker compose -f docker-compose-deploy.yml up -d" - name: Cleanup diff --git a/docker-compose-deploy.yml b/docker-compose-deploy.yml index 88239cc..4b50e4b 100644 --- a/docker-compose-deploy.yml +++ b/docker-compose-deploy.yml @@ -52,7 +52,7 @@ services: environment: DATABASE_URL: postgres://umami:password@umami-db/umami DATABASE_TYPE: postgres - HASH_SALT: your_hash_salt # Replace this with a secure, random hash salt + HASH_SALT: ${HASH_SALT} ports: - "3000:3000" depends_on: @@ -64,7 +64,7 @@ services: restart: always environment: POSTGRES_USER: umami - POSTGRES_PASSWORD: password # Replace with a strong password + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: umami volumes: - umami_db_data:/var/lib/postgresql/data diff --git a/docker-compose.yml b/docker-compose.yml index b0b56d2..0d3287c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,8 @@ services: ports: - "8081:8081" - "8080:8080" + networks: + - app-network volumes: - ./api/scripts:/api/scripts - ./api/api.jl:/api/api.jl @@ -29,6 +31,8 @@ services: restart: always ports: - "8501:8501" + networks: + - app-network volumes: - ./gui:/app @@ -41,6 +45,8 @@ services: restart: always ports: - "80:80" + networks: + - app-network volumes: - /etc/letsencrypt:/etc/letsencrypt - /usr/share/nginx/html/.well-known:/usr/share/nginx/html/.well-known @@ -53,9 +59,11 @@ services: environment: DATABASE_URL: postgres://umami:password@umami-db/umami DATABASE_TYPE: postgres - HASH_SALT: your_hash_salt # Replace this with a secure, random hash salt + HASH_SALT: ${HASH_SALT} # Replace this with a secure, random hash salt ports: - "3000:3000" + networks: + - app-network depends_on: - umami-db @@ -65,11 +73,17 @@ services: restart: always environment: POSTGRES_USER: umami - POSTGRES_PASSWORD: password # Replace with a strong password + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} # Replace with a strong password POSTGRES_DB: umami + networks: + - app-network volumes: - umami_db_data:/var/lib/postgresql/data # Define volumes at the root level, outside of services volumes: - umami_db_data: \ No newline at end of file + umami_db_data: + +networks: + app-network: + driver: bridge \ No newline at end of file diff --git a/gui/app.py b/gui/app.py index eb2777e..706c3a7 100644 --- a/gui/app.py +++ b/gui/app.py @@ -51,9 +51,6 @@ # height=0, # ) -components.html( - '' -) ############################## # Remember user changed values diff --git a/gui/app_pages/Home.py b/gui/app_pages/Home.py index a58d608..4bd1d40 100644 --- a/gui/app_pages/Home.py +++ b/gui/app_pages/Home.py @@ -1,6 +1,7 @@ import os import streamlit as st import sys +import streamlit.components.v1 as components sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) @@ -14,6 +15,10 @@ ) from app_scripts import app_view +components.html( + '' +) + # ############################## # # Remember user changed values diff --git a/nginx/project.conf b/nginx/project.conf index 866a614..e755895 100644 --- a/nginx/project.conf +++ b/nginx/project.conf @@ -33,6 +33,7 @@ server { # Umami analytics application proxy location /umami/ { + rewrite /umami/(.*) /$1 break; proxy_pass http://umami:3000/; proxy_http_version 1.1; proxy_set_header Host $host; @@ -86,6 +87,7 @@ server { # # Umami analytics application proxy # location /umami/ { +# rewrite /umami/(.*) /$1 break; # proxy_pass http://umami:3000/; # proxy_http_version 1.1; # proxy_set_header Host $host;