mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 02:12:49 +00:00 
			
		
		
		
	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>
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							27ac2633c7
						
					
				
				
					commit
					4d99838209
				
			
							
								
								
									
										72
									
								
								ct/fumadocs.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										72
									
								
								ct/fumadocs.sh
									
									
									
									
									
										Normal file
									
								
							@@ -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)
 | 
			
		||||
  PROJECT_DIR="/opt/fumadocs/${PROJECT_NAME}"
 | 
			
		||||
  SERVICE_NAME="fumadocs_${PROJECT_NAME}.service"
 | 
			
		||||
 | 
			
		||||
  if [[ ! -d "$PROJECT_DIR" ]]; then
 | 
			
		||||
    msg_error "Project directory does not exist: $PROJECT_DIR"
 | 
			
		||||
    exit 1
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  msg_info "Stopping service $SERVICE_NAME"
 | 
			
		||||
  systemctl stop "$SERVICE_NAME"
 | 
			
		||||
  msg_ok "Stopped service $SERVICE_NAME"
 | 
			
		||||
 | 
			
		||||
  msg_info "Updating dependencies using pnpm"
 | 
			
		||||
  cd "$PROJECT_DIR"
 | 
			
		||||
  $STD pnpm up --latest
 | 
			
		||||
  $STD pnpm build
 | 
			
		||||
  msg_ok "Updated dependencies using pnpm"
 | 
			
		||||
 | 
			
		||||
  msg_info "Starting service $SERVICE_NAME"
 | 
			
		||||
  systemctl start "$SERVICE_NAME"
 | 
			
		||||
  msg_ok "Started service $SERVICE_NAME"
 | 
			
		||||
 | 
			
		||||
  msg_ok "Fumadocs successfully updated"
 | 
			
		||||
  exit
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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}http://${IP}:3000${CL}"
 | 
			
		||||
							
								
								
									
										35
									
								
								frontend/public/json/fumadocs.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								frontend/public/json/fumadocs.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "Fumadocs",
 | 
			
		||||
  "slug": "fumadocs",
 | 
			
		||||
  "categories": [
 | 
			
		||||
    10
 | 
			
		||||
  ],
 | 
			
		||||
  "date_created": "2025-05-06",
 | 
			
		||||
  "type": "ct",
 | 
			
		||||
  "updateable": true,
 | 
			
		||||
  "privileged": false,
 | 
			
		||||
  "interface_port": 3000,
 | 
			
		||||
  "documentation": "https://fumadocs.vercel.app/docs/ui",
 | 
			
		||||
  "website": "https://fumadocs.vercel.app/",
 | 
			
		||||
  "logo": "https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/dev/documents/logo.png",
 | 
			
		||||
  "config_path": "",
 | 
			
		||||
  "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.",
 | 
			
		||||
  "install_methods": [
 | 
			
		||||
    {
 | 
			
		||||
      "type": "default",
 | 
			
		||||
      "script": "ct/fumadocs.sh",
 | 
			
		||||
      "resources": {
 | 
			
		||||
        "cpu": 2,
 | 
			
		||||
        "ram": 2048,
 | 
			
		||||
        "hdd": 5,
 | 
			
		||||
        "os": "Debian",
 | 
			
		||||
        "version": "12"
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "default_credentials": {
 | 
			
		||||
    "username": null,
 | 
			
		||||
    "password": null
 | 
			
		||||
  },
 | 
			
		||||
  "notes": []
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										53
									
								
								install/fumadocs-install.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								install/fumadocs-install.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
			
		||||
#!/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"
 | 
			
		||||
		Reference in New Issue
	
	Block a user