mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Set-up ftp for consume
This commit is contained in:
parent
ed2ea1e017
commit
40a026c351
@ -1,6 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Bash script to instal paperless in lxc containter
|
# Bash script to install paperless in lxc containter
|
||||||
|
|
||||||
|
# Add paperless user with no password
|
||||||
|
adduser --disabled-password --gecos "" paperless
|
||||||
|
# Add ftpupload
|
||||||
|
adduser --disabled-password --gecos "" ftpupload
|
||||||
|
echo "Set ftpupload password: "
|
||||||
|
passwd ftpupload
|
||||||
|
# Allow paperless group to access
|
||||||
|
adduser paperless ftpupload
|
||||||
|
|
||||||
# Get apt up to date
|
# Get apt up to date
|
||||||
apt-get update
|
apt-get update
|
||||||
@ -10,8 +19,17 @@ apt-get -y install unpaper gnupg libpoppler-cpp-dev python3-pyocr tesseract-ocr
|
|||||||
|
|
||||||
# Needed for Apache
|
# Needed for Apache
|
||||||
apt-get -y install apache2 libapache2-mod-wsgi-py3
|
apt-get -y install apache2 libapache2-mod-wsgi-py3
|
||||||
# paperless user
|
|
||||||
adduser --disabled-password --gecos "" paperless
|
# Instll ftp server and make sure all files are owned by paperless
|
||||||
|
apt-get install proftpd
|
||||||
|
cat <<EOF >> /etc/proftpd/proftpd.conf
|
||||||
|
<Directory /home/ftpupload/>
|
||||||
|
UserOwner paperless
|
||||||
|
GroupOwner paperless
|
||||||
|
</Directory>
|
||||||
|
EOF
|
||||||
|
systemctl restart proftpd
|
||||||
|
|
||||||
|
|
||||||
#Get Paperless from git (NB: currently fork)
|
#Get Paperless from git (NB: currently fork)
|
||||||
su -c "cd /home/paperless ; git clone https://github.com/bmsleight/paperless" paperless
|
su -c "cd /home/paperless ; git clone https://github.com/bmsleight/paperless" paperless
|
||||||
@ -24,8 +42,8 @@ pip3 install -r requirements.txt
|
|||||||
#Set up consume directory
|
#Set up consume directory
|
||||||
su -c "mkdir /home/paperless/consume" paperless
|
su -c "mkdir /home/paperless/consume" paperless
|
||||||
|
|
||||||
# Take paperless.conf.example and set consumuption dir
|
# Take paperless.conf.example and set consumuption dir (ftp dir)
|
||||||
sed -e '/PAPERLESS_CONSUMPTION_DIR=/s/=.*/=\"\/home\/paperless\/consume\/\"/' \
|
sed -e '/PAPERLESS_CONSUMPTION_DIR=/s/=.*/=\"\/home\/ftpupload\/\"/' \
|
||||||
/home/paperless/paperless/paperless.conf.example >/etc/paperless.conf
|
/home/paperless/paperless/paperless.conf.example >/etc/paperless.conf
|
||||||
|
|
||||||
# Update /etc/paperless.conf with PAPERLESS_SECRET_KEY
|
# Update /etc/paperless.conf with PAPERLESS_SECRET_KEY
|
||||||
@ -44,3 +62,14 @@ cp /home/paperless/paperless/scripts/lxc/paperless.conf /etc/apache2/sites-avail
|
|||||||
a2dissite 000-default.conf
|
a2dissite 000-default.conf
|
||||||
a2ensite paperless.conf
|
a2ensite paperless.conf
|
||||||
systemctl reload apache2
|
systemctl reload apache2
|
||||||
|
|
||||||
|
sed -e "s/home\/paperless\/project\/virtualenv\/bin\/python/usr\/bin\/python3/" \
|
||||||
|
/home/paperless/paperless/scripts/paperless-consumer.service \
|
||||||
|
>/etc/systemd/system/paperless-consumer.service
|
||||||
|
|
||||||
|
sed -i "s/\/home\/paperless\/project\/src\/manage.py/\/home\/paperless\/paperless\/src\/manage.py/" \
|
||||||
|
/etc/systemd/system/paperless-consumer.service
|
||||||
|
|
||||||
|
|
||||||
|
systemctl enable paperless-consumer
|
||||||
|
systemctl start paperless-consumer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user