From aed25098e5c9f67bd4644be85ffa2b4b7711a87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Mon, 18 Aug 2025 19:58:50 +0200 Subject: [PATCH] Refactor (#6939) --- ct/umami.sh | 9 ++-- frontend/public/json/umami.json | 76 ++++++++++++++++----------------- install/umami-install.sh | 12 ++---- 3 files changed, 47 insertions(+), 50 deletions(-) diff --git a/ct/umami.sh b/ct/umami.sh index 7d8d598bf7..54b69aaebf 100644 --- a/ct/umami.sh +++ b/ct/umami.sh @@ -32,11 +32,12 @@ function update_script() { systemctl stop umami msg_ok "Stopped $APP" + fetch_and_deploy_gh_release "umami" "umami-software/umami" "tarball" + msg_info "Updating ${APP}" cd /opt/umami - git pull - yarn install - yarn build + $STD yarn install + $STD yarn run build msg_ok "Updated ${APP}" msg_info "Starting ${APP}" @@ -54,4 +55,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/frontend/public/json/umami.json b/frontend/public/json/umami.json index be05894341..a96cba0535 100644 --- a/frontend/public/json/umami.json +++ b/frontend/public/json/umami.json @@ -1,40 +1,40 @@ { - "name": "Umami", - "slug": "umami", - "categories": [ - 9 - ], - "date_created": "2024-05-09", - "type": "ct", - "updateable": false, - "privileged": false, - "interface_port": 3000, - "documentation": null, - "website": "https://umami.is/", - "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/umami.webp", - "config_path": "/opt/umami/.env", - "description": "Umami makes it easy to collect, analyze, and understand your web data while maintaining visitor privacy and data ownership.", - "install_methods": [ - { - "type": "default", - "script": "ct/umami.sh", - "resources": { - "cpu": 2, - "ram": 2048, - "hdd": 12, - "os": "debian", - "version": "12" - } - } - ], - "default_credentials": { - "username": "admin", - "password": "umami" - }, - "notes": [ - { - "text": "To view the database credentials : `cat umami.creds`", - "type": "info" - } - ] + "name": "Umami", + "slug": "umami", + "categories": [ + 9 + ], + "date_created": "2024-05-09", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3000, + "documentation": "https://umami.is/docs", + "website": "https://umami.is/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/umami.webp", + "config_path": "/opt/umami/.env", + "description": "Umami makes it easy to collect, analyze, and understand your web data while maintaining visitor privacy and data ownership.", + "install_methods": [ + { + "type": "default", + "script": "ct/umami.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 12, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": "admin", + "password": "umami" + }, + "notes": [ + { + "text": "To view the database credentials : `cat umami.creds`", + "type": "info" + } + ] } diff --git a/install/umami-install.sh b/install/umami-install.sh index d4e9e29ac9..10c91e648f 100644 --- a/install/umami-install.sh +++ b/install/umami-install.sh @@ -13,12 +13,9 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt-get install -y git -msg_ok "Installed Dependencies" - NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs PG_VERSION="16" setup_postgresql +fetch_and_deploy_gh_release "umami" "umami-software/umami" "tarball" msg_info "Setting up postgresql" DB_NAME=umamidb @@ -39,17 +36,16 @@ $STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" } >>~/umami.creds msg_ok "Set up postgresql" -msg_info "Installing Umami (Patience)" -git clone -q https://github.com/umami-software/umami.git /opt/umami +msg_info "Configuring Umami" cd /opt/umami $STD yarn install echo -e "DATABASE_URL=postgresql://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME" >>/opt/umami/.env $STD yarn run build -msg_ok "Installed Umami" +msg_ok "Configured Umami" msg_info "Creating Service" cat </etc/systemd/system/umami.service -echo "[Unit] +[Unit] Description=umami [Service]