mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-04-05 08:54:03 -04:00
feat: add Kan, Puter, Lychee, Fleet scripts (ct/install/json)
This commit is contained in:
74
install/fleet-install.sh
Normal file
74
install/fleet-install.sh
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/fleetdm/fleet
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
setup_mysql
|
||||
|
||||
msg_info "Setting up Database"
|
||||
FLEET_DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c 13)
|
||||
$STD mysql -u root <<EOSQL
|
||||
CREATE DATABASE fleet;
|
||||
CREATE USER 'fleet'@'localhost' IDENTIFIED BY '${FLEET_DB_PASS}';
|
||||
GRANT ALL PRIVILEGES ON fleet.* TO 'fleet'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
EOSQL
|
||||
msg_ok "Set up Database"
|
||||
|
||||
fetch_and_deploy_gh_release "fleet" "fleetdm/fleet" "prebuild" "latest" "/opt/fleet" "fleet_v*_linux.tar.gz"
|
||||
|
||||
msg_info "Configuring Application"
|
||||
chmod +x /opt/fleet/fleet
|
||||
JWT_KEY=$(openssl rand -base64 32)
|
||||
cat <<EOF >/opt/fleet/.env
|
||||
FLEET_MYSQL_ADDRESS=127.0.0.1:3306
|
||||
FLEET_MYSQL_DATABASE=fleet
|
||||
FLEET_MYSQL_USERNAME=fleet
|
||||
FLEET_MYSQL_PASSWORD=${FLEET_DB_PASS}
|
||||
FLEET_SERVER_ADDRESS=0.0.0.0:8080
|
||||
FLEET_SERVER_TLS=false
|
||||
FLEET_AUTH_JWT_KEY=${JWT_KEY}
|
||||
FLEET_LOGGING_JSON=true
|
||||
EOF
|
||||
msg_ok "Configured Application"
|
||||
|
||||
msg_info "Running Database Migrations"
|
||||
set -a && source /opt/fleet/.env && set +a
|
||||
$STD /opt/fleet/fleet prepare db
|
||||
msg_ok "Ran Database Migrations"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/fleet.service
|
||||
[Unit]
|
||||
Description=Fleet
|
||||
After=network.target mysql.service
|
||||
Requires=mysql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/fleet
|
||||
EnvironmentFile=/opt/fleet/.env
|
||||
ExecStart=/opt/fleet/fleet serve
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now fleet
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
88
install/kan-install.sh
Normal file
88
install/kan-install.sh
Normal file
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/kanbn/kan
|
||||
|
||||
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 \
|
||||
build-essential \
|
||||
git
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PG_VERSION="16" setup_postgresql
|
||||
PG_DB_NAME="kan" PG_DB_USER="kan" setup_postgresql_db
|
||||
NODE_VERSION="20" setup_nodejs
|
||||
|
||||
msg_info "Installing pnpm"
|
||||
$STD npm install -g pnpm
|
||||
msg_ok "Installed pnpm"
|
||||
|
||||
fetch_and_deploy_gh_tag "kan" "kanbn/kan"
|
||||
|
||||
msg_info "Building Application"
|
||||
cd /opt/kan
|
||||
export NEXT_PUBLIC_USE_STANDALONE_OUTPUT=true
|
||||
export NEXT_PUBLIC_BASE_URL="http://${LOCAL_IP}:3000"
|
||||
$STD pnpm install
|
||||
$STD pnpm build --filter=@kan/web
|
||||
unset NEXT_PUBLIC_USE_STANDALONE_OUTPUT NEXT_PUBLIC_BASE_URL
|
||||
msg_ok "Built Application"
|
||||
|
||||
msg_info "Setting up Standalone"
|
||||
mkdir -p /opt/kan/apps/web/.next/standalone/apps/web/.next/static
|
||||
cp -r /opt/kan/apps/web/.next/static/* /opt/kan/apps/web/.next/standalone/apps/web/.next/static/
|
||||
cp -r /opt/kan/apps/web/public /opt/kan/apps/web/.next/standalone/apps/web/public
|
||||
msg_ok "Set up Standalone"
|
||||
|
||||
msg_info "Running Database Migrations"
|
||||
cd /opt/kan/packages/db
|
||||
POSTGRES_URL="postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}" $STD pnpm exec drizzle-kit migrate
|
||||
msg_ok "Ran Database Migrations"
|
||||
|
||||
msg_info "Configuring Application"
|
||||
AUTH_SECRET=$(openssl rand -base64 32)
|
||||
cat <<EOF >/opt/kan/.env
|
||||
NEXT_PUBLIC_BASE_URL=http://${LOCAL_IP}:3000
|
||||
BETTER_AUTH_SECRET=${AUTH_SECRET}
|
||||
POSTGRES_URL=postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}
|
||||
HOSTNAME=0.0.0.0
|
||||
PORT=3000
|
||||
NODE_ENV=production
|
||||
EOF
|
||||
msg_ok "Configured Application"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/kan.service
|
||||
[Unit]
|
||||
Description=Kan Board
|
||||
After=network.target postgresql.service
|
||||
Requires=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/kan/apps/web/.next/standalone
|
||||
EnvironmentFile=/opt/kan/.env
|
||||
ExecStart=/usr/bin/node apps/web/server.js
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now kan
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
74
install/lychee-install.sh
Normal file
74
install/lychee-install.sh
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/LycheeOrg/Lychee
|
||||
|
||||
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 \
|
||||
caddy \
|
||||
libimage-exiftool-perl \
|
||||
jpegoptim
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULES="bcmath,exif,gd,intl,imagick,redis,zip,pdo_pgsql,pcntl,ldap" setup_php
|
||||
|
||||
setup_ffmpeg
|
||||
setup_imagemagick
|
||||
setup_gs
|
||||
|
||||
PG_VERSION="16" setup_postgresql
|
||||
PG_DB_NAME="lychee" PG_DB_USER="lychee" setup_postgresql_db
|
||||
|
||||
fetch_and_deploy_gh_release "lychee" "LycheeOrg/Lychee" "prebuild" "latest" "/opt/lychee" "Lychee.zip"
|
||||
|
||||
msg_info "Configuring Application"
|
||||
cd /opt/lychee
|
||||
cp .env.example .env
|
||||
APP_KEY=$($STD php artisan key:generate --show)
|
||||
sed -i "s|^APP_KEY=.*|APP_KEY=${APP_KEY}|" .env
|
||||
sed -i "s|^APP_ENV=.*|APP_ENV=production|" .env
|
||||
sed -i "s|^APP_DEBUG=.*|APP_DEBUG=false|" .env
|
||||
sed -i "s|^APP_URL=.*|APP_URL=http://${LOCAL_IP}|" .env
|
||||
sed -i "s|^DB_CONNECTION=.*|DB_CONNECTION=pgsql|" .env
|
||||
sed -i "s|^DB_HOST=.*|DB_HOST=127.0.0.1|" .env
|
||||
sed -i "s|^DB_PORT=.*|DB_PORT=5432|" .env
|
||||
sed -i "s|^DB_DATABASE=.*|DB_DATABASE=${PG_DB_NAME}|" .env
|
||||
sed -i "s|^DB_USERNAME=.*|DB_USERNAME=${PG_DB_USER}|" .env
|
||||
sed -i "s|^DB_PASSWORD=.*|DB_PASSWORD=${PG_DB_PASS}|" .env
|
||||
mkdir -p storage/framework/{cache,sessions,views} storage/logs bootstrap/cache public/dist
|
||||
touch public/dist/user.css public/dist/custom.js
|
||||
chmod -R 775 storage bootstrap/cache public/dist
|
||||
msg_ok "Configured Application"
|
||||
|
||||
msg_info "Running Database Migrations"
|
||||
cd /opt/lychee
|
||||
$STD php artisan migrate --force
|
||||
msg_ok "Ran Database Migrations"
|
||||
|
||||
msg_info "Configuring Caddy"
|
||||
PHP_VER=$(php -r 'echo PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION;')
|
||||
cat <<EOF >/etc/caddy/Caddyfile
|
||||
:80 {
|
||||
root * /opt/lychee/public
|
||||
php_fastcgi unix//run/php/php${PHP_VER}-fpm.sock
|
||||
file_server
|
||||
encode gzip
|
||||
}
|
||||
EOF
|
||||
msg_ok "Configured Caddy"
|
||||
|
||||
systemctl enable -q --now php${PHP_VER}-fpm caddy
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
62
install/puter-install.sh
Normal file
62
install/puter-install.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://github.com/HeyPuter/puter
|
||||
|
||||
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 \
|
||||
build-essential \
|
||||
git
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="22" setup_nodejs
|
||||
|
||||
fetch_and_deploy_gh_release "puter" "HeyPuter/puter" "tarball"
|
||||
|
||||
msg_info "Building Application"
|
||||
cd /opt/puter
|
||||
$STD npm ci
|
||||
cd /opt/puter/src/gui
|
||||
$STD npm run build
|
||||
cd /opt/puter
|
||||
cp -r src/gui/dist dist
|
||||
msg_ok "Built Application"
|
||||
|
||||
msg_info "Creating Directories"
|
||||
mkdir -p /etc/puter /var/puter
|
||||
msg_ok "Created Directories"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/puter.service
|
||||
[Unit]
|
||||
Description=Puter
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/puter
|
||||
Environment=CONFIG_PATH=/etc/puter
|
||||
ExecStart=/usr/bin/npm start
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now puter
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in New Issue
Block a user