From 12bd10bef3a2682acc1868960ef219ad49b6cc9a Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 9 May 2024 09:13:13 -0400 Subject: [PATCH 1/8] Update wireguard.sh "There is currently no update path available." --- ct/wireguard.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ct/wireguard.sh b/ct/wireguard.sh index 23e75b80f..f2dc848a1 100644 --- a/ct/wireguard.sh +++ b/ct/wireguard.sh @@ -60,9 +60,7 @@ UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --radio 3>&1 1>&2 2>&3) header_info if [ "$UPD" == "1" ]; then -msg_info "Updating ${APP} LXC" -apt-get update &>/dev/null -apt-get -y upgrade &>/dev/null +msg_error "There is currently no update path available." exit fi if [ "$UPD" == "2" ]; then From 0e01ceb460c72f096402c4f44e67471de6ef6628 Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 9 May 2024 09:26:17 -0400 Subject: [PATCH 2/8] Update wireguard.sh fix update --- ct/wireguard.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ct/wireguard.sh b/ct/wireguard.sh index f2dc848a1..5feee4ac4 100644 --- a/ct/wireguard.sh +++ b/ct/wireguard.sh @@ -60,7 +60,10 @@ UPD=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --radio 3>&1 1>&2 2>&3) header_info if [ "$UPD" == "1" ]; then -msg_error "There is currently no update path available." +msg_info "Updating ${APP} LXC" +apt-get update &>/dev/null +apt-get -y upgrade &>/dev/null +msg_ok "Updated ${APP} LXC" exit fi if [ "$UPD" == "2" ]; then From 91985329f6ec95cc969f8af27ac319daf442d941 Mon Sep 17 00:00:00 2001 From: Bram Suurd <78373894+BramSuurdje@users.noreply.github.com> Date: Thu, 9 May 2024 18:01:00 +0200 Subject: [PATCH 3/8] New LXC: umami (#2946) --- ct/umami.sh | 61 ++++++++++++++++++++++++++++ install/umami-install.sh | 85 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 ct/umami.sh create mode 100644 install/umami-install.sh diff --git a/ct/umami.sh b/ct/umami.sh new file mode 100644 index 000000000..312a504f4 --- /dev/null +++ b/ct/umami.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +function header_info { +clear +cat <<"EOF" + _ + __ ______ ___ ____ _____ ___ (_) + / / / / __ `__ \/ __ `/ __ `__ \/ / +/ /_/ / / / / / / /_/ / / / / / / / +\__,_/_/ /_/ /_/\__,_/_/ /_/ /_/_/ + +EOF +} +header_info +echo -e "Loading..." +APP="umami" +var_disk="8" +var_cpu="1" +var_ram="512" +var_os="debian" +var_version="12" +variables +color +catch_errors + +function default_settings() { + CT_TYPE="1" + PW="" + CT_ID=$NEXTID + HN=$NSAPP + DISK_SIZE="$var_disk" + CORE_COUNT="$var_cpu" + RAM_SIZE="$var_ram" + BRG="vmbr0" + NET="dhcp" + GATE="" + APT_CACHER="" + APT_CACHER_IP="" + DISABLEIP6="no" + MTU="" + SD="" + NS="" + MAC="" + VLAN="" + SSH="no" + VERB="no" + echo_default +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${APP} should be reachable by going to the following URL. + ${BL}http://${IP}:3000${CL} \n" \ No newline at end of file diff --git a/install/umami-install.sh b/install/umami-install.sh new file mode 100644 index 000000000..ce8f008df --- /dev/null +++ b/install/umami-install.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +$STD apt-get install -y git +$STD apt-get install -y gpg +$STD apt-get install -y postgresql +msg_ok "Installed Dependencies" + +msg_info "Setting up Node.js Repository" +mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list +msg_ok "Set up Node.js Repository" + +msg_info "Installing Node.js" +$STD apt-get update +$STD apt-get install -y nodejs +$STD npm install -g yarn +msg_ok "Installed Node.js" + +msg_info "Setting up postgresql" +DB_NAME=umamidb +DB_USER=umami +DB_PASS="$(openssl rand -base64 18 | cut -c1-13)" +SECRET_KEY="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)" +sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" +sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" +sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" +sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" +sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" +echo "" >umami.creds +echo -e "umami Database User: \e[32m$DB_USER\e[0m" >>umami.creds +echo -e "umami Database Password: \e[32m$DB_PASS\e[0m" >>umami.creds +echo -e "umami Database Name: \e[32m$DB_NAME\e[0m" >>umami.creds +msg_ok "Set up postgresql" + +msg_info "Installing Umami (Patience)" +git clone -q https://github.com/umami-software/umami.git /opt/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_info "Creating Service" +cat </etc/systemd/system/umami.service +echo "[Unit] +Description=umami + +[Service] +Type=simple +Restart=always +User=root +WorkingDirectory=/opt/umami +ExecStart=/usr/bin/yarn run start + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now umami.service +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" \ No newline at end of file From 9483d83c5ed4a4d1168448a8e98a223bb225d484 Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 9 May 2024 12:08:07 -0400 Subject: [PATCH 4/8] Update umami-install.sh silent postgres commands --- install/umami-install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install/umami-install.sh b/install/umami-install.sh index ce8f008df..1ac1c1ca1 100644 --- a/install/umami-install.sh +++ b/install/umami-install.sh @@ -39,11 +39,11 @@ DB_NAME=umamidb DB_USER=umami DB_PASS="$(openssl rand -base64 18 | cut -c1-13)" SECRET_KEY="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)" -sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" -sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" -sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" -sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" -sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" +$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" +$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'" echo "" >umami.creds echo -e "umami Database User: \e[32m$DB_USER\e[0m" >>umami.creds echo -e "umami Database Password: \e[32m$DB_PASS\e[0m" >>umami.creds @@ -82,4 +82,4 @@ customize msg_info "Cleaning up" $STD apt-get -y autoremove $STD apt-get -y autoclean -msg_ok "Cleaned" \ No newline at end of file +msg_ok "Cleaned" From afe90a8417912d543e5aa0fafe5fd77a8c9c6cca Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 9 May 2024 12:11:23 -0400 Subject: [PATCH 5/8] Update umami.sh adjust resources --- ct/umami.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ct/umami.sh b/ct/umami.sh index 312a504f4..c921f892b 100644 --- a/ct/umami.sh +++ b/ct/umami.sh @@ -19,9 +19,9 @@ EOF header_info echo -e "Loading..." APP="umami" -var_disk="8" -var_cpu="1" -var_ram="512" +var_disk="12" +var_cpu="2" +var_ram="1024" var_os="debian" var_version="12" variables @@ -58,4 +58,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${APP} should be reachable by going to the following URL. - ${BL}http://${IP}:3000${CL} \n" \ No newline at end of file + ${BL}http://${IP}:3000${CL} \n" From f8b5fbe3deb2a4f68fbef4bae941c071f354fbec Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 9 May 2024 12:25:01 -0400 Subject: [PATCH 6/8] Update umami.sh adjust resources for the build --- ct/umami.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ct/umami.sh b/ct/umami.sh index c921f892b..3ea2d3238 100644 --- a/ct/umami.sh +++ b/ct/umami.sh @@ -21,7 +21,7 @@ echo -e "Loading..." APP="umami" var_disk="12" var_cpu="2" -var_ram="1024" +var_ram="2048" var_os="debian" var_version="12" variables @@ -56,6 +56,10 @@ start build_container description +msg_info "Setting Container to Normal Resources" +pct set $CTID -memory 1024 +pct set $CTID -cores 1 +msg_ok "Set Container to Normal Resources" msg_ok "Completed Successfully!\n" echo -e "${APP} should be reachable by going to the following URL. ${BL}http://${IP}:3000${CL} \n" From 5ecfd4e1b5dfdc707756ab732e9546ffde3a5f6d Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 9 May 2024 13:07:09 -0400 Subject: [PATCH 7/8] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4433fd310..d1e6b77f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ - All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment. - 🚨 **The scripts in the repository will no longer provide support for Proxmox VE 7 starting from July 2024 (scripts will not execute on PVE7). Subsequent Proxmox VE - Support Lifecycle** +## 2024-05-09 + +### Changed + +- **Umami LXC** + - NEW Script + ## 2024-05-08 ### Changed From 4bce8ff991850a463905e614a8f1ec1864f1347b Mon Sep 17 00:00:00 2001 From: tteckster Date: Thu, 9 May 2024 15:02:29 -0400 Subject: [PATCH 8/8] Update install.func tweak --- misc/install.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/install.func b/misc/install.func index ab0b7d5d6..80a5c2e26 100644 --- a/misc/install.func +++ b/misc/install.func @@ -171,7 +171,7 @@ EOF # This function modifies the message of the day (motd) and SSH settings motd_ssh() { echo "export TERM='xterm-256color'" >>/root/.bashrc - echo -e "$APPLICATION LXC provided by https://tteck.github.io/Proxmox/\n" >/etc/motd + echo -e "$APPLICATION LXC provided by https://helper-scripts.com/\n" >/etc/motd chmod -x /etc/update-motd.d/* if [[ "${SSH_ROOT}" == "yes" ]]; then sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config