mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-25 05:57:26 +00:00
cleaning
This commit is contained in:
92
install/deferred/alpine-tinyauth-install.sh
Normal file
92
install/deferred/alpine-tinyauth-install.sh
Normal file
@@ -0,0 +1,92 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Slaviša Arežina (tremor021) | Co-Author: Stavros (steveiliop56)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/steveiliop56/tinyauth
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apk add --no-cache curl openssl apache2-utils
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Installing Tinyauth"
|
||||
mkdir -p /opt/tinyauth
|
||||
|
||||
RELEASE=$(curl -s https://api.github.com/repos/steveiliop56/tinyauth/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
curl -fsSL "https://github.com/steveiliop56/tinyauth/releases/download/v${RELEASE}/tinyauth-amd64" -o /opt/tinyauth/tinyauth
|
||||
chmod +x /opt/tinyauth/tinyauth
|
||||
|
||||
PASSWORD=$(openssl rand -base64 8 | tr -dc 'a-zA-Z0-9' | head -c 8)
|
||||
USER=$(htpasswd -Bbn "tinyauth" "${PASSWORD}")
|
||||
|
||||
cat <<EOF >/opt/tinyauth/credentials.txt
|
||||
Tinyauth Credentials
|
||||
Username: tinyauth
|
||||
Password: ${PASSWORD}
|
||||
EOF
|
||||
|
||||
echo "${RELEASE}" >/opt/tinyauth_version.txt
|
||||
msg_ok "Installed Tinyauth"
|
||||
|
||||
i=1
|
||||
while [ $i -le 3 ]; do
|
||||
read -r -p "${TAB3}Enter your Tinyauth subdomain (e.g. https://tinyauth.example.com): " app_url
|
||||
echo "$app_url" | grep -qE '^https?://[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}' && break
|
||||
[ $i -eq 3 ] && {
|
||||
echo "Max attempts reached"
|
||||
exit 1
|
||||
}
|
||||
echo "Invalid URL format ($((3 - i)) attempts left)"
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
msg_info "Creating Tinyauth Service"
|
||||
SECRET=$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | head -c 32)
|
||||
|
||||
cat <<EOF >/opt/tinyauth/.env
|
||||
SECRET=${SECRET}
|
||||
USERS=${USER}
|
||||
APP_URL=${app_url}
|
||||
EOF
|
||||
|
||||
sed -i -e 's/\$/\$\$/g' /opt/tinyauth/.env
|
||||
|
||||
cat <<EOF >/etc/init.d/tinyauth
|
||||
#!/sbin/openrc-run
|
||||
description="Tinyauth Service"
|
||||
|
||||
command="/opt/tinyauth/tinyauth"
|
||||
directory="/opt/tinyauth"
|
||||
command_user="root"
|
||||
command_background="true"
|
||||
pidfile="/var/run/tinyauth.pid"
|
||||
|
||||
start_pre() {
|
||||
if [ -f "/opt/tinyauth/.env" ]; then
|
||||
export \$(grep -v '^#' /opt/tinyauth/.env | xargs)
|
||||
fi
|
||||
}
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
|
||||
chmod +x /etc/init.d/tinyauth
|
||||
$STD rc-update add tinyauth default
|
||||
msg_ok "Enabled Tinyauth Service"
|
||||
|
||||
msg_info "Starting Tinyauth"
|
||||
$STD rc-service tinyauth start
|
||||
msg_ok "Started Tinyauth"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
47
install/deferred/jumpserver-install.sh
Normal file
47
install/deferred/jumpserver-install.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Nícolas Pastorello (opastorello)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/jumpserver/jumpserver
|
||||
|
||||
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 \
|
||||
iptables
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Installing JumpServer"
|
||||
cd /opt
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/jumpserver/installer/releases/latest | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
|
||||
curl -fsSL "https://github.com/jumpserver/installer/releases/download/${RELEASE}/jumpserver-installer-${RELEASE}.tar.gz" -o jumpserver-installer-${RELEASE}.tar.gz
|
||||
mkdir -p /opt/jumpserver
|
||||
tar -xzvf jumpserver-installer-${RELEASE}.tar.gz -C /opt/jumpserver --strip-components=1
|
||||
cd /opt/jumpserver
|
||||
$STD ./jmsctl.sh install <<EOF
|
||||
n
|
||||
n
|
||||
n
|
||||
redis
|
||||
n
|
||||
n
|
||||
EOF
|
||||
$STD ./jmsctl.sh start
|
||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||
msg_ok "Installed JumpServer"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf /opt/jumpserver-installer-${RELEASE}.tar.gz
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
36
install/deferred/kasm-install.sh
Normal file
36
install/deferred/kasm-install.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: Omar Minaya
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://www.kasmweb.com/docs/latest/index.html
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
check_or_create_swap
|
||||
|
||||
msg_info "Installing Kasm Workspaces"
|
||||
RELEASE=$(curl -fsSL 'https://www.kasmweb.com/downloads' | grep -o 'https://kasm-static-content.s3.amazonaws.com/kasm_release_[^"]*\.tar\.gz' | head -n 1 | sed -E 's/.*release_(.*)\.tar\.gz/\1/')
|
||||
curl -fsSL -o "/opt/kasm_release_${RELEASE}.tar.gz" "https://kasm-static-content.s3.amazonaws.com/kasm_release_${RELEASE}.tar.gz"
|
||||
cd /opt
|
||||
tar -xf "kasm_release_${RELEASE}.tar.gz"
|
||||
chmod +x /opt/kasm_release/install.sh
|
||||
printf 'y\ny\ny\n4\n' | $STD bash /opt/kasm_release/install.sh | tee ~/kasm-install.output
|
||||
sed -n '/Kasm UI Login Credentials/,$p' ~/kasm-install.output >~/kasm.creds
|
||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Installed Kasm Workspaces"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
$STD rm -f /opt/kasm_release_${RELEASE}.tar.gz
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
187
install/deferred/nginxproxymanager-install.sh
Normal file
187
install/deferred/nginxproxymanager-install.sh
Normal file
@@ -0,0 +1,187 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
# Author: tteck (tteckster)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://nginxproxymanager.com/
|
||||
|
||||
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 update
|
||||
$STD apt-get -y install \
|
||||
sudo \
|
||||
mc \
|
||||
curl \
|
||||
gnupg \
|
||||
make \
|
||||
gcc \
|
||||
g++ \
|
||||
ca-certificates \
|
||||
apache2-utils \
|
||||
logrotate \
|
||||
build-essential \
|
||||
git
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Installing Python3"
|
||||
$STD apt-get install -y \
|
||||
python3 \
|
||||
python3-dev \
|
||||
python3-pip \
|
||||
python3-venv \
|
||||
python3-cffi \
|
||||
python3-certbot \
|
||||
python3-certbot-dns-cloudflare
|
||||
$STD pip3 install certbot-dns-multi
|
||||
$STD python3 -m venv /opt/certbot/
|
||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
||||
msg_ok "Installed Python3"
|
||||
|
||||
msg_info "Installing Openresty"
|
||||
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
|
||||
wget -qO - https://openresty.org/package/pubkey.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/openresty.gpg
|
||||
echo -e "deb http://openresty.org/package/debian $VERSION openresty" >/etc/apt/sources.list.d/openresty.list
|
||||
$STD apt-get update
|
||||
$STD apt-get -y install openresty
|
||||
msg_ok "Installed Openresty"
|
||||
|
||||
msg_info "Installing Node.js"
|
||||
$STD bash <(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh)
|
||||
source ~/.bashrc
|
||||
$STD nvm install 16.20.2
|
||||
ln -sf /root/.nvm/versions/node/v16.20.2/bin/node /usr/bin/node
|
||||
msg_ok "Installed Node.js"
|
||||
|
||||
msg_info "Installing pnpm"
|
||||
$STD npm install -g pnpm@8.15
|
||||
msg_ok "Installed pnpm"
|
||||
|
||||
msg_info "Setup Nginx Proxy Manager"
|
||||
RELEASE=$(curl -s https://api.github.com/repos/NginxProxyManager/nginx-proxy-manager/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||
wget -q https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v${RELEASE} -O - | tar -xz
|
||||
cd ./nginx-proxy-manager-${RELEASE}
|
||||
ln -sf /usr/bin/python3 /usr/bin/python
|
||||
ln -sf /usr/bin/certbot /opt/certbot/bin/certbot
|
||||
ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
|
||||
ln -sf /usr/local/openresty/nginx/ /etc/nginx
|
||||
sed -i "s|\"version\": \"0.0.0\"|\"version\": \"$RELEASE\"|" backend/package.json
|
||||
sed -i "s|\"version\": \"0.0.0\"|\"version\": \"$RELEASE\"|" frontend/package.json
|
||||
sed -i 's+^daemon+#daemon+g' docker/rootfs/etc/nginx/nginx.conf
|
||||
NGINX_CONFS=$(find "$(pwd)" -type f -name "*.conf")
|
||||
for NGINX_CONF in $NGINX_CONFS; do
|
||||
sed -i 's+include conf.d+include /etc/nginx/conf.d+g' "$NGINX_CONF"
|
||||
done
|
||||
|
||||
mkdir -p /var/www/html /etc/nginx/logs
|
||||
cp -r docker/rootfs/var/www/html/* /var/www/html/
|
||||
cp -r docker/rootfs/etc/nginx/* /etc/nginx/
|
||||
cp docker/rootfs/etc/letsencrypt.ini /etc/letsencrypt.ini
|
||||
cp docker/rootfs/etc/logrotate.d/nginx-proxy-manager /etc/logrotate.d/nginx-proxy-manager
|
||||
ln -sf /etc/nginx/nginx.conf /etc/nginx/conf/nginx.conf
|
||||
rm -f /etc/nginx/conf.d/dev.conf
|
||||
|
||||
mkdir -p /tmp/nginx/body \
|
||||
/run/nginx \
|
||||
/data/nginx \
|
||||
/data/custom_ssl \
|
||||
/data/logs \
|
||||
/data/access \
|
||||
/data/nginx/default_host \
|
||||
/data/nginx/default_www \
|
||||
/data/nginx/proxy_host \
|
||||
/data/nginx/redirection_host \
|
||||
/data/nginx/stream \
|
||||
/data/nginx/dead_host \
|
||||
/data/nginx/temp \
|
||||
/var/lib/nginx/cache/public \
|
||||
/var/lib/nginx/cache/private \
|
||||
/var/cache/nginx/proxy_temp
|
||||
|
||||
chmod -R 777 /var/cache/nginx
|
||||
chown root /tmp/nginx
|
||||
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" >/etc/nginx/conf.d/include/resolvers.conf
|
||||
|
||||
if [ ! -f /data/nginx/dummycert.pem ] || [ ! -f /data/nginx/dummykey.pem ]; then
|
||||
openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -subj "/O=Nginx Proxy Manager/OU=Dummy Certificate/CN=localhost" -keyout /data/nginx/dummykey.pem -out /data/nginx/dummycert.pem &>/dev/null
|
||||
fi
|
||||
|
||||
mkdir -p /app/global /app/frontend/images
|
||||
cp -r backend/* /app
|
||||
cp -r global/* /app/global
|
||||
msg_ok "Setup Nginx Proxy Manager"
|
||||
|
||||
msg_info "Building Frontend"
|
||||
cd ./frontend
|
||||
$STD pnpm install
|
||||
$STD pnpm upgrade
|
||||
$STD pnpm run build
|
||||
cp -r dist/* /app/frontend
|
||||
cp -r app-images/* /app/frontend/images
|
||||
msg_ok "Built Frontend"
|
||||
|
||||
msg_info "Initializing Backend"
|
||||
rm -rf /app/config/default.json
|
||||
if [ ! -f /app/config/production.json ]; then
|
||||
cat <<'EOF' >/app/config/production.json
|
||||
{
|
||||
"database": {
|
||||
"engine": "knex-native",
|
||||
"knex": {
|
||||
"client": "sqlite3",
|
||||
"connection": {
|
||||
"filename": "/data/database.sqlite"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
cd /app
|
||||
$STD pnpm install
|
||||
msg_ok "Initialized Backend"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<'EOF' >/lib/systemd/system/npm.service
|
||||
[Unit]
|
||||
Description=Nginx Proxy Manager
|
||||
After=network.target
|
||||
Wants=openresty.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=NODE_ENV=production
|
||||
ExecStartPre=-mkdir -p /tmp/nginx/body /data/letsencrypt-acme-challenge
|
||||
ExecStart=/usr/bin/node index.js --abort_on_uncaught_exception --max_old_space_size=250
|
||||
WorkingDirectory=/app
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Starting Services"
|
||||
sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf
|
||||
sed -r -i 's/^([[:space:]]*)su npm npm/\1#su npm npm/g;' /etc/logrotate.d/nginx-proxy-manager
|
||||
sed -i 's/include-system-site-packages = false/include-system-site-packages = true/g' /opt/certbot/pyvenv.cfg
|
||||
systemctl enable -q --now openresty
|
||||
systemctl enable -q --now npm
|
||||
msg_ok "Started Services"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf ../nginx-proxy-manager-*
|
||||
systemctl restart openresty
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
86
install/deferred/nimbus-install.sh
Normal file
86
install/deferred/nimbus-install.sh
Normal file
@@ -0,0 +1,86 @@
|
||||
#!/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/arunavo4/gitea-mirror
|
||||
|
||||
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 \
|
||||
build-essential \
|
||||
openssl \
|
||||
git
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Installing Bun"
|
||||
export BUN_INSTALL=/opt/bun
|
||||
curl -fsSL https://bun.sh/install | $STD bash
|
||||
ln -sf /opt/bun/bin/bun /usr/local/bin/bun
|
||||
ln -sf /opt/bun/bin/bun /usr/local/bin/bunx
|
||||
msg_ok "Installed Bun"
|
||||
|
||||
msg_info "Setting up PostgreSQL Database"
|
||||
DB_NAME=nimbus
|
||||
DB_USER=nimbus
|
||||
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
|
||||
APP_SECRET=$(openssl rand -base64 32)
|
||||
$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 "Nimbus-Credentials"
|
||||
echo "Nimbus Database User: $DB_USER"
|
||||
echo "Nimbus Database Password: $DB_PASS"
|
||||
echo "Nimbus Database Name: $DB_NAME"
|
||||
} >>~/nimbus.creds
|
||||
msg_ok "Set up PostgreSQL Database"
|
||||
|
||||
msg_info "Installing nimbus"
|
||||
cd /opt
|
||||
git clone https://github.com/logscore/Nimbus.git
|
||||
cd /opt/Nimbus
|
||||
$STD bun install
|
||||
$STD bun run build
|
||||
$STD bun run manage-db init
|
||||
msg_ok "Installed gitea-mirror"
|
||||
|
||||
msg_info "Creating Services"
|
||||
JWT_SECRET=$(openssl rand -hex 32)
|
||||
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
|
||||
Environment=NODE_ENV=production
|
||||
Environment=HOST=0.0.0.0
|
||||
Environment=PORT=4321
|
||||
Environment=DATABASE_URL=file:/opt/gitea-mirror/data/gitea-mirror.db
|
||||
Environment=JWT_SECRET=${JWT_SECRET}
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now gitea-mirror
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
45
install/deferred/ocis-install.sh
Normal file
45
install/deferred/ocis-install.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||
# Source:
|
||||
|
||||
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 \
|
||||
build-essential \
|
||||
make \
|
||||
git
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
## WIP - only protoype with git call
|
||||
|
||||
install_go
|
||||
NODE_VERSION="22" NODE_MODULE="pnpm" install_node_and_modules
|
||||
|
||||
msg_info "Setup ocis"
|
||||
cd /opt
|
||||
git clone https://github.com/owncloud/ocis
|
||||
cd /opt/ocis
|
||||
make generate
|
||||
make -C ocis build
|
||||
#./ocis/bin/ocis init
|
||||
#IDM_CREATE_DEMO_USERS=true ./ocis/bin/ocis server
|
||||
msg_ok "Setup ocis"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
107
install/deferred/openwebui-install.sh
Normal file
107
install/deferred/openwebui-install.sh
Normal file
@@ -0,0 +1,107 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2025 tteck
|
||||
# Author: tteck
|
||||
# Co-Author: havardthom
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://openwebui.com/
|
||||
|
||||
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 \
|
||||
ffmpeg
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Setup Python3"
|
||||
$STD apt-get install -y --no-install-recommends \
|
||||
python3 \
|
||||
python3-pip
|
||||
msg_ok "Setup Python3"
|
||||
|
||||
install_node_and_modules
|
||||
|
||||
msg_info "Installing Open WebUI (Patience)"
|
||||
fetch_and_deploy_gh_release "open-webui/open-webui"
|
||||
cd /opt/openwebui/backend
|
||||
$STD pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
||||
$STD pip3 install -r requirements.txt -U
|
||||
cd /opt/openwebui
|
||||
cat <<EOF >/opt/openwebui/.env
|
||||
# Ollama URL for the backend to connect
|
||||
# The path '/ollama' will be redirected to the specified backend URL
|
||||
OLLAMA_BASE_URL=http://0.0.0.0:11434
|
||||
OPENAI_API_BASE_URL=''
|
||||
OPENAI_API_KEY=''
|
||||
# AUTOMATIC1111_BASE_URL="http://localhost:7860"
|
||||
# DO NOT TRACK
|
||||
SCARF_NO_ANALYTICS=true
|
||||
DO_NOT_TRACK=true
|
||||
ANONYMIZED_TELEMETRY=false
|
||||
ENV=prod
|
||||
ENABLE_OLLAMA_API=false
|
||||
EOF
|
||||
$STD npm install
|
||||
export NODE_OPTIONS="--max-old-space-size=3584"
|
||||
sed -i "s/git rev-parse HEAD/openssl rand -hex 20/g" /opt/openwebui/svelte.config.js
|
||||
$STD npm run build
|
||||
msg_ok "Installed Open WebUI"
|
||||
|
||||
read -r -p "${TAB3}Would you like to add Ollama? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Ollama"
|
||||
curl -fsSLO https://ollama.com/download/ollama-linux-amd64.tgz
|
||||
tar -C /usr -xzf ollama-linux-amd64.tgz
|
||||
rm -rf ollama-linux-amd64.tgz
|
||||
cat <<EOF >/etc/systemd/system/ollama.service
|
||||
[Unit]
|
||||
Description=Ollama Service
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
ExecStart=/usr/bin/ollama serve
|
||||
Environment=HOME=$HOME
|
||||
Environment=OLLAMA_HOST=0.0.0.0
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now ollama
|
||||
sed -i 's/ENABLE_OLLAMA_API=false/ENABLE_OLLAMA_API=true/g' /opt/openwebui/.env
|
||||
msg_ok "Installed Ollama"
|
||||
fi
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/open-webui.service
|
||||
[Unit]
|
||||
Description=Open WebUI Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
WorkingDirectory=/opt/openwebui
|
||||
EnvironmentFile=/opt/openwebui/.env
|
||||
ExecStart=/opt/openwebui/backend/start.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now open-webui
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
69
install/deferred/polaris-install.sh
Normal file
69
install/deferred/polaris-install.sh
Normal file
@@ -0,0 +1,69 @@
|
||||
#!/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://github.com/agersant/polaris
|
||||
|
||||
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 \
|
||||
make \
|
||||
git \
|
||||
build-essential \
|
||||
binutils \
|
||||
pkg-config \
|
||||
libsqlite3-dev \
|
||||
libssl-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Installing Rust"
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
|
||||
echo 'export PATH=~/.cargo/bin:$PATH' >>~/.bashrc
|
||||
export PATH=~/.cargo/bin:$PATH
|
||||
msg_ok "Installed Rust"
|
||||
|
||||
msg_info "Downloading and Installing Polaris"
|
||||
cd /opt
|
||||
RELEASE=$(curl -s https://api.github.com/repos/agersant/polaris/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
wget -q "https://github.com/agersant/polaris/archive/refs/tags/${RELEASE}.tar.gz"
|
||||
tar -xzf ${RELEASE}.tar.gz
|
||||
mv polaris-${RELEASE} /opt/polaris
|
||||
cd /opt/polaris
|
||||
$STD cargo build --release
|
||||
msg_ok "Installed Polaris"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/polaris.service
|
||||
[Unit]
|
||||
Description=Polaris Music Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=PATH=$PATH
|
||||
WorkingDirectory=/opt/polaris
|
||||
ExecStart=/opt/polaris/target/release/polaris
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now polaris
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf /opt/${RELEASE}.tar.gz
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
Reference in New Issue
Block a user