mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-20 17:05:05 +02:00
Compare commits
1 Commits
fix/pangol
...
github-act
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da91e2ca92 |
@@ -445,12 +445,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
</details>
|
||||
|
||||
## 2026-04-19
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
- nametag ([#13849](https://github.com/community-scripts/ProxmoxVE/pull/13849))
|
||||
|
||||
## 2026-04-18
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
_ __ __
|
||||
/ | / /___ _____ ___ ___ / /_____ _____ _
|
||||
/ |/ / __ `/ __ `__ \/ _ \/ __/ __ `/ __ `/
|
||||
/ /| / /_/ / / / / / / __/ /_/ /_/ / /_/ /
|
||||
/_/ |_/\__,_/_/ /_/ /_/\___/\__/\__,_/\__, /
|
||||
/____/
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/mattogodoy/nametag
|
||||
|
||||
APP="Nametag"
|
||||
var_tags="${var_tags:-contacts;crm}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-8}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/nametag ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "nametag" "mattogodoy/nametag"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop nametag
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Backing up Data"
|
||||
cp /opt/nametag/.env /opt/nametag.env.bak
|
||||
cp -r /opt/nametag/data /opt/nametag_data_bak
|
||||
msg_ok "Backed up Data"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "nametag" "mattogodoy/nametag" "tarball" "latest" "/opt/nametag"
|
||||
|
||||
msg_info "Rebuilding Application"
|
||||
cd /opt/nametag
|
||||
$STD npm ci
|
||||
set -a
|
||||
source /opt/nametag/.env
|
||||
set +a
|
||||
$STD npx prisma generate
|
||||
$STD npm run build
|
||||
cp -r /opt/nametag/.next/static /opt/nametag/.next/standalone/.next/static
|
||||
cp -r /opt/nametag/public /opt/nametag/.next/standalone/public
|
||||
msg_ok "Rebuilt Application"
|
||||
|
||||
msg_info "Restoring Data"
|
||||
cp /opt/nametag.env.bak /opt/nametag/.env
|
||||
cp -r /opt/nametag_data_bak/. /opt/nametag/data/
|
||||
rm -f /opt/nametag.env.bak
|
||||
rm -rf /opt/nametag_data_bak
|
||||
msg_ok "Restored Data"
|
||||
|
||||
msg_info "Running Migrations"
|
||||
cd /opt/nametag
|
||||
$STD npx prisma migrate deploy
|
||||
msg_ok "Ran Migrations"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start nametag
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
|
||||
@@ -69,18 +69,7 @@ function update_script() {
|
||||
|
||||
msg_info "Running database migrations"
|
||||
cd /opt/pangolin
|
||||
|
||||
# Pre-apply potentially destructive schema changes safely so drizzle-kit
|
||||
# does not recreate tables (which would delete all rows).
|
||||
local DB="/opt/pangolin/config/db/db.sqlite"
|
||||
if [[ -f "$DB" ]]; then
|
||||
sqlite3 "$DB" "ALTER TABLE 'orgs' ADD COLUMN 'settingsLogRetentionDaysConnection' integer DEFAULT 0 NOT NULL;" 2>/dev/null || true
|
||||
sqlite3 "$DB" "ALTER TABLE 'clientSitesAssociationsCache' ADD COLUMN 'isJitMode' integer DEFAULT 0 NOT NULL;" 2>/dev/null || true
|
||||
# Migrate roleId from userOrgs → userOrgRoles before the column is dropped
|
||||
sqlite3 "$DB" "INSERT OR IGNORE INTO 'userOrgRoles' (userId, orgId, roleId) SELECT userId, orgId, roleId FROM 'userOrgs' WHERE roleId IS NOT NULL;" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
ENVIRONMENT=prod $STD npx drizzle-kit push --force --config drizzle.sqlite.config.ts
|
||||
ENVIRONMENT=prod $STD npx drizzle-kit push --config drizzle.sqlite.config.ts
|
||||
msg_ok "Ran database migrations"
|
||||
|
||||
msg_info "Updating Badger plugin version"
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/mattogodoy/nametag
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
PG_VERSION="16" setup_postgresql
|
||||
PG_DB_NAME="nametag_db" PG_DB_USER="nametag" setup_postgresql_db
|
||||
NODE_VERSION="20" setup_nodejs
|
||||
fetch_and_deploy_gh_release "nametag" "mattogodoy/nametag" "tarball" "latest" "/opt/nametag"
|
||||
|
||||
msg_info "Setting up Application"
|
||||
cd /opt/nametag
|
||||
$STD npm ci
|
||||
DATABASE_URL="postgresql://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME}" $STD npx prisma generate
|
||||
DATABASE_URL="postgresql://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME}" $STD npx prisma migrate deploy
|
||||
msg_ok "Set up Application"
|
||||
|
||||
msg_info "Configuring Nametag"
|
||||
NEXTAUTH_SECRET=$(openssl rand -base64 32)
|
||||
CRON_SECRET=$(openssl rand -base64 16)
|
||||
mkdir -p /opt/nametag/data/photos
|
||||
cat <<EOF >/opt/nametag/.env
|
||||
DATABASE_URL=postgresql://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME}
|
||||
NEXTAUTH_URL=http://${LOCAL_IP}:3000
|
||||
NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
|
||||
CRON_SECRET=${CRON_SECRET}
|
||||
PHOTO_STORAGE_PATH=/opt/nametag/data/photos
|
||||
NODE_ENV=production
|
||||
EOF
|
||||
msg_ok "Configured Nametag"
|
||||
|
||||
msg_info "Building Application"
|
||||
cd /opt/nametag
|
||||
set -a
|
||||
source /opt/nametag/.env
|
||||
set +a
|
||||
$STD npm run build
|
||||
cp -r /opt/nametag/.next/static /opt/nametag/.next/standalone/.next/static
|
||||
cp -r /opt/nametag/public /opt/nametag/.next/standalone/public
|
||||
msg_ok "Built Application"
|
||||
|
||||
msg_info "Running Production Seed"
|
||||
cd /opt/nametag
|
||||
$STD npx esbuild prisma/seed.production.ts --platform=node --format=cjs --outfile=prisma/seed.production.js --bundle --external:@prisma/client --external:pg --minify
|
||||
$STD node prisma/seed.production.js
|
||||
msg_ok "Ran Production Seed"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/nametag.service
|
||||
[Unit]
|
||||
Description=Nametag - Personal Relationships Manager
|
||||
After=network.target postgresql.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/nametag
|
||||
EnvironmentFile=/opt/nametag/.env
|
||||
ExecStart=/usr/bin/node /opt/nametag/.next/standalone/server.js
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now nametag
|
||||
msg_ok "Created Service"
|
||||
|
||||
msg_info "Setting up Cron Jobs"
|
||||
cat <<EOF >/etc/cron.d/nametag
|
||||
0 8 * * * root curl -sf -H "Authorization: Bearer ${CRON_SECRET}" http://127.0.0.1:3000/api/cron/send-reminders >/dev/null 2>&1
|
||||
0 3 * * * root curl -sf -H "Authorization: Bearer ${CRON_SECRET}" http://127.0.0.1:3000/api/cron/purge-deleted >/dev/null 2>&1
|
||||
EOF
|
||||
chmod 644 /etc/cron.d/nametag
|
||||
msg_ok "Set up Cron Jobs"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in New Issue
Block a user