1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-05-06 15:23:08 +00:00
ProxmoxVE/install/fumadocs-install.sh
push-app-to-main[bot] 4d99838209
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>
2025-05-06 11:11:45 +02:00

54 lines
1.2 KiB
Bash

#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
ca-certificates
msg_ok "Installed Dependencies"
NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules
msg_info "Installing Fumadocs"
mkdir -p /opt/fumadocs
cd /opt/fumadocs
pnpm create fumadocs-app
PROJECT_NAME=$(find . -maxdepth 1 -type d ! -name '.' ! -name '..' | sed 's|^\./||')
echo "$PROJECT_NAME" >/opt/fumadocs/.projectname
msg_ok "Installed Fumadocs"
msg_info "Creating Service"
cat <<EOF >/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"