Compare commits

...

16 Commits

Author SHA1 Message Date
CanbiZ 5ae25108ef
Add new LXC: AdventureLog (#3971) 9 months ago
tteckster 55c8d1187b
Update paperless-ngx-install.sh 9 months ago
tteckster 9a5d43e4d3
Update paperless-ngx-install.sh 9 months ago
tteckster bb2c143cc8
Update CHANGELOG.md 9 months ago
tteckster 2a844122d0
Update zoraxy.sh 9 months ago
tteckster 540fcd24f2
Update zoraxy.sh 9 months ago
tteckster c2c48b52c7
Update zoraxy.sh 9 months ago
tteckster 744e183eea
Update zoraxy.sh 9 months ago
tteckster 468a5d367d
Update zoraxy-install.sh 9 months ago
tteckster edf0753120
Update zoraxy.sh 9 months ago
tteckster 64eab60a4c
Update openwebui-install.sh 9 months ago
tteckster 5c711293b9
Update paperless-ngx-install.sh 9 months ago
tteckster 1d83562661
Update actualbudget-install.sh 9 months ago
tteckster f5978717d4
Update CHANGELOG.md 9 months ago
tteckster 7176eaa99d
Update CHANGELOG.md 9 months ago
CanbiZ 2184eab0c5
Add new LXC: Wallos (#3956) 9 months ago
  1. 17
      CHANGELOG.md
  2. 110
      ct/adventurelog.sh
  3. 99
      ct/wallos.sh
  4. 34
      ct/zoraxy.sh
  5. 14
      install/actualbudget-install.sh
  6. 175
      install/adventurelog-install.sh
  7. 1
      install/openwebui-install.sh
  8. 2
      install/paperless-ngx-install.sh
  9. 81
      install/wallos-install.sh
  10. 26
      install/zoraxy-install.sh

@ -13,6 +13,23 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
> [!NOTE]
All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
## 2024-10-25
### Changed
- **Zoraxy LXC** [(Commit)](https://github.com/tteck/Proxmox/commit/468a5d367ded4cf453a1507452e112ac3e234e2a)
- Switch built from source to a pre-compiled binary version.
- Breaking Change
## 2024-10-23
### Changed
- **Wallos LXC** [(View Source)](https://github.com/tteck/Proxmox/blob/main/install/wallos-install.sh)
- NEW Script
- **Open WebUI LXC** [(View Source)](https://github.com/tteck/Proxmox/blob/main/install/openwebui-install.sh)
- NEW Script
## 2024-10-19
### Changed

@ -0,0 +1,110 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
# Copyright (c) 2021-2024 tteck
# Author: tteck
# Co-Author: MickLesk (Canbiz)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
function header_info {
clear
cat <<"EOF"
___ __ __ __
/ | ____/ / _____ ____ / /___ __________ / / ____ ____ _
/ /| |/ __ / | / / _ \/ __ \/ __/ / / / ___/ _ \/ / / __ \/ __ `/
/ ___ / /_/ /| |/ / __/ / / / /_/ /_/ / / / __/ /___/ /_/ / /_/ /
/_/ |_\__,_/ |___/\___/_/ /_/\__/\__,_/_/ \___/_____/\____/\__, /
/____/
EOF
}
header_info
echo -e "Loading..."
APP="AdventureLog"
var_disk="7"
var_cpu="2"
var_ram="2048"
var_os="debian"
var_version="12"
variables
color
catch_errors
function default_settings() {
CT_TYPE="1"
PW=""
CT_ID=$NEXTID
HN=$NSAPP
DISK_SIZE="$var_disk"
CORE_COUNT="$var_cpu"
RAM_SIZE="$var_ram"
BRG="vmbr0"
NET="dhcp"
GATE=""
APT_CACHER=""
APT_CACHER_IP=""
DISABLEIP6="no"
MTU=""
SD=""
NS=""
MAC=""
VLAN=""
SSH="no"
VERB="no"
echo_default
}
function update_script() {
header_info
if [[ ! -d /opt/adventurelog ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
fi
RELEASE=$(curl -s https://api.github.com/repos/seanmorley15/AdventureLog/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping Services"
systemctl stop adventurelog-backend
systemctl stop adventurelog-frontend
msg_ok "Services Stopped"
msg_info "Updating ${APP} to ${RELEASE}"
cp /opt/adventurelog/backend/server/.env /opt/server.env
cp /opt/adventurelog/frontend/env /opt/frontend.env
wget -q "https://github.com/seanmorley15/AdventureLog/archive/refs/tags/v${RELEASE}.zip"
unzip -q v${RELEASE}.zip
mv AdventureLog-${RELEASE} /opt/adventurelog
mv /opt/server.env /opt/adventurelog/backend/server/.env
cd /opt/adventurelog/backend/server
pip install --upgrade pip &>/dev/null
pip install -r requirements.txt &>/dev/null
python3 manage.py collectstatic --noinput &>/dev/null
python3 manage.py migrate &>/dev/null
mv /opt/frontend.env /opt/adventurelog/frontend/.env
cd /opt/adventurelog/frontend
pnpm install &>/dev/null
pnpm run build &>/dev/null
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}"
msg_info "Starting Services"
systemctl start adventurelog-backend
systemctl start adventurelog-frontend
msg_ok "Started Services"
msg_info "Cleaning Up"
rm -rf v${RELEASE}.zip
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${APP} Setup should be reachable by going to the following URL.
${BL}http://${IP}:3000${CL} \n"

@ -0,0 +1,99 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
# Copyright (c) 2021-2024 tteck
# Author: tteck
# Co-Author: MickLesk (Canbiz)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
function header_info {
clear
cat <<"EOF"
_ __ ____
| | / /___ _/ / /___ _____
| | /| / / __ `/ / / __ \/ ___/
| |/ |/ / /_/ / / / /_/ (__ )
|__/|__/\__,_/_/_/\____/____/
EOF
}
header_info
echo -e "Loading..."
APP="Wallos"
var_disk="5"
var_cpu="1"
var_ram="1024"
var_os="debian"
var_version="12"
variables
color
catch_errors
function default_settings() {
CT_TYPE="1"
PW=""
CT_ID=$NEXTID
HN=$NSAPP
DISK_SIZE="$var_disk"
CORE_COUNT="$var_cpu"
RAM_SIZE="$var_ram"
BRG="vmbr0"
NET="dhcp"
GATE=""
APT_CACHER=""
APT_CACHER_IP=""
DISABLEIP6="no"
MTU=""
SD=""
NS=""
MAC=""
VLAN=""
SSH="no"
VERB="no"
echo_default
}
function update_script() {
header_info
if [[ ! -d /opt/wallos ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
fi
RELEASE=$(curl -s https://api.github.com/repos/ellite/Wallos/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Updating ${APP} to ${RELEASE}"
cd /opt
wget -q "https://github.com/ellite/Wallos/archive/refs/tags/v${RELEASE}.zip"
mv /opt/wallos/db/wallos.db /opt/wallos.db
unzip -q v${RELEASE}.zip
mv Wallos-${RELEASE} /opt/wallos
rm -rf /opt/wallos/db/wallos.empty.db
mv /opt/wallos.db /opt/wallos/db/wallos.db
chown -R www-data:www-data /opt/wallos
chmod -R 755 /opt/wallos
curl http://localhost/endpoints/db/migrate.php &>/dev/null
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}"
msg_info "Reload Apache2"
systemctl reload apache2
msg_ok "Apache2 Reloaded"
msg_info "Cleaning Up"
rm -R /opt/v${RELEASE}.zip
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP} ${CL} \n"

@ -20,7 +20,7 @@ header_info
echo -e "Loading..."
APP="Zoraxy"
var_disk="6"
var_cpu="4"
var_cpu="2"
var_ram="2048"
var_os="debian"
var_version="12"
@ -54,30 +54,28 @@ function default_settings() {
function update_script() {
header_info
if [[ ! -d /opt/zoraxy/src ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "SET RESOURCES" "Please set the resources in your ${APP} LXC to ${var_cpu}vCPU and ${var_ram}RAM for the build process before continuing" 10 75
msg_info "Updating $APP"
systemctl stop zoraxy
cd /opt/zoraxy/src
systemctl stop zoraxy
if git pull | grep -q 'Already up to date.'; then
msg_ok "Already up to date. No update required."
else
go mod tidy
go build
if [[ ! -d /opt/zoraxy/ ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
RELEASE=$(curl -s https://api.github.com/repos/tobychui/zoraxy/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Updating $APP to ${RELEASE}"
systemctl stop zoraxy
wget -q "https://github.com/tobychui/zoraxy/releases/download/${RELEASE}/zoraxy_linux_amd64"
rm /opt/zoraxy/zoraxy
mv zoraxy_linux_amd64 /opt/zoraxy/zoraxy
chmod +x /opt/zoraxy/zoraxy
systemctl start zoraxy
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated $APP"
fi
systemctl start zoraxy
exit
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
fi
exit
}
start
build_container
description
msg_info "Setting Container to Normal Resources"
pct set $CTID -cores 2
msg_ok "Set Container to Normal Resources"
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8000${CL} \n"

@ -35,6 +35,13 @@ msg_ok "Installed Node.js"
msg_info "Installing Actual Budget"
$STD git clone https://github.com/actualbudget/actual-server.git /opt/actualbudget
mkdir -p /opt/actualbudget/server-files
chown -R root:root /opt/actualbudget/server-files
chmod 755 /opt/actualbudget/server-files
cat <<EOF > /opt/actualbudget/.env
ACTUAL_UPLOAD_DIR=/opt/actualbudget/server-files
PORT=5006
EOF
cd /opt/actualbudget
$STD yarn install
msg_ok "Installed Actual Budget"
@ -46,9 +53,14 @@ Description=Actual Budget Service
After=network.target
[Service]
Type=exec
Type=simple
User=root
Group=root
WorkingDirectory=/opt/actualbudget
EnvironmentFile=/opt/actualbudget/.env
ExecStart=/usr/bin/yarn start
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target

@ -0,0 +1,175 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2024 tteck
# Author: tteck
# Co-Author: MickLesk (Canbiz)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
# Source: https://github.com/seanmorley15/AdventureLog
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 \
gpg \
curl \
sudo \
mc \
gdal-bin \
libgdal-dev \
git \
python3-venv \
python3-pip
msg_ok "Installed Dependencies"
msg_info "Setting up Node.js Repository"
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
msg_ok "Set up Node.js Repository"
msg_info "Setting up PostgreSQL Repository"
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
echo "deb https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" >/etc/apt/sources.list.d/pgdg.list
msg_ok "Set up PostgreSQL Repository"
msg_info "Installing Node.js"
$STD apt-get update
$STD apt-get install -y nodejs
$STD npm install -g pnpm
msg_ok "Installed Node.js"
msg_info "Install/Set up PostgreSQL Database"
$STD apt-get install -y postgresql-16 postgresql-16-postgis
DB_NAME="adventurelog_db"
DB_USER="adventurelog_user"
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
SECRET_KEY="$(openssl rand -base64 32 | tr -dc 'a-zA-Z0-9' | cut -c1-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 "CREATE EXTENSION IF NOT EXISTS postgis;" $DB_NAME
$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 "AdventureLog-Credentials"
echo "AdventureLog Database User: $DB_USER"
echo "AdventureLog Database Password: $DB_PASS"
echo "AdventureLog Database Name: $DB_NAME"
echo "AdventureLog Secret: $SECRET_KEY"
} >> ~/adventurelog.creds
msg_ok "Set up PostgreSQL"
msg_info "Installing AdventureLog (Patience)"
DJANGO_ADMIN_USER="djangoadmin"
DJANGO_ADMIN_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)"
LOCAL_IP="$(hostname -I | awk '{print $1}')"
cd /opt
RELEASE=$(curl -s https://api.github.com/repos/seanmorley15/AdventureLog/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
wget -q "https://github.com/seanmorley15/AdventureLog/archive/refs/tags/v${RELEASE}.zip"
unzip -q v${RELEASE}.zip
mv AdventureLog-${RELEASE} /opt/adventurelog
cat <<EOF > /opt/adventurelog/backend/server/.env
PGHOST='localhost'
PGDATABASE='${DB_NAME}'
PGUSER='${DB_USER}'
PGPASSWORD='${DB_PASS}'
SECRET_KEY='${SECRET_KEY}'
PUBLIC_URL='http://$LOCAL_IP:8000'
DEBUG=True
FRONTEND_URL='http://$LOCAL_IP:3000'
CSRF_TRUSTED_ORIGINS='http://127.0.0.1:3000,http://localhost:3000,http://$LOCAL_IP:3000'
DJANGO_ADMIN_USERNAME='${DJANGO_ADMIN_USER}'
DJANGO_ADMIN_PASSWORD='${DJANGO_ADMIN_PASS}'
DISABLE_REGISTRATION=False
# EMAIL_BACKEND='email'
# EMAIL_HOST='smtp.gmail.com'
# EMAIL_USE_TLS=False
# EMAIL_PORT=587
# EMAIL_USE_SSL=True
# EMAIL_HOST_USER='user'
# EMAIL_HOST_PASSWORD='password'
# DEFAULT_FROM_EMAIL='user@example.com'
EOF
cd /opt/adventurelog/backend/server
mkdir -p /opt/adventurelog/backend/server/media
$STD pip install --upgrade pip
$STD pip install -r requirements.txt
$STD python3 manage.py collectstatic --noinput
$STD python3 manage.py migrate
$STD python3 manage.py download-countries
cat <<EOF > /opt/adventurelog/frontend/.env
PUBLIC_SERVER_URL=http://$LOCAL_IP:8000
BODY_SIZE_LIMIT=Infinity
ORIGIN='http://$LOCAL_IP:3000'
EOF
cd /opt/adventurelog/frontend
$STD pnpm i
$STD pnpm build
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed AdventureLog"
msg_info "Setting up Django Admin"
$STD python3 /opt/adventurelog/backend/server/manage.py shell << EOF
from django.contrib.auth import get_user_model
UserModel = get_user_model()
user = UserModel.objects.create_user('$DJANGO_ADMIN_USER', password='$DJANGO_ADMIN_PASS')
user.is_superuser = True
user.is_staff = True
user.save()
EOF
{
echo ""
echo "Django-Credentials"
echo "Django Admin User: $DJANGO_ADMIN_USER"
echo "Django Admin Password: $DJANGO_ADMIN_PASS"
} >> ~/adventurelog.creds
msg_ok "Setup Django Admin"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/adventurelog-backend.service
[Unit]
Description=AdventureLog Backend Service
After=network.target postgresql.service
[Service]
WorkingDirectory=/opt/adventurelog/backend/server
ExecStart=python3 manage.py runserver 0.0.0.0:8000
Restart=always
EnvironmentFile=/opt/adventurelog/backend/server/.env
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/adventurelog-frontend.service
[Unit]
Description=AdventureLog SvelteKit Frontend Service
After=network.target
[Service]
WorkingDirectory=/opt/adventurelog/frontend
ExecStart=/usr/bin/node build 127.0.0.1:3000
Restart=always
EnvironmentFile=/opt/adventurelog/frontend/.env
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now adventurelog-backend.service
systemctl enable -q --now adventurelog-frontend.service
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
rm -rf /opt/v${RELEASE}.zip
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

@ -51,6 +51,7 @@ ENV=prod
ENABLE_OLLAMA_API=false
EOF
$STD npm install
export NODE_OPTIONS="--max-old-space-size=4096"
$STD npm run build
msg_ok "Installed Open WebUI"

@ -40,7 +40,7 @@ $STD apt-get install -y --no-install-recommends \
mc
msg_ok "Installed Dependencies"
msg_info "Installing Python3 Dependencies"
msg_info "Installing Python3 Dependencies (Patience)"
$STD apt-get install -y --no-install-recommends \
python3 \
python3-pip \

@ -0,0 +1,81 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2024 tteck
# Author: tteck
# Co-Author: MickLesk (Canbiz)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
# Source: https://github.com/ellite/wallos
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 \
curl \
sudo \
mc \
apache2 \
libapache2-mod-php \
php8.2-{mbstring,gd,curl,intl,imagick,bz2,sqlite3,zip,xml}
msg_ok "Installed Dependencies"
msg_info "Installing Wallos (Patience)"
cd /opt
RELEASE=$(curl -s https://api.github.com/repos/ellite/Wallos/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
wget -q "https://github.com/ellite/Wallos/archive/refs/tags/v${RELEASE}.zip"
unzip -q v${RELEASE}.zip
mv Wallos-${RELEASE} /opt/wallos
cd /opt/wallos
mv /opt/wallos/db/wallos.empty.db /opt/wallos/db/wallos.db
chown -R www-data:www-data /opt/wallos
chmod -R 755 /opt/wallos
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
cat <<EOF >/etc/apache2/sites-available/wallos.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /opt/wallos
<Directory /opt/wallos>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog \${APACHE_LOG_DIR}/wallos_error.log
CustomLog \${APACHE_LOG_DIR}/wallos_access.log combined
</VirtualHost>
EOF
$STD a2ensite wallos.conf
$STD a2dissite 000-default.conf
$STD systemctl reload apache2
$STD curl http://localhost/endpoints/db/migrate.php
msg_ok "Installed Wallos"
msg_info "Setting up Crontabs"
cat <<EOF > /opt/wallos.cron
0 1 * * * php /opt/wallos/endpoints/cronjobs/updatenextpayment.php >> /var/log/cron/updatenextpayment.log 2>&1
0 2 * * * php /opt/wallos/endpoints/cronjobs/updateexchange.php >> /var/log/cron/updateexchange.log 2>&1
0 8 * * * php /opt/wallos/endpoints/cronjobs/sendcancellationnotifications.php >> /var/log/cron/sendcancellationnotifications.log 2>&1
0 9 * * * php /opt/wallos/endpoints/cronjobs/sendnotifications.php >> /var/log/cron/sendnotifications.log 2>&1
*/2 * * * * php /opt/wallos/endpoints/cronjobs/sendverificationemails.php >> /var/log/cron/sendverificationemail.log 2>&1
*/2 * * * * php /opt/wallos/endpoints/cronjobs/sendresetpasswordemails.php >> /var/log/cron/sendresetpasswordemails.log 2>&1
0 */6 * * * php /opt/wallos/endpoints/cronjobs/checkforupdates.php >> /var/log/cron/checkforupdates.log 2>&1
EOF
crontab /opt/wallos.cron
msg_ok "Crontabs setup"
motd_ssh
customize
msg_info "Cleaning up"
rm -rf /opt/v${RELEASE}.zip
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

@ -17,23 +17,16 @@ msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
$STD apt-get install -y git
msg_ok "Installed Dependencies"
msg_info "Installing Golang"
set +o pipefail
RELEASE=$(curl -s https://go.dev/dl/ | grep -o "go.*\linux-amd64.tar.gz" | head -n 1)
wget -q https://golang.org/dl/$RELEASE
$STD tar -xzf $RELEASE -C /usr/local
$STD ln -s /usr/local/go/bin/go /usr/local/bin/go
set -o pipefail
msg_ok "Installed Golang"
msg_info "Installing Zoraxy (Patience)"
$STD git clone https://github.com/tobychui/zoraxy /opt/zoraxy
cd /opt/zoraxy/src
$STD go mod tidy
$STD go build
RELEASE=$(curl -s https://api.github.com/repos/tobychui/zoraxy/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
wget -q "https://github.com/tobychui/zoraxy/releases/download/${RELEASE}/zoraxy_linux_amd64"
mkdir -p /opt/zoraxy
mv zoraxy_linux_amd64 /opt/zoraxy/zoraxy
chmod +x /opt/zoraxy/zoraxy
ln -s /opt/zoraxy/zoraxy /usr/local/bin/zoraxy
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Zoraxy"
msg_info "Creating Service"
@ -43,8 +36,8 @@ Description=General purpose request proxy and forwarding tool
After=syslog.target network-online.target
[Service]
ExecStart=/opt/zoraxy/src/./zoraxy
WorkingDirectory=/opt/zoraxy/src/
ExecStart=/opt/zoraxy/./zoraxy
WorkingDirectory=/opt/zoraxy/
Restart=always
[Install]
@ -57,7 +50,6 @@ motd_ssh
customize
msg_info "Cleaning up"
rm -rf $RELEASE
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

Loading…
Cancel
Save