jotty: full refactor / now use prebuild packages and less ressources (#11059)

* jotty: full refactor / now use prebuild packages and less ressources

* add latest

* llatest
This commit is contained in:
CanbiZ (MickLesk)
2026-01-26 14:44:59 +01:00
committed by GitHub
parent 78bc815a4f
commit 13a4af4300
3 changed files with 16 additions and 79 deletions

View File

@@ -7,9 +7,9 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
APP="jotty"
var_tags="${var_tags:-tasks;notes}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-8}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
@@ -35,61 +35,21 @@ function update_script() {
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
cp /opt/jotty/.env /opt/app.env
[[ -d /opt/jotty/data ]] && mv /opt/jotty/data /opt/data
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"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "jotty" "fccview/jotty" "prebuild" "latest" "/opt/jotty" "jotty_*_prebuild.tar.gz"
msg_info "Restoring configuration & data"
mv /opt/app.env /opt/jotty/.env
$STD tar -xf /opt/data_config.tar
[[ -d /opt/data ]] && mv /opt/data /opt/jotty/data
msg_ok "Restored configuration & data"
msg_info "Updating Service"
cat <<EOF >/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

View File

@@ -19,9 +19,9 @@
"type": "default",
"script": "ct/jotty.sh",
"resources": {
"cpu": 2,
"ram": 4096,
"hdd": 8,
"cpu": 1,
"ram": 1024,
"hdd": 5,
"os": "debian",
"version": "13"
}
@@ -31,10 +31,5 @@
"username": null,
"password": null
},
"notes": [
{
"text": "jotty was previously named rwMarkable",
"type": "info"
}
]
"notes": []
}

View File

@@ -14,33 +14,16 @@ network_check
update_os
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
fetch_and_deploy_gh_release "jotty" "fccview/jotty" "tarball" "latest" "/opt/jotty"
msg_info "Installing ${APPLICATION}"
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
fetch_and_deploy_gh_release "jotty" "fccview/jotty" "prebuild" "latest" "/opt/jotty" "jotty_*_prebuild.tar.gz"
msg_info "Setup jotty"
mkdir -p data/{users,checklists,notes}
cat <<EOF >/opt/jotty/.env
NODE_ENV=production
# --- Uncomment to enable
# APP_URL=https://your-jotty-domain.com
# INTERNAL_API_URL=http://localhost:3000
# HTTPS=true
# SERVE_PUBLIC_IMAGES=yes
# SERVE_PUBLIC_FILES=yes
@@ -53,12 +36,11 @@ NODE_ENV=production
# SSO_MODE=oidc
# OIDC_ISSUER=<your-oidc-issuer-url>
# OIDC_CLIENT_ID=<oidc-client-id>
# APP_URL=<https://app.domain.tld>
# SSO_FALLBACK_LOCAL=yes
# OIDC_CLIENT_SECRET=your_client_secret
# OIDC_ADMIN_GROUPS=admins
EOF
msg_ok "Installed ${APPLICATION}"
msg_ok "Setup jotty"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/jotty.service