Add Donetick app script

This commit is contained in:
Frans Stofberg 2025-11-01 22:50:54 +02:00
parent d49a1704e5
commit 4171b1f9dc
5 changed files with 174 additions and 4 deletions

74
ct/Donetick.sh Normal file
View File

@ -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}"

View File

@ -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": []
}

View File

@ -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 <<EOF >/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"

View File

@ -48,7 +48,7 @@ variables() {
# FUNC_DIR="/usr/local/community-scripts/core" # FUNC_DIR="/usr/local/community-scripts/core"
# mkdir -p "$FUNC_DIR" # 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" # BUILD_REV="$FUNC_DIR/build.rev"
# DEVMODE="${DEVMODE:-no}" # DEVMODE="${DEVMODE:-no}"
@ -73,7 +73,7 @@ variables() {
# update_func_file() { # update_func_file() {
# local file="$1" # 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" # local local_path="$FUNC_DIR/$file"
# echo "⬇️ Downloading $file ..." # echo "⬇️ Downloading $file ..."
@ -2488,7 +2488,7 @@ EOF'
install_ssh_keys_into_ct install_ssh_keys_into_ct
# Run application installer # 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 $? exit $?
fi fi
} }

View File

@ -32,7 +32,7 @@ verb_ip6() {
# # This function handles errors # # This function handles errors
# error_handler() { # 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 exit_code="$1"
# local line_number="$2" # local line_number="$2"
# local command="${3:-}" # local command="${3:-}"