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" APP="jotty"
var_tags="${var_tags:-tasks;notes}" var_tags="${var_tags:-tasks;notes}"
var_cpu="${var_cpu:-2}" var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-4096}" var_ram="${var_ram:-1024}"
var_disk="${var_disk:-8}" var_disk="${var_disk:-4}"
var_os="${var_os:-debian}" var_os="${var_os:-debian}"
var_version="${var_version:-13}" var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}" var_unprivileged="${var_unprivileged:-1}"
@@ -35,61 +35,21 @@ function update_script() {
msg_ok "Stopped Service" msg_ok "Stopped Service"
msg_info "Backing up configuration & data" msg_info "Backing up configuration & data"
cd /opt/jotty cp /opt/jotty/.env /opt/app.env
cp ./.env /opt/app.env [[ -d /opt/jotty/data ]] && mv /opt/jotty/data /opt/data
$STD tar -cf /opt/data_config.tar ./data ./config
msg_ok "Backed up configuration & data" msg_ok "Backed up configuration & data"
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "jotty" "fccview/jotty" "tarball" "latest" "/opt/jotty" CLEAN_INSTALL=1 fetch_and_deploy_gh_release "jotty" "fccview/jotty" "prebuild" "latest" "/opt/jotty" "jotty_*_prebuild.tar.gz"
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" msg_info "Restoring configuration & data"
mv /opt/app.env /opt/jotty/.env 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_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" msg_info "Starting Service"
systemctl start jotty systemctl start jotty
msg_ok "Started Service" msg_ok "Started Service"
rm /opt/data_config.tar
msg_ok "Updated successfully!" msg_ok "Updated successfully!"
fi fi
exit exit

View File

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

View File

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