Skip to content

Commit dd4c556

Browse files
push-app-to-main[bot]MickLeskmichelroegl-brunner
authored
Manage my Damn Life (#5100)
* 'Add new script' * fix curl * curl * Update managemydamnlife-install.sh Remove unneeded msg --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <[email protected]> Co-authored-by: Michel Roegl-Brunner <[email protected]>
1 parent 0e63437 commit dd4c556

File tree

4 files changed

+203
-0
lines changed

4 files changed

+203
-0
lines changed

ct/headers/managemydamnlife

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
__ ___ __ ___ ____ __ _ ____
2+
/ |/ /___ _____ ____ _____ ____ / |/ /_ __ / __ \____ _____ ___ ____ / / (_) __/__
3+
/ /|_/ / __ `/ __ \/ __ `/ __ `/ _ \ / /|_/ / / / / / / / / __ `/ __ `__ \/ __ \ / / / / /_/ _ \
4+
/ / / / /_/ / / / / /_/ / /_/ / __/ / / / / /_/ / / /_/ / /_/ / / / / / / / / / / /___/ / __/ __/
5+
/_/ /_/\__,_/_/ /_/\__,_/\__, /\___/ /_/ /_/\__, / /_____/\__,_/_/ /_/ /_/_/ /_/ /_____/_/_/ \___/
6+
/____/ /____/

ct/managemydamnlife.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: vhsdream
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/intri-in/manage-my-damn-life-nextjs
7+
8+
APP="Manage My Damn Life"
9+
var_tags="${var_tags:-calendar;tasks}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-2048}"
12+
var_disk="${var_disk:-6}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -d /opt/mmdl ]]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit
30+
fi
31+
32+
RELEASE=$(curl -fsSL https://api.github.com/repos/intri-in/manage-my-damn-life-nextjs/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
33+
if [[ "${RELEASE}" != "$(cat /opt/mmdl_version.txt)" ]] || [[ ! -f /opt/mmdl_version.txt ]]; then
34+
msg_info "Stopping $APP"
35+
systemctl stop mmdl
36+
msg_ok "Stopped $APP"
37+
38+
msg_info "Creating Backup"
39+
cp /opt/mmdl/.env /opt/mmdl.env
40+
msg_ok "Backup Created"
41+
42+
msg_info "Updating $APP to v${RELEASE}"
43+
curl -fsSLO "https://github.com/intri-in/manage-my-damn-life-nextjs/archive/refs/tags/v${RELEASE}.zip"
44+
rm -r /opt/mmdl
45+
unzip -q v"$RELEASE".zip
46+
mv manage-my-damn-life-nextjs-"$RELEASE"/ /opt/mmdl
47+
mv /opt/mmdl.env /opt/mmdl/.env
48+
cd /opt/mmdl
49+
$STD npm install
50+
$STD npm run migrate
51+
$STD npm run build
52+
msg_ok "Updated $APP to v${RELEASE}"
53+
54+
msg_info "Starting $APP"
55+
systemctl start mmdl
56+
msg_ok "Started $APP"
57+
58+
msg_info "Cleaning Up"
59+
rm -f ~/v"$RELEASE".zip
60+
msg_ok "Cleanup Completed"
61+
62+
# Last Action
63+
echo "$RELEASE" >/opt/mmdl_version.txt
64+
msg_ok "Update Successful"
65+
else
66+
msg_ok "No update required. ${APP} is already at v${RELEASE}"
67+
fi
68+
exit
69+
}
70+
71+
start
72+
build_container
73+
description
74+
75+
msg_ok "Completed Successfully!\n"
76+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
77+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
78+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "Manage My Damn Life",
3+
"slug": "managemydamnlife",
4+
"categories": [
5+
0
6+
],
7+
"date_created": "2025-06-10",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 3000,
12+
"documentation": "https://manage-my-damn-life-nextjs.readthedocs.io/en/latest/",
13+
"config_path": "/opt/mmdl/.env",
14+
"website": "https://github.com/intri-in/manage-my-damn-life-nextjs",
15+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/manage-my-damn-life.webp",
16+
"description": "Manage My Damn Life (MMDL) is a self-hosted front end for managing your CalDAV tasks and calendars.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/managemydamnlife.sh",
21+
"resources": {
22+
"cpu": 2,
23+
"ram": 2048,
24+
"hdd": 6,
25+
"os": "Debian",
26+
"version": "12"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": []
35+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: vhsdream
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/intri-in/manage-my-damn-life-nextjs
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
NODE_VERSION="20" install_node_and_modules
17+
MYSQL_VERSION="8.0" install_mysql
18+
19+
msg_info "Setting up Database"
20+
DB_NAME="mmdl"
21+
DB_USER="mmdl"
22+
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
23+
$STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
24+
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED by '$DB_PASS';"
25+
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
26+
{
27+
echo "Manage My Damn Life Credentials"
28+
echo "Database User: $DB_USER"
29+
echo "Database Password: $DB_PASS"
30+
echo "Database Name: $DB_NAME"
31+
} >>~/mmdl.creds
32+
msg_ok "Set up Database"
33+
34+
msg_info "Installing ${APPLICATION}"
35+
RELEASE=$(curl -fsSL https://api.github.com/repos/intri-in/manage-my-damn-life-nextjs/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
36+
curl -fsSLO "https://github.com/intri-in/manage-my-damn-life-nextjs/archive/refs/tags/v${RELEASE}.zip"
37+
unzip -q v"$RELEASE".zip
38+
mv manage-my-damn-life-nextjs-"$RELEASE"/ /opt/mmdl
39+
cp /opt/mmdl/sample.env.local /opt/mmdl/.env
40+
41+
sed -i -e 's|db|localhost|' \
42+
-e "s|myuser|${DB_USER}|" \
43+
-e "s|mypassword|${DB_PASS}|" \
44+
-e 's|5433|3306|' \
45+
-e 's|DB_DIALECT=postgres|DB_DIALECT=mysql|' \
46+
-e "s|sample_install_mmdm|${DB_NAME}|" \
47+
-e "s|=PASSWORD|=$(openssl rand -base64 40 | tr -dc 'a-zA-Z0-9' | head -c40)|" \
48+
/opt/mmdl/.env
49+
50+
cd /opt/mmdl
51+
export NEXT_TELEMETRY_DISABLE=1
52+
export CI="true"
53+
$STD npm install
54+
$STD npm run migrate
55+
$STD npm run build
56+
echo "${RELEASE}" >/opt/mmdl_version.txt
57+
msg_ok "Installed ${APPLICATION}"
58+
59+
msg_info "Creating Service"
60+
cat <<EOF >/etc/systemd/system/mmdl.service
61+
[Unit]
62+
Description=${APPLICATION} Service
63+
After=network.target mysql.service
64+
65+
[Service]
66+
WorkingDirectory=/opt/mmdl
67+
EnvironmentFile=/opt/mmdl/.env
68+
ExecStart=/usr/bin/npm run start
69+
Restart=on-abnormal
70+
71+
[Install]
72+
WantedBy=multi-user.target
73+
EOF
74+
systemctl enable -q --now mmdl
75+
msg_ok "Created Service"
76+
77+
motd_ssh
78+
customize
79+
80+
msg_info "Cleaning up"
81+
rm -f ~/v${RELEASE}.zip
82+
$STD apt-get -y autoremove
83+
$STD apt-get -y autoclean
84+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)