From 4171b1f9dc0a08c714dfd676ca2604b76c037e4c Mon Sep 17 00:00:00 2001 From: Frans Stofberg Date: Sat, 1 Nov 2025 22:50:54 +0200 Subject: [PATCH] Add Donetick app script --- ct/Donetick.sh | 74 ++++++++++++++++++++++++++++++ frontend/public/json/Donetick.json | 36 +++++++++++++++ install/Donetick-install.sh | 60 ++++++++++++++++++++++++ misc/build.func | 6 +-- misc/install.func | 2 +- 5 files changed, 174 insertions(+), 4 deletions(-) create mode 100644 ct/Donetick.sh create mode 100644 frontend/public/json/Donetick.json create mode 100644 install/Donetick-install.sh diff --git a/ct/Donetick.sh b/ct/Donetick.sh new file mode 100644 index 000000000..f009786c3 --- /dev/null +++ b/ct/Donetick.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/fstof/ProxmoxVED/refs/heads/donetick/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: fstof +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/donetick/donetick + +# App Default Values +APP="Donetick" +var_tags="${var_tags:-productivity;tasks}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + # Check if installation is present | -f for file, -d for folder + if [[ ! -f /opt/donetick ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + # Crawling the new version and checking whether an update is required + RELEASE=$(curl -fsSL https://api.github.com/repos/donetick/donetick/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + if [[ "${RELEASE}" != "$(cat /opt/donetick/donetick_version.txt)" ]] || [[ ! -f /opt/donetick/donetick_version.txt ]]; then + # Stopping Services + msg_info "Stopping $APP" + systemctl stop donetick + msg_ok "Stopped $APP" + + # Execute Update + msg_info "Updating $APP to ${RELEASE}" + curl -fsSL "https://github.com/donetick/donetick/releases/download/${RELEASE}/donetick_Linux_x86_64.tar.gz" | tar -xz -C . + mv donetick "/opt/donetick/donetick" + msg_ok "Updated $APP to ${RELEASE}" + + # Starting Services + msg_info "Starting $APP" + systemctl start donetick + msg_ok "Started $APP" + + # Cleaning up + msg_info "Cleaning Up" + rm -rf config + msg_ok "Cleanup Completed" + + # Last Action + echo "${RELEASE}" > /opt/donetick/donetick_version.txt + msg_ok "Update Successful" + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + fi + exit +} + +start +build_container +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}:2021${CL}" diff --git a/frontend/public/json/Donetick.json b/frontend/public/json/Donetick.json new file mode 100644 index 000000000..030fc2438 --- /dev/null +++ b/frontend/public/json/Donetick.json @@ -0,0 +1,36 @@ +{ + "name": "Donetick", + "slug": "donetick", + "categories": [ + 0, + 12 + ], + "date_created": "2025-11-01", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 2021, + "documentation": null, + "config_path": "", + "website": "https://donetick.com", + "logo": "https://donetick.com/assets/logo-inhNxF6J.svg", + "description": "The smart task manager that keeps individuals and families organized with intelligent scheduling and fair task distribution", + "install_methods": [ + { + "type": "default", + "script": "ct/Donetick.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 8, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} diff --git a/install/Donetick-install.sh b/install/Donetick-install.sh new file mode 100644 index 000000000..b8a9d8c39 --- /dev/null +++ b/install/Donetick-install.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: fstof +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/donetick/donetick + +# Import Functions und Setup +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +# Installing Dependencies +msg_info "Installing Dependencies" +$STD apt install -y \ + ca-certificates \ + libc6-compat +msg_ok "Installed Dependencies" + +msg_info "Setup Donetick" +RELEASE=$(curl -fsSL https://api.github.com/repos/donetick/donetick/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + +mkdir -p /opt/donetick +cd /opt/donetick +curl -fsSL "https://github.com/donetick/donetick/releases/download/${RELEASE}/donetick_Linux_x86_64.tar.gz" | tar -xz -C . + +echo "${RELEASE}" > /opt/donetick/donetick_version.txt +msg_ok "Setup Donetick" + +# Creating Service (if needed) +msg_info "Creating Service" +cat </etc/systemd/system/donetick.service +[Unit] +Description=Donetick Service +After=network.target + +[Service] +Environment="DT_ENV=selfhosted" +WorkingDirectory=/opt/donetick +ExecStart=/opt/donetick/donetick +Restart=always + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now donetick +msg_ok "Created Service" + +motd_ssh +customize + +# Cleanup +msg_info "Cleaning up" +$STD apt -y autoremove +$STD apt -y autoclean +msg_ok "Cleaned" diff --git a/misc/build.func b/misc/build.func index eb2183872..797f2b405 100644 --- a/misc/build.func +++ b/misc/build.func @@ -48,7 +48,7 @@ variables() { # FUNC_DIR="/usr/local/community-scripts/core" # mkdir -p "$FUNC_DIR" -# BUILD_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func" +# BUILD_URL="https://raw.githubusercontent.com/fstof/ProxmoxVED/refs/heads/donetick/misc/build.func" # BUILD_REV="$FUNC_DIR/build.rev" # DEVMODE="${DEVMODE:-no}" @@ -73,7 +73,7 @@ variables() { # update_func_file() { # local file="$1" -# local url="https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/$file" +# local url="https://raw.githubusercontent.com/fstof/ProxmoxVED/refs/heads/donetick/misc/$file" # local local_path="$FUNC_DIR/$file" # echo "⬇️ Downloading $file ..." @@ -2488,7 +2488,7 @@ EOF' install_ssh_keys_into_ct # Run application installer - if ! lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/${var_install}.sh)"; then + if ! lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/fstof/ProxmoxVED/refs/heads/donetick/install/${var_install}.sh)"; then exit $? fi } diff --git a/misc/install.func b/misc/install.func index f741b921d..f3b805a8d 100644 --- a/misc/install.func +++ b/misc/install.func @@ -32,7 +32,7 @@ verb_ip6() { # # This function handles errors # error_handler() { -# source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func) +# source <(curl -fsSL https://raw.githubusercontent.com/fstof/ProxmoxVED/refs/heads/donetick/misc/api.func) # local exit_code="$1" # local line_number="$2" # local command="${3:-}"