This commit is contained in:
2023-07-05 18:16:05 +02:00
parent 61103a1caf
commit 6080db6bc1
9 changed files with 93 additions and 50 deletions

View File

@@ -3,6 +3,9 @@ PKG py39-pip py39-pikepdf py39-scikit-learn liberation-fonts-ttf imagemagick7 zb
SYSRC redis_enable="YES"
SERVICE redis start
CP usr /
CP tmp /
CMD mkdir /opt
CMD curl -L https://github.com/paperless-ngx/paperless-ngx/releases/download/v1.9.2/paperless-ngx-v1.9.2.tar.xz --output paperless-ngx-v1.9.2.tar.xz
CMD tar -zxf paperless-ngx-v1.9.2.tar.xz
@@ -17,12 +20,12 @@ CMD sed -i "" -e 's/#PAPERLESS_DATA_DIR/PAPERLESS_DATA_DIR/' /opt/paperless/pape
CMD sed -i "" -e 's/#PAPERLESS_MEDIA_ROOT/PAPERLESS_MEDIA_ROOT/' /opt/paperless/paperless.conf
CMD sed -i "" -e 's/#PAPERLESS_CONSUMPTION_DIR/PAPERLESS_CONSUMPTION_DIR/' /opt/paperless/paperless.conf
CMD sed -i "" -e 's/#PAPERLESS_REDIS/PAPERLESS_REDIS/' /opt/paperless/paperless.conf
CMD sed -i "" -e "/PAPERLESS_REDIS/ a\PAPERLESS_DBENGINE=sqlite" /opt/paperless/paperless.conf
CMD sed -i "" -e "/PAPERLESS_REDIS/ a\ PAPERLESS_DBENGINE=sqlite" /opt/paperless/paperless.conf
CMD sed -i "" -e '/PDF/s/rights="none"/rights="read|write"/' /usr/local/etc/ImageMagick-7/policy.xml
CMD cd /opt/paperless
CMD su paperless -c /tmp/paperless_install
SYSRC paperlessconsumer_enable="YES"
SYSRC paperlesswebserver_enable="YES"

View File

@@ -1,50 +1,5 @@
## Status
[![pipeline status](https://gitlab.com/bastillebsd-templates/minecraft-server/badges/master/pipeline.svg)](https://gitlab.com/bastillebsd-templates/minecraft-server/commits/master)
# iocage-plugin-paperless-ngx
Artifact file(s) for Paperless NGX iocage plugin
## minecraft-server
Bastille template for a minecraft server.
Note: by installing this template you agree to the terms of the [Minecraft EULA](https://aka.ms/MinecraftEULA).
This template includes the `eula=true` acceptance and `LICENSES_ACCEPTED+= minecraft`
settings. If you cannot abide the terms of the Minecraft EULA *do not* apply this template.
### requirements
Due to license restrictions (see above Minecraft EULA), redistribution of
Minecraft server is prohibited. This means you must build the package manually
from the FreeBSD ports tree.
This template will automate all the build steps but depends on `/usr/ports`
existing on the host system.
To install (or update) `/usr/ports` on the host system use `portsnap` as seen here:
```shell
ishmael ~ # portsnap fetch auto
```
Note: the ports tree is mounted read-only within the container.
## Bootstrap template
```shell
ishmael ~ # bastille bootstrap https://gitlab.com/bastillebsd-templates/minecraft-server
```
## Apply template
```shell
ishmael ~ # bastille template TARGET bastillebsd-templates/minecraft-server
```
## Access server console
The minecraft server will run in `STANDALONE` mode meaning the service execution
will happen within a `tmux` session. To access this session use this command:
```shell
ishmael ~ # bastille service TARGET minecraft console
```
Tip: `tmux` session management is handled using `ctrl-b` prefix. To exit the
session press `ctrl-b d`.
After install, the admin username and password are both "admin". Please change at first login for security reasons. The web portal for paperless-ngx will be the jail ip address and port 8000. More information on paperless-ngx can be found at https://paperless-ngx.readthedocs.io/en/latest/index.html.

16
tmp/paperless_install Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
mkdir -p /opt/paperless/consume
mkdir -p /opt/paperless/media
cd /opt/paperless
python3.9 -m venv venv
sed -i "" -e '/scikit-learn/d;/pikepdf/d;/scipy/d;/numpy/d' /opt/paperless/requirements.txt
. venv/bin/activate
pip install -q -q --upgrade pip
pip install -q -q -r requirements.txt
cd src
python3.9 manage.py migrate
DJANGO_SUPERUSER_PASSWORD=admin
python3.9 manage.py createsuperuser --noinput --email=root@localhost --username=admin
deactivate

View File

@@ -0,0 +1,18 @@
#!/bin/sh
. /etc/rc.subr
name="paperlessconsumer"
rcvar="${name}_enable"
procname="daemon"
pidfile="/var/run/${name}.pid"
command="/usr/sbin/daemon"
command_args="-f -P ${pidfile} -u paperless /usr/local/sbin/${name}"
load_rc_config $name
run_rc_command "$1"

View File

@@ -0,0 +1,18 @@
#!/bin/sh
. /etc/rc.subr
name="paperlessscheduler"
rcvar="${name}_enable"
procname="daemon"
pidfile="/var/run/${name}.pid"
command="/usr/sbin/daemon"
command_args="-f -P ${pidfile} -u paperless /usr/local/sbin/${name}"
load_rc_config $name
run_rc_command "$1"

View File

@@ -0,0 +1,18 @@
#!/bin/sh
. /etc/rc.subr
name="paperlesswebserver"
rcvar="${name}_enable"
procname="daemon"
pidfile="/var/run/${name}.pid"
command="/usr/sbin/daemon"
command_args="-f -P ${pidfile} -u paperless /usr/local/sbin/${name}"
load_rc_config $name
run_rc_command "$1"

View File

@@ -0,0 +1,5 @@
#!/bin/sh
. /opt/paperless/venv/bin/activate
cd /opt/paperless/src
exec python3.9 manage.py document_consumer

View File

@@ -0,0 +1,5 @@
#!/bin/sh
. /opt/paperless/venv/bin/activate
cd /opt/paperless/src
exec python3.9 /opt/paperless/src/manage.py qcluster

View File

@@ -0,0 +1,5 @@
#!/bin/sh
. /opt/paperless/venv/bin/activate
cd /opt/paperless/src
exec python3.9 manage.py runserver 0.0.0.0:8000