Skip to content

Commit 4d99838

Browse files
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 <[email protected]>
1 parent 27ac263 commit 4d99838

File tree

3 files changed

+160
-0
lines changed

3 files changed

+160
-0
lines changed

ct/fumadocs.sh

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/fuma-nama/fumadoc
7+
8+
APP="Fumadocs"
9+
var_tags="${var_tags:-documentation}"
10+
var_cpu="${var_cpu:-2}"
11+
var_ram="${var_ram:-2048}"
12+
var_disk="${var_disk:-5}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -d /opt/fumadocs ]]; then
28+
msg_error "No installation found in /opt/fumadocs!"
29+
exit 1
30+
fi
31+
32+
if [[ ! -f /opt/fumadocs/.projectname ]]; then
33+
msg_error "Project name file not found: /opt/fumadocs/.projectname!"
34+
exit 1
35+
fi
36+
37+
NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules
38+
PROJECT_NAME=$(</opt/fumadocs/.projectname)
39+
PROJECT_DIR="/opt/fumadocs/${PROJECT_NAME}"
40+
SERVICE_NAME="fumadocs_${PROJECT_NAME}.service"
41+
42+
if [[ ! -d "$PROJECT_DIR" ]]; then
43+
msg_error "Project directory does not exist: $PROJECT_DIR"
44+
exit 1
45+
fi
46+
47+
msg_info "Stopping service $SERVICE_NAME"
48+
systemctl stop "$SERVICE_NAME"
49+
msg_ok "Stopped service $SERVICE_NAME"
50+
51+
msg_info "Updating dependencies using pnpm"
52+
cd "$PROJECT_DIR"
53+
$STD pnpm up --latest
54+
$STD pnpm build
55+
msg_ok "Updated dependencies using pnpm"
56+
57+
msg_info "Starting service $SERVICE_NAME"
58+
systemctl start "$SERVICE_NAME"
59+
msg_ok "Started service $SERVICE_NAME"
60+
61+
msg_ok "Fumadocs successfully updated"
62+
exit
63+
}
64+
65+
start
66+
build_container
67+
description
68+
69+
msg_ok "Completed Successfully!\n"
70+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
71+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
72+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"

frontend/public/json/fumadocs.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "Fumadocs",
3+
"slug": "fumadocs",
4+
"categories": [
5+
10
6+
],
7+
"date_created": "2025-05-06",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 3000,
12+
"documentation": "https://fumadocs.vercel.app/docs/ui",
13+
"website": "https://fumadocs.vercel.app/",
14+
"logo": "https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/dev/documents/logo.png",
15+
"config_path": "",
16+
"description": "Fumadocs is a flexible and high-performance framework for creating well-structured documentation websites using Next.js. It allows developers to write content and transform it into structured data. Fumadocs supports various content sources, including MDX and Content Collections, and integrates search solutions like Orama and Algolia. It also provides interactive components to enhance the user experience.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/fumadocs.sh",
21+
"resources": {
22+
"cpu": 2,
23+
"ram": 2048,
24+
"hdd": 5,
25+
"os": "Debian",
26+
"version": "12"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": []
35+
}

install/fumadocs-install.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
7+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
8+
color
9+
verb_ip6
10+
catch_errors
11+
setting_up_container
12+
network_check
13+
update_os
14+
15+
msg_info "Installing Dependencies"
16+
$STD apt-get install -y \
17+
ca-certificates
18+
msg_ok "Installed Dependencies"
19+
20+
NODE_VERSION="22" NODE_MODULE="pnpm@latest" install_node_and_modules
21+
22+
msg_info "Installing Fumadocs"
23+
mkdir -p /opt/fumadocs
24+
cd /opt/fumadocs
25+
pnpm create fumadocs-app
26+
PROJECT_NAME=$(find . -maxdepth 1 -type d ! -name '.' ! -name '..' | sed 's|^\./||')
27+
echo "$PROJECT_NAME" >/opt/fumadocs/.projectname
28+
msg_ok "Installed Fumadocs"
29+
30+
msg_info "Creating Service"
31+
cat <<EOF >/etc/systemd/system/fumadocs_$PROJECT_NAME.service
32+
[Unit]
33+
Description=Fumadocs Documentation Server
34+
After=network.target
35+
36+
[Service]
37+
WorkingDirectory=/opt/fumadocs/$PROJECT_NAME
38+
ExecStart=/usr/bin/pnpm run dev
39+
Restart=always
40+
41+
[Install]
42+
WantedBy=multi-user.target
43+
EOF
44+
systemctl enable -q --now fumadocs_$PROJECT_NAME
45+
msg_ok "Created Service"
46+
47+
motd_ssh
48+
customize
49+
50+
msg_info "Cleaning up"
51+
$STD apt-get -y autoremove
52+
$STD apt-get -y autoclean
53+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)