mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-19 03:55:15 +00:00
Compare commits
2 Commits
michelroeg
...
add-script
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d6c78a17e | ||
|
|
36c87467f3 |
12
.github/ISSUE_TEMPLATE/bug_report.yml
generated
vendored
12
.github/ISSUE_TEMPLATE/bug_report.yml
generated
vendored
@@ -22,18 +22,6 @@ body:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: verbose_run
|
||||
attributes:
|
||||
label: 🔎 Did you run the script with verbose mode enabled?
|
||||
description: "Required for debugging any script issue. A verbose log is mandatory."
|
||||
options:
|
||||
- ""
|
||||
- "Yes, verbose mode was enabled and the output is included below"
|
||||
- "No (this issue will likely be closed automatically)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: script_name
|
||||
attributes:
|
||||
|
||||
17
CHANGELOG.md
17
CHANGELOG.md
@@ -14,8 +14,7 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
- Passbolt ([#9226](https://github.com/community-scripts/ProxmoxVE/pull/9226))
|
||||
- Domain-Locker ([#9214](https://github.com/community-scripts/ProxmoxVE/pull/9214))
|
||||
- Domain-Locker ([#9214](https://github.com/community-scripts/ProxmoxVE/pull/9214))
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
@@ -24,20 +23,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
- NetVisor: add build deps, increase RAM [@vhsdream](https://github.com/vhsdream) ([#9205](https://github.com/community-scripts/ProxmoxVE/pull/9205))
|
||||
- fix: restart apache2 after installing zabbix config [@AlphaLawless](https://github.com/AlphaLawless) ([#9206](https://github.com/community-scripts/ProxmoxVE/pull/9206))
|
||||
|
||||
- #### ✨ New Features
|
||||
|
||||
- [core]: harmonize app_name for creds [@MickLesk](https://github.com/MickLesk) ([#9224](https://github.com/community-scripts/ProxmoxVE/pull/9224))
|
||||
|
||||
- #### 💥 Breaking Changes
|
||||
|
||||
- Refactor: paperless-ngx (Breaking Change Inside) [@MickLesk](https://github.com/MickLesk) ([#9223](https://github.com/community-scripts/ProxmoxVE/pull/9223))
|
||||
|
||||
### 🧰 Maintenance
|
||||
|
||||
- #### 📂 Github
|
||||
|
||||
- github: add verbose mode check to bug report template [@MickLesk](https://github.com/MickLesk) ([#9234](https://github.com/community-scripts/ProxmoxVE/pull/9234))
|
||||
|
||||
## 2025-11-16
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
____ __ ____
|
||||
/ __ \____ ___________/ /_ ____ / / /_
|
||||
/ /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
|
||||
/ ____/ /_/ (__ |__ ) /_/ / /_/ / / /_
|
||||
/_/ \__,_/____/____/_.___/\____/_/\__/
|
||||
|
||||
@@ -27,27 +27,6 @@ function update_script() {
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Check for old data structure and prompt migration
|
||||
if [[ -f /opt/paperless/paperless.conf ]]; then
|
||||
local OLD_DIRS=()
|
||||
[[ -d /opt/paperless/consume ]] && OLD_DIRS+=("consume")
|
||||
[[ -d /opt/paperless/data ]] && OLD_DIRS+=("data")
|
||||
[[ -d /opt/paperless/media ]] && OLD_DIRS+=("media")
|
||||
|
||||
if [[ ${#OLD_DIRS[@]} -gt 0 ]]; then
|
||||
msg_error "Old data structure detected in /opt/paperless/"
|
||||
msg_custom "📂" "Found directories: ${OLD_DIRS[*]}"
|
||||
echo -e ""
|
||||
msg_custom "🔄" "Migration required to new data structure (/opt/paperless_data/)"
|
||||
msg_custom "📖" "Please follow the migration guide:"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}https://github.com/community-scripts/ProxmoxVE/discussions/9223${CL}"
|
||||
echo -e ""
|
||||
msg_custom "⚠️" "Update aborted. Please migrate your data first."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if check_for_gh_release "paperless" "paperless-ngx/paperless-ngx"; then
|
||||
msg_info "Stopping all Paperless-ngx Services"
|
||||
systemctl stop paperless-consumer paperless-webserver paperless-scheduler paperless-task-queue
|
||||
@@ -55,9 +34,15 @@ function update_script() {
|
||||
|
||||
if grep -q "uv run" /etc/systemd/system/paperless-webserver.service; then
|
||||
|
||||
msg_info "Backing up configuration"
|
||||
msg_info "Backing up user data and configuration"
|
||||
local BACKUP_DIR="/opt/paperless_backup_$$"
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
for dir in /opt/paperless/*/; do
|
||||
dir_name=$(basename "$dir")
|
||||
if [[ ! "$dir_name" =~ ^(docker|docs|scripts|src|static)$ ]]; then
|
||||
cp -r "/opt/paperless/$dir_name" "$BACKUP_DIR/" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
[[ -f /opt/paperless/paperless.conf ]] && cp /opt/paperless/paperless.conf "$BACKUP_DIR/"
|
||||
msg_ok "Backup completed to $BACKUP_DIR"
|
||||
|
||||
@@ -98,9 +83,16 @@ function update_script() {
|
||||
rm -rf /opt/paperless/venv
|
||||
find /opt/paperless -name "__pycache__" -type d -exec rm -rf {} +
|
||||
|
||||
msg_info "Backing up configuration"
|
||||
msg_info "Backing up user data and configuration"
|
||||
local BACKUP_DIR="/opt/paperless_backup_$$"
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
for dir in /opt/paperless/*/; do
|
||||
dir_name=$(basename "$dir")
|
||||
if [[ ! "$dir_name" =~ ^(docker|docs|scripts|src|static)$ ]]; then
|
||||
cp -r "/opt/paperless/$dir_name" "$BACKUP_DIR/" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
[[ -f /opt/paperless/paperless.conf ]] && cp /opt/paperless/paperless.conf "$BACKUP_DIR/"
|
||||
msg_ok "Backup completed to $BACKUP_DIR"
|
||||
|
||||
@@ -129,9 +121,16 @@ function update_script() {
|
||||
done
|
||||
|
||||
$STD systemctl daemon-reload
|
||||
msg_info "Backing up configuration"
|
||||
msg_info "Backing up user data and configuration"
|
||||
BACKUP_DIR="/opt/paperless_backup_$$"
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
for dir in /opt/paperless/*/; do
|
||||
dir_name=$(basename "$dir")
|
||||
if [[ ! "$dir_name" =~ ^(docker|docs|scripts|src|static)$ ]]; then
|
||||
cp -r "/opt/paperless/$dir_name" "$BACKUP_DIR/" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
[[ -f /opt/paperless/paperless.conf ]] && cp /opt/paperless/paperless.conf "$BACKUP_DIR/"
|
||||
msg_ok "Backup completed to $BACKUP_DIR"
|
||||
|
||||
|
||||
@@ -28,13 +28,8 @@
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
"username": "admin",
|
||||
"password": "admin"
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"text": "After installation, the admin user credentials are saved in the file ~/librenms.creds inside the container.",
|
||||
"type": "info"
|
||||
}
|
||||
]
|
||||
"notes": []
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"categories": [
|
||||
6
|
||||
],
|
||||
"date_created": "2025-11-17",
|
||||
"date_created": "2025-09-04",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
|
||||
@@ -113,19 +113,11 @@ mkdir -p /etc/bash_completion.d/
|
||||
cp /opt/librenms/misc/lnms-completion.bash /etc/bash_completion.d/
|
||||
cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf
|
||||
|
||||
APP_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
APP_USER="admin"
|
||||
{
|
||||
echo "LibreNMS Credentials"
|
||||
echo "Username: ${APP_USER}"
|
||||
echo "Password: ${APP_PASSWORD}"
|
||||
} >>~/librenms.creds
|
||||
|
||||
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev"
|
||||
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && php8.4 artisan migrate --force"
|
||||
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && php8.4 artisan key:generate --force"
|
||||
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && lnms db:seed --force"
|
||||
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && lnms user:add -p ${APP_PASSWORD} ${APP_USER} --role=admin"
|
||||
$STD su - librenms -s /bin/bash -c "cd /opt/librenms && lnms user:add -p admin -r admin admin"
|
||||
|
||||
RANDOM_STRING=$(openssl rand -base64 16 | tr -dc 'a-zA-Z0-9')
|
||||
sed -i "s/RANDOMSTRINGHERE/$RANDOM_STRING/g" /etc/snmp/snmpd.conf
|
||||
|
||||
@@ -44,36 +44,46 @@ $STD apt install -y \
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PG_VERSION="16" setup_postgresql
|
||||
PG_DB_NAME="paperlessdb" PG_DB_USER="paperless" setup_postgresql_db
|
||||
PYTHON_VERSION="3.13" setup_uv
|
||||
fetch_and_deploy_gh_release "paperless" "paperless-ngx/paperless-ngx" "prebuild" "latest" "/opt/paperless" "paperless*tar.xz"
|
||||
|
||||
msg_info "Setting up PostgreSQL database"
|
||||
DB_NAME=paperlessdb
|
||||
DB_USER=paperless
|
||||
DB_PASS="$(openssl rand -base64 18 | cut -c1-13)"
|
||||
SECRET_KEY="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 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 "Paperless-ngx-Credentials"
|
||||
echo "Paperless-ngx Database Name: $DB_NAME"
|
||||
echo "Paperless-ngx Database User: $DB_USER"
|
||||
echo "Paperless-ngx Database Password: $DB_PASS"
|
||||
echo "Paperless-ngx Secret Key: $SECRET_KEY\n"
|
||||
echo "Paperless-ngx WebUI User: admin"
|
||||
echo "Paperless-ngx WebUI Password: $DB_PASS"
|
||||
} >>~/paperless-ngx.creds
|
||||
msg_ok "Setup PostgreSQL database"
|
||||
|
||||
msg_info "Setup Paperless-ngx"
|
||||
cd /opt/paperless
|
||||
rm -rf /opt/paperless/docker
|
||||
$STD uv sync --all-extras
|
||||
curl -fsSL "https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/paperless.conf.example" -o /opt/paperless/paperless.conf
|
||||
mkdir -p /opt/paperless_data/{consume,data,media,trash}
|
||||
mkdir -p /opt/paperless/static
|
||||
SECRET_KEY="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)"
|
||||
{
|
||||
echo ""
|
||||
echo "Paperless-ngx Secret Key: $SECRET_KEY"
|
||||
echo "Paperless-ngx WebUI User: admin"
|
||||
echo "Paperless-ngx WebUI Password: $PG_DB_PASS"
|
||||
} >>~/paperless-ngx.creds
|
||||
mkdir -p {consume,data,media,static}
|
||||
sed -i \
|
||||
-e 's|#PAPERLESS_REDIS=redis://localhost:6379|PAPERLESS_REDIS=redis://localhost:6379|' \
|
||||
-e "s|#PAPERLESS_CONSUMPTION_DIR=../consume|PAPERLESS_CONSUMPTION_DIR=/opt/paperless_data/consume|" \
|
||||
-e "s|#PAPERLESS_DATA_DIR=../data|PAPERLESS_DATA_DIR=/opt/paperless_data/data|" \
|
||||
-e "s|#PAPERLESS_MEDIA_ROOT=../media|PAPERLESS_MEDIA_ROOT=/opt/paperless_data/media|" \
|
||||
-e "s|#PAPERLESS_EMPTY_TRASH_DIR=|PAPERLESS_EMPTY_TRASH_DIR=/opt/paperless_data/trash|" \
|
||||
-e "s|#PAPERLESS_CONSUMPTION_DIR=../consume|PAPERLESS_CONSUMPTION_DIR=/opt/paperless/consume|" \
|
||||
-e "s|#PAPERLESS_DATA_DIR=../data|PAPERLESS_DATA_DIR=/opt/paperless/data|" \
|
||||
-e "s|#PAPERLESS_MEDIA_ROOT=../media|PAPERLESS_MEDIA_ROOT=/opt/paperless/media|" \
|
||||
-e "s|#PAPERLESS_STATICDIR=../static|PAPERLESS_STATICDIR=/opt/paperless/static|" \
|
||||
-e 's|#PAPERLESS_DBHOST=localhost|PAPERLESS_DBHOST=localhost|' \
|
||||
-e 's|#PAPERLESS_DBPORT=5432|PAPERLESS_DBPORT=5432|' \
|
||||
-e "s|#PAPERLESS_DBNAME=paperless|PAPERLESS_DBNAME=$PG_DB_NAME|" \
|
||||
-e "s|#PAPERLESS_DBUSER=paperless|PAPERLESS_DBUSER=$PG_DB_USER|" \
|
||||
-e "s|#PAPERLESS_DBPASS=paperless|PAPERLESS_DBPASS=$PG_DB_PASS|" \
|
||||
-e "s|#PAPERLESS_DBNAME=paperless|PAPERLESS_DBNAME=$DB_NAME|" \
|
||||
-e "s|#PAPERLESS_DBUSER=paperless|PAPERLESS_DBUSER=$DB_USER|" \
|
||||
-e "s|#PAPERLESS_DBPASS=paperless|PAPERLESS_DBPASS=$DB_PASS|" \
|
||||
-e "s|#PAPERLESS_SECRET_KEY=change-me|PAPERLESS_SECRET_KEY=$SECRET_KEY|" \
|
||||
/opt/paperless/paperless.conf
|
||||
cd /opt/paperless/src
|
||||
@@ -87,7 +97,7 @@ msg_info "Setting up admin Paperless-ngx User & Password"
|
||||
cat <<EOF | uv run -- python /opt/paperless/src/manage.py shell
|
||||
from django.contrib.auth import get_user_model
|
||||
UserModel = get_user_model()
|
||||
user = UserModel.objects.create_user('admin', password='$PG_DB_PASS')
|
||||
user = UserModel.objects.create_user('admin', password='$DB_PASS')
|
||||
user.is_superuser = True
|
||||
user.is_staff = True
|
||||
user.save()
|
||||
@@ -98,8 +108,8 @@ msg_info "Installing Natural Language Toolkit (Patience)"
|
||||
cd /opt/paperless
|
||||
$STD uv run python -m nltk.downloader -d /usr/share/nltk_data snowball_data
|
||||
$STD uv run python -m nltk.downloader -d /usr/share/nltk_data stopwords
|
||||
$STD uv run python -m nltk.downloader -d /usr/share/nltk_data punkt_tab ||
|
||||
$STD uv run python -m nltk.downloader -d /usr/share/nltk_data punkt
|
||||
$STD uv run python -m nltk.downloader -d /usr/share/nltk_data punkt_tab || \
|
||||
$STD uv run python -m nltk.downloader -d /usr/share/nltk_data punkt
|
||||
for policy_file in /etc/ImageMagick-6/policy.xml /etc/ImageMagick-7/policy.xml; do
|
||||
if [[ -f "$policy_file" ]]; then
|
||||
sed -i -e 's/rights="none" pattern="PDF"/rights="read|write" pattern="PDF"/' "$policy_file"
|
||||
@@ -176,4 +186,11 @@ fi
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf /opt/paperless/docker
|
||||
rm -rf /tmp/ghostscript*
|
||||
$STD apt -y autoremove
|
||||
$STD apt -y autoclean
|
||||
$STD apt -y clean
|
||||
msg_ok "Cleaned"
|
||||
|
||||
@@ -3117,8 +3117,7 @@ function setup_mariadb_db() {
|
||||
|
||||
$STD mariadb -u root -e "FLUSH PRIVILEGES;"
|
||||
|
||||
local app_name="${APPLICATION,,}"
|
||||
local CREDS_FILE="${MARIADB_DB_CREDS_FILE:-${HOME}/${app_name}.creds}"
|
||||
local CREDS_FILE="${MARIADB_DB_CREDS_FILE:-${HOME}/${APPLICATION}.creds}"
|
||||
{
|
||||
echo "MariaDB Credentials"
|
||||
echo "Database: $MARIADB_DB_NAME"
|
||||
@@ -4036,8 +4035,7 @@ function setup_postgresql_db() {
|
||||
fi
|
||||
|
||||
# Save credentials
|
||||
local app_name="${APPLICATION,,}"
|
||||
local CREDS_FILE="${PG_DB_CREDS_FILE:-${HOME}/${app_name}.creds}"
|
||||
local CREDS_FILE="${PG_DB_CREDS_FILE:-${HOME}/${APPLICATION}.creds}"
|
||||
{
|
||||
echo "PostgreSQL Credentials"
|
||||
echo "Database: $PG_DB_NAME"
|
||||
|
||||
Reference in New Issue
Block a user