Compare commits

..
Author SHA1 Message Date
push-app-to-main[bot] 8e0044c779 Add hedgedoc (ct) 2026-11-23 07:47:51 +00:00
3 changed files with 104 additions and 83 deletions

No files matched your search

+20 -18
View File
@@ -4,16 +4,16 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/windmill-labs/windmill
# Source: https://github.com/hedgedoc/hedgedoc
APP="Windmill"
var_tags="${var_tags:-automation;workflow;scripts}"
APP="HedgeDoc"
var_tags="${var_tags:-notes;markdown}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-10}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-no}" # upstream ships the CE binary for amd64 only
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
@@ -26,24 +26,26 @@ function update_script() {
check_container_storage
check_container_resources
if [[ ! -f /opt/windmill/windmill ]]; then
if [[ ! -d /opt/hedgedoc ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "windmill" "windmill-labs/windmill"; then
msg_info "Stopping Windmill"
systemctl stop windmill
msg_ok "Stopped Windmill"
if check_for_gh_release "hedgedoc" "hedgedoc/hedgedoc"; then
msg_info "Stopping HedgeDoc"
systemctl stop hedgedoc
msg_ok "Stopped HedgeDoc"
setup_uv
NODE_VERSION="24" NODE_MODULE="bun" setup_nodejs
fetch_and_deploy_gh_release "windmill" "windmill-labs/windmill" "singlefile" "latest" "/opt/windmill" "windmill-amd64"
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "windmill-duckdb" "windmill-labs/windmill" "singlefile" "latest" "/opt/windmill" "windmill_duckdb_runner"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "hedgedoc" "hedgedoc/hedgedoc" "prebuild" "latest" "/opt/hedgedoc" "hedgedoc-*.tar.gz"
msg_info "Starting Windmill"
systemctl start windmill
msg_ok "Started Windmill"
msg_info "Installing HedgeDoc Dependencies"
cd /opt/hedgedoc
$STD yarn workspaces focus --production
msg_ok "Installed HedgeDoc Dependencies"
msg_info "Starting HedgeDoc"
systemctl start hedgedoc
msg_ok "Started HedgeDoc"
msg_ok "Updated successfully!"
fi
exit
@@ -56,4 +58,4 @@ 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 "${GATEWAY}${BGN}http://${IP}:8000${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}:3000${CL}"
+84
View File
@@ -0,0 +1,84 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/hedgedoc/hedgedoc
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y \
build-essential \
git \
python3
msg_ok "Installed Dependencies"
PG_VERSION="18" setup_postgresql
PG_DB_NAME="hedgedoc" PG_DB_USER="hedgedoc" setup_postgresql_db
NODE_VERSION="24" NODE_MODULE="yarn" setup_nodejs
fetch_and_deploy_gh_release "hedgedoc" "hedgedoc/hedgedoc" "prebuild" "latest" "/opt/hedgedoc" "hedgedoc-*.tar.gz"
msg_info "Installing HedgeDoc Dependencies"
cd /opt/hedgedoc
$STD yarn workspaces focus --production
msg_ok "Installed HedgeDoc Dependencies"
msg_info "Configuring HedgeDoc"
mkdir -p /opt/hedgedoc_data/uploads
cat <<EOF >/opt/hedgedoc_data/config.json
{
"production": {
"domain": "${LOCAL_IP}",
"urlAddPort": true,
"sessionSecret": "$(openssl rand -hex 64)",
"db": {
"dialect": "postgres",
"host": "localhost",
"port": 5432,
"database": "${PG_DB_NAME}",
"username": "${PG_DB_USER}",
"password": "${PG_DB_PASS}"
},
"uploadsPath": "/opt/hedgedoc_data/uploads",
"allowAnonymous": false,
"allowAnonymousEdits": true,
"enableStatsApi": false
}
}
EOF
chmod 600 /opt/hedgedoc_data/config.json
msg_ok "Configured HedgeDoc"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/hedgedoc.service
[Unit]
Description=HedgeDoc
After=network.target postgresql.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/hedgedoc
Environment=NODE_ENV=production
Environment=CMD_CONFIG_FILE=/opt/hedgedoc_data/config.json
ExecStart=/usr/bin/node app.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now hedgedoc
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc
-65
View File
@@ -1,65 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/windmill-labs/windmill
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
PG_VERSION="18" setup_postgresql
PG_DB_NAME="windmill" PG_DB_USER="windmill" setup_postgresql_db
setup_uv
NODE_VERSION="24" NODE_MODULE="bun" setup_nodejs
fetch_and_deploy_gh_release "windmill" "windmill-labs/windmill" "singlefile" "latest" "/opt/windmill" "windmill-amd64"
USE_ORIGINAL_FILENAME="true" fetch_and_deploy_gh_release "windmill-duckdb" "windmill-labs/windmill" "singlefile" "latest" "/opt/windmill" "windmill_duckdb_runner"
msg_info "Creating Windmill Database Roles"
# Windmill's migrations can only create these as superuser (windmill_admin needs BYPASSRLS)
$STD sudo -u postgres psql -c "CREATE ROLE windmill_user; CREATE ROLE windmill_admin WITH BYPASSRLS; GRANT windmill_user TO windmill_admin; GRANT windmill_admin, windmill_user TO windmill;"
msg_ok "Created Windmill Database Roles"
msg_info "Configuring Windmill"
mkdir -p /opt/windmill_data
cat <<EOF >/opt/windmill_data/.env
DATABASE_URL=postgres://windmill:${PG_DB_PASS}@127.0.0.1:5432/windmill?sslmode=disable
MODE=standalone
BASE_URL=http://${LOCAL_IP}:8000
EOF
chmod 600 /opt/windmill_data/.env
msg_ok "Configured Windmill"
msg_info "Creating Windmill Service"
cat <<EOF >/etc/systemd/system/windmill.service
[Unit]
Description=Windmill
After=network.target postgresql.service
Requires=postgresql.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/windmill
EnvironmentFile=/opt/windmill_data/.env
# ~/.windmill is the version file, but Windmill keeps its standalone bundles in \$HOME/.windmill
Environment=HOME=/opt/windmill_data
Environment=WINDMILL_DIR=/opt/windmill_data
ExecStart=/opt/windmill/windmill
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now windmill
msg_ok "Created Windmill Service"
motd_ssh
customize
cleanup_lxc