mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-25 05:57:26 +00:00
cleanup
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: CrazyWolf13
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/RayLabsHQ/gitea-mirror
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
NODE_VERSION="22" NODE_MODULES="bun" setup_nodejs
|
||||
fetch_and_deploy_gh_release "gitea-mirror" "RayLabsHQ/gitea-mirror"
|
||||
|
||||
msg_info "Installing gitea-mirror"
|
||||
cd /opt/gitea-mirror
|
||||
$STD bun run setup
|
||||
$STD bun run build
|
||||
msg_ok "Installed gitea-mirror"
|
||||
|
||||
msg_info "Creating Services"
|
||||
APP_SECRET=$(openssl rand -base64 32)
|
||||
APP_VERSION=$(grep -o '"version": *"[^"]*"' package.json | cut -d'"' -f4)
|
||||
HOST_IP=$(hostname -I | awk '{print $1}')
|
||||
cat <<EOF >/opt/gitea-mirror.env
|
||||
# See here for config options: https://github.com/RayLabsHQ/gitea-mirror/blob/main/docs/ENVIRONMENT_VARIABLES.md
|
||||
NODE_ENV=production
|
||||
HOST=0.0.0.0
|
||||
PORT=4321
|
||||
DATABASE_URL=sqlite://data/gitea-mirror.db
|
||||
BETTER_AUTH_URL=http://${HOST_IP}:4321
|
||||
BETTER_AUTH_SECRET=${APP_SECRET}
|
||||
npm_package_version=${APP_VERSION}
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/systemd/system/gitea-mirror.service
|
||||
[Unit]
|
||||
Description=Gitea Mirror
|
||||
After=network.target
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/gitea-mirror
|
||||
ExecStart=/usr/local/bin/bun dist/server/entry.mjs
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
EnvironmentFile=/opt/gitea-mirror.env
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now gitea-mirror
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -1,94 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://joplinapp.org/
|
||||
|
||||
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 \
|
||||
git \
|
||||
rsync
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PG_VERSION="17" setup_postgresql
|
||||
NODE_VERSION=24 NODE_MODULE="yarn,npm,pm2" setup_nodejs
|
||||
mkdir -p /opt/pm2
|
||||
export PM2_HOME=/opt/pm2
|
||||
$STD pm2 install pm2-logrotate
|
||||
$STD pm2 set pm2-logrotate:max_size 100MB
|
||||
$STD pm2 set pm2-logrotate:retain 5
|
||||
$STD pm2 set pm2-logrotate:compress tr
|
||||
|
||||
msg_info "Setting up PostgreSQL Database"
|
||||
DB_NAME=joplin
|
||||
DB_USER=joplin
|
||||
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
|
||||
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';"
|
||||
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
|
||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
|
||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
|
||||
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
|
||||
{
|
||||
echo "Joplin-Credentials"
|
||||
echo "Joplin Database User: $DB_USER"
|
||||
echo "Joplin Database Password: $DB_PASS"
|
||||
echo "Joplin Database Name: $DB_NAME"
|
||||
} >>~/joplin.creds
|
||||
msg_ok "Set up PostgreSQL Database"
|
||||
|
||||
fetch_and_deploy_gh_release "joplin-server" "laurent22/joplin" "tarball" "latest"
|
||||
|
||||
msg_info "Setting up Joplin Server (Patience)"
|
||||
LOCAL_IP=$(hostname -I | awk '{print $1}')
|
||||
cd /opt/joplin-server
|
||||
sed -i "/onenote-converter/d" packages/lib/package.json
|
||||
$STD yarn config set --home enableTelemetry 0
|
||||
export BUILD_SEQUENCIAL=1
|
||||
$STD yarn install --inline-builds
|
||||
|
||||
cat <<EOF >/opt/joplin-server/.env
|
||||
PM2_HOME=/opt/pm2
|
||||
NODE_ENV=production
|
||||
APP_BASE_URL=http://$LOCAL_IP:22300
|
||||
APP_PORT=22300
|
||||
DB_CLIENT=pg
|
||||
POSTGRES_PASSWORD=$DB_PASS
|
||||
POSTGRES_DATABASE=$DB_NAME
|
||||
POSTGRES_USER=$DB_USER
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_HOST=localhost
|
||||
EOF
|
||||
msg_ok "Setup Joplin Server"
|
||||
|
||||
msg_info "Setting up Service"
|
||||
cat <<EOF >/etc/systemd/system/joplin-server.service
|
||||
[Unit]
|
||||
Description=Joplin Server Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/joplin-server/packages/server
|
||||
EnvironmentFile=/opt/joplin-server/.env
|
||||
ExecStart=/usr/bin/yarn start-prod
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now joplin-server
|
||||
msg_ok "Service Setup"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/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: https://mealie.io
|
||||
|
||||
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 \
|
||||
libpq-dev \
|
||||
libwebp-dev \
|
||||
libsasl2-dev \
|
||||
libldap2-dev \
|
||||
libldap-common \
|
||||
libssl-dev \
|
||||
libldap2 \
|
||||
gosu \
|
||||
iproute2
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
POSTGRES_VERSION="16" setup_postgresql
|
||||
NODE_MODULE="yarn" NODE_VERSION="24" setup_nodejs
|
||||
fetch_and_deploy_gh_release "mealie" "mealie-recipes/mealie" "tarball" "latest" "/opt/mealie"
|
||||
PG_DB_NAME="mealie_db" PG_DB_USER="mealie_user" PG_DB_GRANT_SUPERUSER="true" setup_postgresql_db
|
||||
|
||||
msg_info "Installing Python Dependencies with uv"
|
||||
cd /opt/mealie
|
||||
$STD uv sync --frozen --extra pgsql
|
||||
msg_ok "Installed Python Dependencies"
|
||||
|
||||
msg_info "Building Frontend"
|
||||
MEALIE_VERSION=$(<$HOME/.mealie)
|
||||
CONTAINER_IP=$(hostname -I | awk '{print $1}')
|
||||
export NUXT_TELEMETRY_DISABLED=1
|
||||
cd /opt/mealie/frontend
|
||||
$STD sed -i "s|https://github.com/mealie-recipes/mealie/commit/|https://github.com/mealie-recipes/mealie/releases/tag/|g" /opt/mealie/frontend/pages/admin/site-settings.vue
|
||||
$STD sed -i "s|value: data.buildId,|value: \"v${MEALIE_VERSION}\",|g" /opt/mealie/frontend/pages/admin/site-settings.vue
|
||||
$STD sed -i "s|value: data.production ? i18n.t(\"about.production\") : i18n.t(\"about.development\"),|value: \"bare-metal\",|g" /opt/mealie/frontend/pages/admin/site-settings.vue
|
||||
$STD yarn install --prefer-offline --frozen-lockfile --non-interactive --production=false --network-timeout 1000000
|
||||
$STD yarn generate
|
||||
msg_ok "Built Frontend"
|
||||
|
||||
msg_info "Copying Built Frontend"
|
||||
mkdir -p /opt/mealie/mealie/frontend
|
||||
cp -r /opt/mealie/frontend/dist/* /opt/mealie/mealie/frontend/
|
||||
msg_ok "Copied Frontend"
|
||||
|
||||
msg_info "Downloading NLTK Data"
|
||||
mkdir -p /nltk_data/
|
||||
cd /opt/mealie
|
||||
$STD uv run python -m nltk.downloader -d /nltk_data averaged_perceptron_tagger_eng
|
||||
msg_ok "Downloaded NLTK Data"
|
||||
|
||||
msg_info "Writing Environment File"
|
||||
SECRET=$(openssl rand -hex 32)
|
||||
mkdir -p /run/secrets
|
||||
cat <<EOF >/opt/mealie/mealie.env
|
||||
MEALIE_HOME=/opt/mealie
|
||||
NLTK_DATA=/nltk_data
|
||||
SECRET=${SECRET}
|
||||
|
||||
DB_ENGINE=postgres
|
||||
POSTGRES_SERVER=localhost
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_USER=${PG_DB_USER}
|
||||
POSTGRES_PASSWORD=${PG_DB_PASS}
|
||||
POSTGRES_DB=${PG_DB_NAME}
|
||||
|
||||
PRODUCTION=true
|
||||
HOST=0.0.0.0
|
||||
PORT=9000
|
||||
BASE_URL=http://${CONTAINER_IP}:9000
|
||||
EOF
|
||||
msg_ok "Wrote Environment File"
|
||||
|
||||
msg_info "Creating Start Script"
|
||||
cat <<'EOF' >/opt/mealie/start.sh
|
||||
#!/bin/bash
|
||||
set -a
|
||||
source /opt/mealie/mealie.env
|
||||
set +a
|
||||
exec uv run mealie
|
||||
EOF
|
||||
chmod +x /opt/mealie/start.sh
|
||||
msg_ok "Created Start Script"
|
||||
|
||||
msg_info "Creating Systemd Service"
|
||||
cat <<'EOF' >/etc/systemd/system/mealie.service
|
||||
[Unit]
|
||||
Description=Mealie Recipe Manager
|
||||
After=network.target postgresql.service
|
||||
Wants=postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/mealie
|
||||
ExecStart=/opt/mealie/start.sh
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now mealie
|
||||
msg_ok "Created and Started Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Slaviša Arežina (tremor021)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source: https://www.metabase.com/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
JAVA_VERSION="21" setup_java
|
||||
PG_VERSION="17" setup_postgresql
|
||||
PG_DB_NAME="metabase_db" PG_DB_USER="metabase" setup_postgresql_db
|
||||
|
||||
msg_info "Setting up Metabase"
|
||||
mkdir -p /opt/metabase
|
||||
RELEASE=$(get_latest_github_release "metabase/metabase")
|
||||
curl -fsSL "https://downloads.metabase.com/v${RELEASE}.x/metabase.jar" -o /opt/metabase/metabase.jar
|
||||
cd /opt/metabase
|
||||
|
||||
cat <<EOF >/opt/metabase/.env
|
||||
MB_DB_TYPE=postgres
|
||||
MB_DB_DBNAME=$PG_DB_NAME
|
||||
MB_DB_PORT=5432
|
||||
MB_DB_USER=$PG_DB_USER
|
||||
MB_DB_PASS=$PG_DB_PASS
|
||||
MB_DB_HOST=localhost
|
||||
EOF
|
||||
echo $RELEASE >~/.metabase
|
||||
msg_ok "Setup Metabase"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/metabase.service
|
||||
[Unit]
|
||||
Description=Metabase Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=/opt/metabase/.env
|
||||
WorkingDirectory=/opt/metabase
|
||||
ExecStart=/usr/bin/java --add-opens java.base/java.nio=ALL-UNNAMED -jar metabase.jar
|
||||
Restart=always
|
||||
SuccessExitStatus=143
|
||||
TimeoutStopSec=120
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now metabase
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: pshankinclarke (lazarillo)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://valkey.io/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Valkey"
|
||||
$STD apt update
|
||||
$STD apt install -y valkey
|
||||
sed -i 's/^bind .*/bind 0.0.0.0/' /etc/valkey/valkey.conf
|
||||
systemctl enable -q --now valkey-server
|
||||
systemctl restart valkey-server
|
||||
msg_ok "Installed Valkey"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -1,87 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: rrole
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://wanderer.to
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
setup_go
|
||||
setup_nodejs
|
||||
fetch_and_deploy_gh_release "meilisearch" "meilisearch/meilisearch" "binary" "latest" "/opt/wanderer/source/search"
|
||||
mkdir -p /opt/wanderer/{source,data/pb_data,data/meili_data}
|
||||
fetch_and_deploy_gh_release "wanderer" "Flomp/wanderer" "tarball" "latest" "/opt/wanderer/source"
|
||||
|
||||
msg_info "Installing wanderer (patience)"
|
||||
cd /opt/wanderer/source/db
|
||||
$STD go mod tidy
|
||||
$STD go build
|
||||
cd /opt/wanderer/source/web
|
||||
$STD npm ci -s vitest
|
||||
$STD npm ci --omit=dev
|
||||
$STD npm run build
|
||||
msg_ok "Installed wanderer"
|
||||
|
||||
msg_info "Creating Service"
|
||||
MEILI_KEY=$(openssl rand -hex 32)
|
||||
POCKETBASE_KEY=$(openssl rand -hex 16)
|
||||
LOCAL_IP="$(hostname -I | awk '{print $1}')"
|
||||
|
||||
cat <<EOF >/opt/wanderer/.env
|
||||
ORIGIN=http://${LOCAL_IP}:3000
|
||||
MEILI_HTTP_ADDR=${LOCAL_IP}:7700
|
||||
MEILI_URL=http://${LOCAL_IP}:7700
|
||||
MEILI_MASTER_KEY=${MEILI_KEY}
|
||||
PB_URL=${LOCAL_IP}:8090
|
||||
PUBLIC_POCKETBASE_URL=http://${LOCAL_IP}:8090
|
||||
PUBLIC_VALHALLA_URL=https://valhalla1.openstreetmap.de
|
||||
POCKETBASE_ENCRYPTION_KEY=${POCKETBASE_KEY}
|
||||
PB_DB_LOCATION=/opt/wanderer/data/pb_data
|
||||
MEILI_DB_PATH=/opt/wanderer/data/meili_data
|
||||
EOF
|
||||
|
||||
cat <<EOF >/opt/wanderer/start.sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
trap "kill 0" EXIT
|
||||
|
||||
cd /opt/wanderer/source/search && meilisearch --master-key \$MEILI_MASTER_KEY &
|
||||
sleep 1
|
||||
cd /opt/wanderer/source/db && ./pocketbase serve --http=\$PB_URL --dir=\$PB_DB_LOCATION &
|
||||
cd /opt/wanderer/source/web && node build &
|
||||
|
||||
wait -n
|
||||
EOF
|
||||
chmod +x /opt/wanderer/start.sh
|
||||
|
||||
cat <<EOF >/etc/systemd/system/wanderer-web.service
|
||||
[Unit]
|
||||
Description=wanderer
|
||||
After=network.target
|
||||
StartLimitIntervalSec=10
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
EnvironmentFile=/opt/wanderer/.env
|
||||
ExecStart=/usr/bin/bash /opt/wanderer/start.sh
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
sleep 1
|
||||
systemctl enable -q --now wanderer-web
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -1,141 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: CrazyWolf13
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/lissy93/web-check
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
$STD apt -y install --no-install-recommends \
|
||||
git \
|
||||
traceroute \
|
||||
make \
|
||||
g++ \
|
||||
traceroute \
|
||||
xvfb \
|
||||
dbus \
|
||||
xorg \
|
||||
xvfb \
|
||||
gtk2-engines-pixbuf \
|
||||
dbus-x11 \
|
||||
xfonts-base \
|
||||
xfonts-100dpi \
|
||||
xfonts-75dpi \
|
||||
xfonts-scalable \
|
||||
imagemagick \
|
||||
x11-apps
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
|
||||
|
||||
msg_info "Setup Python3"
|
||||
$STD apt install -y python3
|
||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
||||
msg_ok "Setup Python3"
|
||||
|
||||
msg_info "Installing Chromium"
|
||||
curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/google-chrome-keyring.gpg
|
||||
cat <<EOF | sudo tee /etc/apt/sources.list.d/google-chrome.sources >/dev/null
|
||||
Types: deb
|
||||
URIs: http://dl.google.com/linux/chrome/deb/
|
||||
Suites: stable
|
||||
Components: main
|
||||
Architectures: amd64
|
||||
Signed-By: /usr/share/keyrings/google-chrome-keyring.gpg
|
||||
EOF
|
||||
$STD apt update
|
||||
$STD apt -y install \
|
||||
chromium \
|
||||
libxss1 \
|
||||
lsb-release
|
||||
msg_ok "Installed Chromium"
|
||||
|
||||
msg_info "Setting up Chromium"
|
||||
/usr/bin/chromium --no-sandbox --version >/etc/chromium-version
|
||||
chmod 755 /usr/bin/chromium
|
||||
msg_ok "Setup Chromium"
|
||||
|
||||
fetch_and_deploy_gh_release "web-check" "MickLesk/web-check"
|
||||
|
||||
msg_info "Installing Web-Check (Patience)"
|
||||
cd /opt/web-check
|
||||
cat <<'EOF' >/opt/web-check/.env
|
||||
CHROME_PATH=/usr/bin/chromium
|
||||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
||||
HEADLESS=true
|
||||
GOOGLE_CLOUD_API_KEY=''
|
||||
REACT_APP_SHODAN_API_KEY=''
|
||||
REACT_APP_WHO_API_KEY=''
|
||||
SECURITY_TRAILS_API_KEY=''
|
||||
CLOUDMERSIVE_API_KEY=''
|
||||
TRANCO_USERNAME=''
|
||||
TRANCO_API_KEY=''
|
||||
URL_SCAN_API_KEY=''
|
||||
BUILT_WITH_API_KEY=''
|
||||
TORRENT_IP_API_KEY=''
|
||||
PORT='3000'
|
||||
DISABLE_GUI='false'
|
||||
API_TIMEOUT_LIMIT='10000'
|
||||
API_CORS_ORIGIN='*'
|
||||
API_ENABLE_RATE_LIMIT='false'
|
||||
REACT_APP_API_ENDPOINT='/api'
|
||||
ENABLE_ANALYTICS='false'
|
||||
EOF
|
||||
$STD yarn install --frozen-lockfile --network-timeout 100000
|
||||
msg_ok "Installed Web-Check"
|
||||
|
||||
msg_info "Building Web-Check"
|
||||
$STD yarn build --production
|
||||
rm -rf /var/lib/apt/lists/* /app/node_modules/.cache
|
||||
msg_ok "Built Web-Check"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<'EOF' >/opt/run_web-check.sh
|
||||
#!/bin/bash
|
||||
SCREEN_RESOLUTION="1280x1024x24"
|
||||
if ! systemctl is-active --quiet dbus; then
|
||||
echo "Warning: dbus service is not running. Some features may not work properly."
|
||||
fi
|
||||
[[ -z "${DISPLAY}" ]] && export DISPLAY=":99"
|
||||
Xvfb "${DISPLAY}" -screen 0 "${SCREEN_RESOLUTION}" &
|
||||
XVFB_PID=$!
|
||||
sleep 2
|
||||
cd /opt/web-check
|
||||
exec yarn start
|
||||
EOF
|
||||
chmod +x /opt/run_web-check.sh
|
||||
cat <<'EOF' >/etc/systemd/system/web-check.service
|
||||
[Unit]
|
||||
Description=Web Check Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
Group=root
|
||||
WorkingDirectory=/opt/web-check
|
||||
EnvironmentFile=/opt/web-check/.env
|
||||
ExecStartPre=/bin/bash -c "service dbus start || true"
|
||||
ExecStartPre=/bin/bash -c "if ! pgrep -f 'Xvfb.*:99' > /dev/null; then Xvfb :99 -screen 0 1280x1024x24 & fi"
|
||||
ExecStart=/opt/run_web-check.sh
|
||||
Restart=on-failure
|
||||
Environment=DISPLAY=:99
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now web-check
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in New Issue
Block a user