fixes
Some checks failed
Update GitHub Versions (New) / update-github-versions (push) Has been cancelled
Crawl Versions from newreleases.io / crawl-versions (push) Has been cancelled
Crawl Versions from github / crawl-versions (push) Has been cancelled

This commit is contained in:
CanbiZ (MickLesk) 2026-02-02 12:59:15 +01:00
parent a1e365e111
commit bcfecef269

View File

@ -14,9 +14,10 @@ network_check
update_os update_os
msg_info "Installing Dependencies" msg_info "Installing Dependencies"
$STD apt-get install -y \ $STD apt install -y \
build-essential \ build-essential \
openssl openssl \
nginx
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
MONGO_VERSION="8.0" setup_mongodb MONGO_VERSION="8.0" setup_mongodb
@ -26,16 +27,18 @@ fetch_and_deploy_gh_release "checkmate" "bluewave-labs/Checkmate"
msg_info "Configuring Checkmate" msg_info "Configuring Checkmate"
JWT_SECRET="$(openssl rand -hex 32)" JWT_SECRET="$(openssl rand -hex 32)"
cat <<EOF >/opt/checkmate/server/.env cat <<EOF >/opt/checkmate/server/.env
CLIENT_HOST="http://${LOCAL_IP}:5173" CLIENT_HOST="http://${LOCAL_IP}"
JWT_SECRET="${JWT_SECRET}" JWT_SECRET="${JWT_SECRET}"
DB_CONNECTION_STRING="mongodb://localhost:27017/checkmate_db" DB_CONNECTION_STRING="mongodb://localhost:27017/checkmate_db"
TOKEN_TTL="99d" TOKEN_TTL="99d"
ORIGIN="${LOCAL_IP}" ORIGIN="${LOCAL_IP}"
LOG_LEVEL="info" LOG_LEVEL="info"
PORT=52345
EOF EOF
cat <<EOF >/opt/checkmate/client/.env cat <<EOF >/opt/checkmate/client/.env.local
VITE_APP_API_BASE_URL="http://${LOCAL_IP}:52345/api/v1" VITE_APP_API_BASE_URL="/api/v1"
UPTIME_APP_API_BASE_URL="/api/v1"
VITE_APP_LOG_LEVEL="warn" VITE_APP_LOG_LEVEL="warn"
EOF EOF
msg_ok "Configured Checkmate" msg_ok "Configured Checkmate"
@ -43,6 +46,7 @@ msg_ok "Configured Checkmate"
msg_info "Installing Checkmate Server" msg_info "Installing Checkmate Server"
cd /opt/checkmate/server cd /opt/checkmate/server
$STD npm install $STD npm install
$STD npm run build
msg_ok "Installed Checkmate Server" msg_ok "Installed Checkmate Server"
msg_info "Installing Checkmate Client" msg_info "Installing Checkmate Client"
@ -59,6 +63,7 @@ After=network.target mongod.service
[Service] [Service]
Type=simple Type=simple
User=root
WorkingDirectory=/opt/checkmate/server WorkingDirectory=/opt/checkmate/server
EnvironmentFile=/opt/checkmate/server/.env EnvironmentFile=/opt/checkmate/server/.env
ExecStart=/usr/bin/npm start ExecStart=/usr/bin/npm start
@ -72,12 +77,12 @@ EOF
cat <<EOF >/etc/systemd/system/checkmate-client.service cat <<EOF >/etc/systemd/system/checkmate-client.service
[Unit] [Unit]
Description=Checkmate Client Description=Checkmate Client
After=network.target checkmate-server.service After=network.target
[Service] [Service]
Type=simple Type=simple
User=root
WorkingDirectory=/opt/checkmate/client WorkingDirectory=/opt/checkmate/client
EnvironmentFile=/opt/checkmate/client/.env
ExecStart=/usr/bin/npm run preview -- --host 0.0.0.0 --port 5173 ExecStart=/usr/bin/npm run preview -- --host 0.0.0.0 --port 5173
Restart=on-failure Restart=on-failure
RestartSec=5 RestartSec=5
@ -88,6 +93,41 @@ EOF
systemctl enable -q --now checkmate-server checkmate-client systemctl enable -q --now checkmate-server checkmate-client
msg_ok "Created Services" msg_ok "Created Services"
msg_info "Configuring Nginx Reverse Proxy"
cat <<EOF >/etc/nginx/sites-available/checkmate
server {
listen 80 default_server;
server_name _;
client_max_body_size 100M;
# Client UI
location / {
proxy_pass http://127.0.0.1:5173;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
}
# API Server
location /api/v1/ {
proxy_pass http://127.0.0.1:52345/api/v1/;
proxy_http_version 1.1;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
}
}
EOF
ln -sf /etc/nginx/sites-available/checkmate /etc/nginx/sites-enabled/checkmate
rm -f /etc/nginx/sites-enabled/default
$STD systemctl reload nginx
msg_ok "Configured Nginx Reverse Proxy"
motd_ssh motd_ssh
customize customize
cleanup_lxc cleanup_lxc