Update fumadocs-install.sh

This commit is contained in:
CanbiZ 2025-05-06 10:22:03 +02:00
parent 5ed0ba0d67
commit 0ab110635b

View File

@ -14,34 +14,34 @@ update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt-get install -y \
ca-certificates \ ca-certificates
expect
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules
msg_info "Installing Fumadocs" msg_info "Installing Fumadocs"
fetch_and_deploy_gh_release fuma-nama/fumadocs
export NODE_OPTIONS="--max-old-space-size=4096" export NODE_OPTIONS="--max-old-space-size=4096"
mkdir -p /opt/fumadocs
cd /opt/fumadocs cd /opt/fumadocs
$STD pnpm install $STD pnpm create fumadocs-app
pnpm create fumadocs-app
msg_ok "Installed Fumadocs" msg_ok "Installed Fumadocs"
msg_info "Creating Service" msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/fumadocs.service PROJECT_NAME=$(find . -maxdepth 1 -type d ! -name '.' ! -name '..' | sed 's|^\./||')
cat <<EOF >/etc/systemd/system/fumadocs_$PROJECT_NAME.service
[Unit] [Unit]
Description=Fumadocs Documentation Server Description=Fumadocs Documentation Server
After=network.target After=network.target
[Service] [Service]
WorkingDirectory=/opt/fumadocs WorkingDirectory=/opt/fumadocs/$PROJECT_NAME
ExecStart=/usr/bin/pnpm run dev ExecStart=/usr/bin/pnpm run dev
Restart=always Restart=always
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
systemctl enable -q --now fumadocs_$PROJECT_NAME
msg_ok "Created Service" msg_ok "Created Service"
motd_ssh motd_ssh