mirror of https://github.com/tteck/Proxmox.git
Compare commits
No commits in common. "3b0168b8d471d45ec770c74002507b3906e15a8f" and "67edaf0193ad877a23f212738cf7521637859a62" have entirely different histories.
3b0168b8d4
...
67edaf0193
|
@ -4,13 +4,6 @@
|
|||
|
||||
- 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.
|
||||
|
||||
## 2023-09-11
|
||||
|
||||
### Changed
|
||||
|
||||
- **Paperless-ngx LXC**
|
||||
- Modify the script to incorporate Redis and PostgreSQL, while also introducing an option to include Adminer during installation.
|
||||
|
||||
## 2023-09-10
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -20,7 +20,7 @@ EOF
|
|||
header_info
|
||||
echo -e "Loading..."
|
||||
APP="Paperless-ngx"
|
||||
var_disk="10"
|
||||
var_disk="8"
|
||||
var_cpu="2"
|
||||
var_ram="2048"
|
||||
var_os="debian"
|
||||
|
|
|
@ -93,11 +93,10 @@ msg_info "Installing Natural Language Toolkit (Patience)"
|
|||
$STD python3 -m nltk.downloader -d /usr/share/nltk_data all
|
||||
msg_ok "Installed Natural Language Toolkit"
|
||||
|
||||
msg_info "Setting up PostgreSQL database"
|
||||
DB_NAME=paperlessdb
|
||||
msg_info "Setting up database"
|
||||
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)"
|
||||
DB_NAME=paperlessdb
|
||||
$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 TEMPLATE template0;"
|
||||
echo "Paperless-ngx Database User" >>~/paperless.creds
|
||||
|
@ -107,39 +106,13 @@ echo $DB_PASS >>~/paperless.creds
|
|||
echo "Paperless-ngx Database Name" >>~/paperless.creds
|
||||
echo $DB_NAME >>~/paperless.creds
|
||||
mkdir -p {consume,media}
|
||||
sed -i -e 's|#PAPERLESS_REDIS=redis://localhost:6379|PAPERLESS_REDIS=redis://localhost:6379|' /opt/paperless/paperless.conf
|
||||
sed -i -e 's|#PAPERLESS_DBHOST=localhost|PAPERLESS_DBHOST=localhost|' /opt/paperless/paperless.conf
|
||||
sed -i -e 's|#PAPERLESS_DBPORT=5432|PAPERLESS_DBPORT=5432|' /opt/paperless/paperless.conf
|
||||
sed -i -e "s|#PAPERLESS_DBNAME=paperless|PAPERLESS_DBNAME=$DB_NAME|" /opt/paperless/paperless.conf
|
||||
sed -i -e "s|#PAPERLESS_DBUSER=paperless|PAPERLESS_DBUSER=$DB_USER|" /opt/paperless/paperless.conf
|
||||
sed -i -e 's|#PAPERLESS_DBNAME=paperless|PAPERLESS_DBNAME=paperlessdb|' /opt/paperless/paperless.conf
|
||||
sed -i -e "s|#PAPERLESS_DBPASS=paperless|PAPERLESS_DBPASS=$DB_PASS|" /opt/paperless/paperless.conf
|
||||
SECRET_KEY="$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 32)"
|
||||
sed -i -e "s|#PAPERLESS_SECRET_KEY=change-me|PAPERLESS_SECRET_KEY=$SECRET_KEY|" /opt/paperless/paperless.conf
|
||||
cd /opt/paperless/src
|
||||
$STD python3 manage.py migrate
|
||||
msg_ok "Set up PostgreSQL database"
|
||||
|
||||
read -r -p "Would you like to add Adminer? <y/N> " prompt
|
||||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Adminer"
|
||||
$STD apt install -y adminer
|
||||
$STD a2enconf adminer
|
||||
systemctl reload apache2
|
||||
IP=$(hostname -I | awk '{print $1}')
|
||||
echo "" >>~/paperless.creds
|
||||
echo "Adminer Interface" >>~/paperless.creds
|
||||
echo $IP/adminer/ >>~/paperless.creds
|
||||
echo "Adminer System" >>~/paperless.creds
|
||||
echo PostgreSQL >>~/paperless.creds
|
||||
echo "Adminer Server" >>~/paperless.creds
|
||||
echo localhost:5432 >>~/paperless.creds
|
||||
echo "Adminer Username" >>~/paperless.creds
|
||||
echo $DB_USER >>~/paperless.creds
|
||||
echo "Adminer Password" >>~/paperless.creds
|
||||
echo $DB_PASS >>~/paperless.creds
|
||||
echo "Adminer Database" >>~/paperless.creds
|
||||
echo $DB_NAME >>~/paperless.creds
|
||||
msg_ok "Installed Adminer"
|
||||
fi
|
||||
msg_ok "Set up database"
|
||||
|
||||
msg_info "Setting up admin Paperless-ngx User & Password"
|
||||
## From https://github.com/linuxserver/docker-paperless-ngx/blob/main/root/etc/cont-init.d/99-migrations
|
||||
|
|
Loading…
Reference in New Issue