mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-03 07:29:36 +00:00
* Scripts: close every msg_info block with msg_ok Past-tense msg_info calls that should have been msg_ok, notices that opened a block before a prompt, and blocks without a closing msg_ok. These already left a stale spinner; with core's block stack they would resume it after every later msg_ok. * Generate passwords with random_password openssl rand -base64 | tr -dc | head -c returned fewer characters than asked for, and the unfiltered | cut variants put / and + into passwords that end up in DSNs and sed expressions. Secrets an app decodes as base64 are unchanged. Requires community-scripts/core#61. * Keep data directories through CLEAN_INSTALL instead of copying them create_backup copied uploads, storage and similar directories twice per update and needed their size again in free space. CLEAN_INSTALL_KEEP moves them aside instead. Only directories the upstream release does not ship, in scripts that restored right after the fetch. Requires community-scripts/core#61. * Drop the 300s uv timeout overrides setup_uv exports UV_HTTP_TIMEOUT=600 now; the scripts' 300 only lowered it. Requires community-scripts/core#61.
77 lines
2.5 KiB
Bash
77 lines
2.5 KiB
Bash
#!/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://docmost.com/ | Github: https://github.com/docmost/docmost
|
||
|
||
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 \
|
||
redis \
|
||
make
|
||
msg_ok "Installed Dependencies"
|
||
|
||
NODE_VERSION="26" NODE_MODULE="pnpm@$(curl -s https://raw.githubusercontent.com/docmost/docmost/main/package.json | jq -r '.packageManager | split("@")[1]')" setup_nodejs
|
||
PG_VERSION="16" setup_postgresql
|
||
PG_DB_NAME="docmost_db" PG_DB_USER="docmost_user" setup_postgresql_db
|
||
fetch_and_deploy_gh_release "docmost" "docmost/docmost" "tarball"
|
||
|
||
msg_info "Configuring Docmost (Patience)"
|
||
cd /opt/docmost
|
||
|
||
# Fix: Docmost EE (audit logs etc.) lives in a git submodule that is NOT
|
||
# included in GitHub tarballs. The community NoopAuditService exists but
|
||
# is only exported by CoreModule – child modules such as UserModule cannot
|
||
# resolve it. Making CoreModule @Global() exposes the token app-wide.
|
||
if [[ ! -f /opt/docmost/apps/server/src/ee/ee.module.ts ]] &&
|
||
! grep -q '@Global()' /opt/docmost/apps/server/src/core/core.module.ts 2>/dev/null; then
|
||
sed -i '/^ Module,$/a\ Global,' /opt/docmost/apps/server/src/core/core.module.ts
|
||
sed -i '/^@Module({$/i @Global()' /opt/docmost/apps/server/src/core/core.module.ts
|
||
fi
|
||
|
||
mv .env.example .env
|
||
mkdir data
|
||
sed -i -e "s|APP_SECRET=.*|APP_SECRET=$(random_password 32)|" \
|
||
-e "s|DATABASE_URL=.*|DATABASE_URL=\"postgres://$PG_DB_USER:$PG_DB_PASS@localhost:5432/$PG_DB_NAME?schema=public\"|" \
|
||
-e "s|FILE_UPLOAD_SIZE_LIMIT=.*|FILE_UPLOAD_SIZE_LIMIT=50mb|" \
|
||
-e "s|DRAWIO_URL=.*|DRAWIO_URL=https://embed.diagrams.net|" \
|
||
-e "s|DISABLE_TELEMETRY=.*|DISABLE_TELEMETRY=true|" \
|
||
-e "s|APP_URL=.*|APP_URL=http://$LOCAL_IP:3000|" \
|
||
-e "s|^STORAGE_DRIVER=azure|#STORAGE_DRIVER=azure|" \
|
||
/opt/docmost/.env
|
||
export NODE_OPTIONS="--max-old-space-size=2048"
|
||
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
||
$STD pnpm install
|
||
$STD pnpm build
|
||
msg_ok "Configured Docmost"
|
||
|
||
msg_info "Creating Service"
|
||
cat <<EOF >/etc/systemd/system/docmost.service
|
||
[Unit]
|
||
Description=Docmost Service
|
||
After=network.target postgresql.service
|
||
|
||
[Service]
|
||
WorkingDirectory=/opt/docmost
|
||
ExecStart=/usr/bin/pnpm start
|
||
Restart=always
|
||
EnvironmentFile=/opt/docmost/.env
|
||
|
||
[Install]
|
||
WantedBy=multi-user.target
|
||
EOF
|
||
systemctl enable -q --now docmost
|
||
msg_ok "Created Service"
|
||
|
||
motd_ssh
|
||
customize
|
||
cleanup_lxc
|