From 4d998382097975cfc8d054b0b6d66b1b8f3b5e12 Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 11:11:45 +0200 Subject: [PATCH] Fumadocs (#4263) * 'Add new script' * change source * remove node options --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> --- ct/fumadocs.sh | 72 ++++++++++++++++++++++++++++++ frontend/public/json/fumadocs.json | 35 +++++++++++++++ install/fumadocs-install.sh | 53 ++++++++++++++++++++++ 3 files changed, 160 insertions(+) create mode 100644 ct/fumadocs.sh create mode 100644 frontend/public/json/fumadocs.json create mode 100644 install/fumadocs-install.sh diff --git a/ct/fumadocs.sh b/ct/fumadocs.sh new file mode 100644 index 000000000..244f2f2db --- /dev/null +++ b/ct/fumadocs.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/fuma-nama/fumadoc + +APP="Fumadocs" +var_tags="${var_tags:-documentation}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-5}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +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/fumadocs ]]; then + msg_error "No installation found in /opt/fumadocs!" + exit 1 + fi + + if [[ ! -f /opt/fumadocs/.projectname ]]; then + msg_error "Project name file not found: /opt/fumadocs/.projectname!" + exit 1 + fi + + NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules + PROJECT_NAME=$(/opt/fumadocs/.projectname +msg_ok "Installed Fumadocs" + +msg_info "Creating Service" +cat </etc/systemd/system/fumadocs_$PROJECT_NAME.service +[Unit] +Description=Fumadocs Documentation Server +After=network.target + +[Service] +WorkingDirectory=/opt/fumadocs/$PROJECT_NAME +ExecStart=/usr/bin/pnpm run dev +Restart=always + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now fumadocs_$PROJECT_NAME +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned"