add fumadocs

This commit is contained in:
CanbiZ 2025-03-25 11:48:08 +01:00
parent 9112c766b5
commit d040dfdca9
2 changed files with 106 additions and 0 deletions

40
ct/fumadocs.sh Normal file
View File

@ -0,0 +1,40 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://github.com/fuma-nama/fumadoc
APP="Fumadocs"
var_tags="documentation"
var_cpu="3"
var_ram="2048"
var_disk="7"
var_os="debian"
var_version="12"
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!"
exit
fi
}
start
build_container
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 "${TAB}${GATEWAY}${BGN}meilisearch: http://${IP}:5050${CL}"

View File

@ -0,0 +1,66 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/community-scripts/ProxmoxVED/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 \
gnupg \
ca-certificates
msg_ok "Installed Dependencies"
msg_info "Installing Node.js"
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
$STD apt-get update
$STD apt-get install -y nodejs
$STD npm install -g bun
msg_ok "Installed Node.js"
msg_info "Installing Fumadocs"
temp_file=$(mktemp)
RELEASE=$(curl -s https://api.github.com/repos/fuma-nama/fumadocs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
export NODE_OPTIONS="--max-old-space-size=2048"
wget -q https://github.com/fuma-nama/fumadocs/archive/refs/tags/${RELEASE}.tar.gz -O $temp_file
tar zxf $temp_file
mv fumadocs-* "${PWD}/fumadocs"
cd /opt/fumadocs
$STD bun install
bun create fumadocs-app
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Fumadocs"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/fumadocs.service
[Unit]
Description=Fumadocs Documentation Server
After=network.target
[Service]
WorkingDirectory=/opt/fumadocs
ExecStart=/usr/bin/bun run dev
Restart=always
[Install]
WantedBy=multi-user.target
msg_ok "Created Service"
EOF
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"