mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-24 14:05:59 +01:00
Compare commits
5 Commits
booklore_v
...
add-script
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e83e5ef167 | ||
|
|
8d845f7bbf | ||
|
|
9e87b79338 | ||
|
|
9c6cd7179a | ||
|
|
64d8ac5f5e |
@@ -30,7 +30,7 @@ function update_script() {
|
||||
fi
|
||||
|
||||
if check_for_gh_release "booklore" "booklore-app/BookLore"; then
|
||||
JAVA_VERSION="25" setup_java
|
||||
JAVA_VERSION="21" setup_java
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
setup_mariadb
|
||||
setup_yq
|
||||
@@ -60,16 +60,11 @@ function update_script() {
|
||||
$STD npm run build --configuration=production
|
||||
msg_ok "Built Frontend"
|
||||
|
||||
msg_info "Embedding Frontend into Backend"
|
||||
mkdir -p /opt/booklore/booklore-api/src/main/resources/static
|
||||
cp -r /opt/booklore/booklore-ui/dist/booklore/browser/* /opt/booklore/booklore-api/src/main/resources/static/
|
||||
msg_ok "Embedded Frontend into Backend"
|
||||
|
||||
msg_info "Building Backend"
|
||||
cd /opt/booklore/booklore-api
|
||||
APP_VERSION=$(get_latest_github_release "booklore-app/BookLore")
|
||||
yq eval ".app.version = \"${APP_VERSION}\"" -i src/main/resources/application.yaml
|
||||
$STD ./gradlew clean build -x test --no-daemon
|
||||
$STD ./gradlew clean build --no-daemon
|
||||
mkdir -p /opt/booklore/dist
|
||||
JAR_PATH=$(find /opt/booklore/booklore-api/build/libs -maxdepth 1 -type f -name "booklore-api-*.jar" ! -name "*plain*" | head -n1)
|
||||
if [[ -z "$JAR_PATH" ]]; then
|
||||
@@ -79,22 +74,9 @@ function update_script() {
|
||||
cp "$JAR_PATH" /opt/booklore/dist/app.jar
|
||||
msg_ok "Built Backend"
|
||||
|
||||
if systemctl is-active --quiet nginx 2>/dev/null; then
|
||||
msg_info "Removing Nginx (no longer needed)"
|
||||
systemctl disable --now nginx
|
||||
$STD apt-get purge -y nginx nginx-common
|
||||
msg_ok "Removed Nginx"
|
||||
fi
|
||||
|
||||
if ! grep -q "^SERVER_PORT=" /opt/booklore_storage/.env 2>/dev/null; then
|
||||
echo "SERVER_PORT=6060" >>/opt/booklore_storage/.env
|
||||
fi
|
||||
|
||||
sed -i 's|ExecStart=/usr/bin/java -jar|ExecStart=/usr/bin/java -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+UseCompactObjectHeaders -jar|' /etc/systemd/system/booklore.service
|
||||
systemctl daemon-reload
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start booklore
|
||||
systemctl reload nginx
|
||||
rm -rf /opt/booklore_bak
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
|
||||
55
ct/seaweedfs.sh
Normal file
55
ct/seaweedfs.sh
Normal file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/seaweedfs/seaweedfs
|
||||
|
||||
APP="SeaweedFS"
|
||||
var_tags="${var_tags:-storage;s3;filesystem}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-16}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
var_fuse="${var_fuse:-yes}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /opt/seaweedfs/weed ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "seaweedfs" "seaweedfs/seaweedfs"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop seaweedfs
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
fetch_and_deploy_gh_release "seaweedfs" "seaweedfs/seaweedfs" "prebuild" "latest" "/opt/seaweedfs" "linux_amd64.tar.gz"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start seaweedfs
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
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}:9333${CL}"
|
||||
48
frontend/public/json/seaweedfs.json
Normal file
48
frontend/public/json/seaweedfs.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "SeaweedFS",
|
||||
"slug": "seaweedfs",
|
||||
"categories": [
|
||||
11
|
||||
],
|
||||
"date_created": "2026-02-22",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": 9333,
|
||||
"documentation": "https://github.com/seaweedfs/seaweedfs/wiki",
|
||||
"website": "https://seaweedfs.com/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/seaweedfs.webp",
|
||||
"config_path": "",
|
||||
"description": "SeaweedFS is a fast distributed storage system for blobs, objects, files, and data lakes, with O(1) disk seek, S3 API, FUSE mount, WebDAV, and cloud tiering support.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/seaweedfs.sh",
|
||||
"resources": {
|
||||
"cpu": 2,
|
||||
"ram": 2048,
|
||||
"hdd": 16,
|
||||
"os": "Debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "Master UI available at port 9333, Filer UI at port 8888, S3 API at port 8333.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Data is stored in /opt/seaweedfs-data.",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "FUSE mounting requires fuse3 (pre-installed).",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -13,7 +13,11 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
JAVA_VERSION="25" setup_java
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y nginx
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
JAVA_VERSION="21" setup_java
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
setup_mariadb
|
||||
setup_yq
|
||||
@@ -26,11 +30,6 @@ $STD npm install --force
|
||||
$STD npm run build --configuration=production
|
||||
msg_ok "Built Frontend"
|
||||
|
||||
msg_info "Embedding Frontend into Backend"
|
||||
mkdir -p /opt/booklore/booklore-api/src/main/resources/static
|
||||
cp -r /opt/booklore/booklore-ui/dist/booklore/browser/* /opt/booklore/booklore-api/src/main/resources/static/
|
||||
msg_ok "Embedded Frontend into Backend"
|
||||
|
||||
msg_info "Creating Environment"
|
||||
mkdir -p /opt/booklore_storage/{data,books,bookdrop}
|
||||
cat <<EOF >/opt/booklore_storage/.env
|
||||
@@ -42,7 +41,6 @@ DATABASE_PASSWORD=${MARIADB_DB_PASS}
|
||||
# App Configuration (Spring Boot mapping from app.* properties)
|
||||
APP_PATH_CONFIG=/opt/booklore_storage/data
|
||||
APP_BOOKDROP_FOLDER=/opt/booklore_storage/bookdrop
|
||||
SERVER_PORT=6060
|
||||
EOF
|
||||
msg_ok "Created Environment"
|
||||
|
||||
@@ -50,7 +48,7 @@ msg_info "Building Backend"
|
||||
cd /opt/booklore/booklore-api
|
||||
APP_VERSION=$(get_latest_github_release "booklore-app/BookLore")
|
||||
yq eval ".app.version = \"${APP_VERSION}\"" -i src/main/resources/application.yaml
|
||||
$STD ./gradlew clean build -x test --no-daemon
|
||||
$STD ./gradlew clean build --no-daemon
|
||||
mkdir -p /opt/booklore/dist
|
||||
JAR_PATH=$(find /opt/booklore/booklore-api/build/libs -maxdepth 1 -type f -name "booklore-api-*.jar" ! -name "*plain*" | head -n1)
|
||||
if [[ -z "$JAR_PATH" ]]; then
|
||||
@@ -60,6 +58,16 @@ fi
|
||||
cp "$JAR_PATH" /opt/booklore/dist/app.jar
|
||||
msg_ok "Built Backend"
|
||||
|
||||
msg_info "Configuring Nginx"
|
||||
rm -rf /usr/share/nginx/html
|
||||
ln -s /opt/booklore/booklore-ui/dist/booklore/browser /usr/share/nginx/html
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
cp /opt/booklore/nginx.conf /etc/nginx/nginx.conf
|
||||
sed -i 's/listen \${BOOKLORE_PORT};/listen 6060;/' /etc/nginx/nginx.conf
|
||||
sed -i 's/listen \[::\]:${BOOKLORE_PORT};/listen [::]:6060;/' /etc/nginx/nginx.conf
|
||||
systemctl restart nginx
|
||||
msg_ok "Configured Nginx"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/booklore.service
|
||||
[Unit]
|
||||
@@ -70,7 +78,7 @@ After=network.target mariadb.service
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/booklore/dist
|
||||
ExecStart=/usr/bin/java -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+UseCompactObjectHeaders -jar /opt/booklore/dist/app.jar
|
||||
ExecStart=/usr/bin/java -jar /opt/booklore/dist/app.jar
|
||||
EnvironmentFile=/opt/booklore_storage/.env
|
||||
SuccessExitStatus=143
|
||||
TimeoutStopSec=10
|
||||
|
||||
50
install/seaweedfs-install.sh
Normal file
50
install/seaweedfs-install.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/seaweedfs/seaweedfs
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y fuse3
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
fetch_and_deploy_gh_release "seaweedfs" "seaweedfs/seaweedfs" "prebuild" "latest" "/opt/seaweedfs" "linux_amd64.tar.gz"
|
||||
|
||||
msg_info "Setting up SeaweedFS"
|
||||
mkdir -p /opt/seaweedfs-data
|
||||
ln -sf /opt/seaweedfs/weed /usr/local/bin/weed
|
||||
msg_ok "Set up SeaweedFS"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/seaweedfs.service
|
||||
[Unit]
|
||||
Description=SeaweedFS Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/seaweedfs
|
||||
ExecStart=/opt/seaweedfs/weed server -dir=/opt/seaweedfs-data -master.port=9333 -volume.port=8080 -filer -s3
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
LimitNOFILE=65536
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now seaweedfs
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -3578,13 +3578,6 @@ build_container() {
|
||||
# DEV_MODE exports (optional, for debugging)
|
||||
export BUILD_LOG="$BUILD_LOG"
|
||||
export INSTALL_LOG="/root/.install-${SESSION_ID}.log"
|
||||
|
||||
# Keep host-side logging on BUILD_LOG (not exported — invisible to container)
|
||||
# Without this, get_active_logfile() would return INSTALL_LOG (a container path)
|
||||
# and all host msg_info/msg_ok/msg_error would write to /root/.install-SESSION.log
|
||||
# on the HOST instead of BUILD_LOG, causing incomplete telemetry logs.
|
||||
_HOST_LOGFILE="$BUILD_LOG"
|
||||
|
||||
export dev_mode="${dev_mode:-}"
|
||||
export DEV_MODE_MOTD="${DEV_MODE_MOTD:-false}"
|
||||
export DEV_MODE_KEEP="${DEV_MODE_KEEP:-false}"
|
||||
|
||||
@@ -395,20 +395,12 @@ ssh_check() {
|
||||
# get_active_logfile()
|
||||
#
|
||||
# - Returns the appropriate log file based on execution context
|
||||
# - _HOST_LOGFILE: Override for host context (keeps host logging on BUILD_LOG
|
||||
# even after INSTALL_LOG is exported for the container)
|
||||
# - INSTALL_LOG: Container operations (application installation)
|
||||
# - BUILD_LOG: Host operations (container creation)
|
||||
# - INSTALL_LOG: Container operations (application installation)
|
||||
# - Fallback to BUILD_LOG if neither is set
|
||||
# ------------------------------------------------------------------------------
|
||||
get_active_logfile() {
|
||||
# Host override: _HOST_LOGFILE is set (not exported) in build.func to keep
|
||||
# host-side logging in BUILD_LOG after INSTALL_LOG is exported for the container.
|
||||
# Without this, all host msg_info/msg_ok/msg_error would write to
|
||||
# /root/.install-SESSION.log (a container path) instead of BUILD_LOG.
|
||||
if [[ -n "${_HOST_LOGFILE:-}" ]]; then
|
||||
echo "$_HOST_LOGFILE"
|
||||
elif [[ -n "${INSTALL_LOG:-}" ]]; then
|
||||
if [[ -n "${INSTALL_LOG:-}" ]]; then
|
||||
echo "$INSTALL_LOG"
|
||||
elif [[ -n "${BUILD_LOG:-}" ]]; then
|
||||
echo "$BUILD_LOG"
|
||||
|
||||
Reference in New Issue
Block a user