Skip to content

Commit

Permalink
Created umami account
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenaH84 committed Nov 13, 2024
1 parent caf51af commit 6b6e228
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
20 changes: 17 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
ports:
- "8081:8081"
- "8080:8080"
networks:
- app-network
volumes:
- ./api/scripts:/api/scripts
- ./api/api.jl:/api/api.jl
Expand All @@ -29,6 +31,8 @@ services:
restart: always
ports:
- "8501:8501"
networks:
- app-network
volumes:
- ./gui:/app

Expand All @@ -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
Expand All @@ -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

Expand All @@ -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:
umami_db_data:

networks:
app-network:
driver: bridge
3 changes: 0 additions & 3 deletions gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@
# height=0,
# )

components.html(
'<script async defer data-website-id="adcac53d-bc65-4ca3-9f98-be5c7c4ee75d" src="<https://app.batterymodel.com/umami.js>"></script>'
)

##############################
# Remember user changed values
Expand Down
5 changes: 5 additions & 0 deletions gui/app_pages/Home.py
Original file line number Diff line number Diff line change
@@ -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__))))
Expand All @@ -14,6 +15,10 @@
)
from app_scripts import app_view

components.html(
'<script async defer data-website-id="adcac53d-bc65-4ca3-9f98-be5c7c4ee75d" src="<https://app.batterymodel.com/umami.js>"></script>'
)


# ##############################
# # Remember user changed values
Expand Down
2 changes: 2 additions & 0 deletions nginx/project.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6b6e228

Please sign in to comment.