From 3d4a95cbd74e8e573d5c7f43e65e0ba342aca759 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:46:29 +0100 Subject: [PATCH] test jotty --- ct/jotty.sh | 105 +++++++++++++++++++++++++++++++++++++++ install/jotty-install.sh | 85 +++++++++++++++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 ct/jotty.sh create mode 100644 install/jotty-install.sh diff --git a/ct/jotty.sh b/ct/jotty.sh new file mode 100644 index 000000000..9e3c39428 --- /dev/null +++ b/ct/jotty.sh @@ -0,0 +1,105 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: vhsdream +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/fccview/jotty + +APP="jotty" +var_tags="${var_tags:-tasks;notes}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-6}" +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 + + if [[ ! -d /opt/jotty ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "jotty" "fccview/jotty"; then + msg_info "Stopping Service" + systemctl stop jotty + msg_ok "Stopped Service" + + msg_info "Backing up configuration & data" + cd /opt/jotty + cp ./.env /opt/app.env + $STD tar -cf /opt/data_config.tar ./data ./config + msg_ok "Backed up configuration & data" + + NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "jotty" "fccview/jotty" "tarball" "latest" "/opt/jotty" + + msg_info "Updating jotty" + cd /opt/jotty + unset NODE_OPTIONS + export NODE_OPTIONS="--max-old-space-size=3072" + $STD yarn --frozen-lockfile + $STD yarn next telemetry disable + $STD yarn build + + [ -d "public" ] && cp -r public .next/standalone/ + [ -d "howto" ] && cp -r howto .next/standalone/ + mkdir -p .next/standalone/.next + cp -r .next/static .next/standalone/.next/ + + mv .next/standalone /tmp/jotty_standalone + rm -rf ./* .next .git .gitignore .yarn + mv /tmp/jotty_standalone/* . + mv /tmp/jotty_standalone/.[!.]* . 2>/dev/null || true + rm -rf /tmp/jotty_standalone + msg_ok "Updated jotty" + + msg_info "Restoring configuration & data" + mv /opt/app.env /opt/jotty/.env + $STD tar -xf /opt/data_config.tar + msg_ok "Restored configuration & data" + + msg_info "Updating Service" + cat </etc/systemd/system/jotty.service +[Unit] +Description=jotty server +After=network.target + +[Service] +WorkingDirectory=/opt/jotty +EnvironmentFile=/opt/jotty/.env +ExecStart=/usr/bin/node server.js +Restart=on-abnormal + +[Install] +WantedBy=multi-user.target +EOF + systemctl daemon-reload + msg_ok "Updated Service" + + msg_info "Starting Service" + systemctl start jotty + msg_ok "Started Service" + rm /opt/data_config.tar + msg_ok "Updated successfully!" + 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}:3000${CL}" diff --git a/install/jotty-install.sh b/install/jotty-install.sh new file mode 100644 index 000000000..1545617c3 --- /dev/null +++ b/install/jotty-install.sh @@ -0,0 +1,85 @@ +#!/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/fccview/jotty + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs +#fetch_and_deploy_gh_release "jotty" "fccview/jotty" "tarball" "latest" "/opt/jotty" +wget -q https://github.com/fccview/jotty/releases/download/untagged-c9147656f5ebbb45b023/jotty-prebuild-develop.tar.gz -O /tmp/jotty.tar.gz +tar -xzf /tmp/jotty.tar.gz -C /opt/jotty --strip-components=1 + +msg_info "Setup jotty" +cd /opt/jotty +unset NODE_OPTIONS +export NODE_OPTIONS="--max-old-space-size=3072" +$STD yarn --frozen-lockfile +$STD yarn next telemetry disable +$STD yarn build + +[ -d "public" ] && cp -r public .next/standalone/ +[ -d "howto" ] && cp -r howto .next/standalone/ +mkdir -p .next/standalone/.next +cp -r .next/static .next/standalone/.next/ + +mv .next/standalone /tmp/jotty_standalone +rm -rf ./* .next .git .gitignore .yarn +mv /tmp/jotty_standalone/* . +mv /tmp/jotty_standalone/.[!.]* . 2>/dev/null || true +rm -rf /tmp/jotty_standalone + +mkdir -p data/{users,checklists,notes} + +cat </opt/jotty/.env +NODE_ENV=production + +# --- Uncomment to enable +# HTTPS=true +# SERVE_PUBLIC_IMAGES=yes +# SERVE_PUBLIC_FILES=yes +# SERVE_PUBLIC_VIDEOS=yes +# STOP_CHECK_UPDATES=yes +# --- For troubleshooting +# DEBUGGER=true + +# --- SSO with OIDC (optional) +# SSO_MODE=oidc +# OIDC_ISSUER= +# OIDC_CLIENT_ID= +# APP_URL= +# SSO_FALLBACK_LOCAL=yes +# OIDC_CLIENT_SECRET=your_client_secret +# OIDC_ADMIN_GROUPS=admins +EOF +msg_ok "Installed ${APPLICATION}" + +msg_info "Creating Service" +cat </etc/systemd/system/jotty.service +[Unit] +Description=jotty server +After=network.target + +[Service] +WorkingDirectory=/opt/jotty +EnvironmentFile=/opt/jotty/.env +ExecStart=/usr/bin/node server.js +Restart=on-abnormal + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now jotty +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc