Update maxun-install.sh

This commit is contained in:
CanbiZ 2025-03-27 15:54:31 +01:00
parent c374326940
commit a3858a4f65

View File

@ -16,10 +16,25 @@ update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
gpg \
curl \
sudo \
mc \
redis
openssl \
redis \
libgbm1 \
libnss3 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libdrm2 \
libxkbcommon0 \
libglib2.0-0 \
libdbus-1-3 \
libx11-xcb1 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxi6 \
libxtst6 \
netcat
msg_ok "Installed Dependencies"
#configure_lxc "Semantic Search requires a dedicated GPU and at least 16GB RAM. Would you like to install it?" 100 "memory" "16000"
@ -101,6 +116,7 @@ cat <<EOF > /etc/default/minio
MINIO_ROOT_USER=${MINIO_USER}
MINIO_ROOT_PASSWORD=${MINIO_PASS}
EOF
systemctl enable -q --now minio
msg_ok "Setup MinIO"
msg_info "Installing Maxun (Patience)"
@ -110,7 +126,6 @@ wget -q "https://github.com/getmaxun/maxun/archive/refs/tags/v${RELEASE}.zip"
unzip -q v${RELEASE}.zip
mv maxun-${RELEASE} /opt/maxun
cat <<EOF >/opt/maxun/.env
# App Setup
NODE_ENV=development
JWT_SECRET=${JWT_SECRET}
DB_NAME=${DB_NAME}
@ -127,15 +142,13 @@ MINIO_SECRET_KEY=${MINIO_PASS}
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
# Backend and Frontend URLs and Ports
BACKEND_PORT=8080
FRONTEND_PORT=5173
BACKEND_URL=localhost:8080
PUBLIC_URL=localhost:5173
VITE_BACKEND_URL=localhost:8080
VITE_PUBLIC_URL=localhost:5173
BACKEND_URL=http://localhost:8080
PUBLIC_URL=http://localhost:5173
VITE_BACKEND_URL=http://localhost:8080
VITE_PUBLIC_URL=http://localhost:5173
# Telemetry Settings
MAXUN_TELEMETRY=false
EOF
@ -149,6 +162,11 @@ $STD npx playwright install-deps
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Maxun"
msg_info "Running DB Migrations"
cd /opt/maxun
node -e "require('./server/src/db/migrate')().then(() => { console.log('Migrations completed'); })"
msg_ok "DB Migrations completed"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/maxun.service
[Unit]
@ -157,14 +175,13 @@ After=network.target postgresql.service redis.service minio.service
[Service]
WorkingDirectory=/opt/maxun
ExecStart=/usr/bin/npm start
ExecStart=/usr/bin/npm run server
Restart=always
EnvironmentFile=/opt/maxun/.env
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now minio
systemctl enable -q --now maxun
msg_ok "Created Service"