#!/usr/bin/env bash # Copyright (c) 2021-2026 community-scripts ORG # Author: vhsdream # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/intri-in/manage-my-damn-life-nextjs source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color verb_ip6 catch_errors setting_up_container network_check update_os msg_info "Installing dependencies" $STD apt install -y build-essential msg_ok "Installed dependencies" NODE_VERSION="22" setup_nodejs setup_mariadb MARIADB_DB_NAME="mmdl" MARIADB_DB_USER="mmdl" MARIADB_DB_CREDS_FILE="$HOME/mmdl.creds" setup_mariadb_db fetch_and_deploy_gh_release "mmdl" "intri-in/manage-my-damn-life-nextjs" "tarball" msg_info "Configuring ${APPLICATION}" cp /opt/mmdl/sample.env.local /opt/mmdl/.env sed -i -e 's|db|localhost|' \ -e "s|myuser|mmdl|" \ -e "s|mypassword|${MARIADB_DB_PASS}|" \ -e 's|5433|3306|' \ -e 's|DB_DIALECT=postgres|DB_DIALECT=mysql|' \ -e "s|sample_install_mmdm|mmdl|" \ -e "s|=PASSWORD|=$(random_password 40)|" \ /opt/mmdl/.env cd /opt/mmdl export NEXT_TELEMETRY_DISABLED=1 export CI="true" $STD npm install $STD npm run migrate $STD npm run build msg_ok "Configured ${APPLICATION}" msg_info "Creating Service" cat </etc/systemd/system/mmdl.service [Unit] Description=${APPLICATION} Service After=network.target mariadb.service [Service] WorkingDirectory=/opt/mmdl EnvironmentFile=/opt/mmdl/.env ExecStart=/usr/bin/npm run start Restart=on-abnormal [Install] WantedBy=multi-user.target EOF systemctl enable -q --now mmdl msg_ok "Created Service" motd_ssh customize cleanup_lxc