Files
ProxmoxVE/install/umami-install.sh

49 lines
1.1 KiB
Bash
Raw Normal View History

2024-05-09 18:01:00 +02:00
#!/usr/bin/env bash
# Copyright (c) 2021-2026 tteck
2024-05-09 18:01:00 +02:00
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://umami.is/
2024-05-09 18:01:00 +02:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2024-05-09 18:01:00 +02:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
2025-12-13 23:05:07 +01:00
NODE_VERSION="22" NODE_MODULE="pnpm@latest" setup_nodejs
2025-10-09 19:43:23 +02:00
PG_VERSION="17" setup_postgresql
2025-12-10 21:32:12 +01:00
PG_DB_NAME="umamidb" PG_DB_USER="umami" setup_postgresql_db
2025-08-18 19:58:50 +02:00
fetch_and_deploy_gh_release "umami" "umami-software/umami" "tarball"
2024-05-09 18:01:00 +02:00
2025-08-18 19:58:50 +02:00
msg_info "Configuring Umami"
2024-05-09 18:01:00 +02:00
cd /opt/umami
2025-12-13 23:05:07 +01:00
$STD pnpm install
2025-12-10 21:32:12 +01:00
echo -e "DATABASE_URL=postgresql://$PG_DB_USER:$PG_DB_PASS@localhost:5432/$PG_DB_NAME" >>/opt/umami/.env
2025-12-13 23:05:07 +01:00
$STD pnpm run build
2025-08-18 19:58:50 +02:00
msg_ok "Configured Umami"
2024-05-09 18:01:00 +02:00
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/umami.service
2025-08-18 19:58:50 +02:00
[Unit]
2024-05-09 18:01:00 +02:00
Description=umami
[Service]
Type=simple
Restart=always
User=root
WorkingDirectory=/opt/umami
2025-12-13 23:05:07 +01:00
ExecStart=/usr/bin/pnpm run start
2024-05-09 18:01:00 +02:00
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now umami
2024-05-09 18:01:00 +02:00
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc