debmaker/ressources/linkding/rootfs/DEBIAN/postinst

20 lines
632 B
Plaintext
Raw Permalink Normal View History

2023-01-18 01:56:13 +01:00
#!/bin/bash
#Allready create on package then no -md
id linkding &> /dev/null || useradd linkding -r -s /bin/false -d /var/lib/linkding
chown linkding:linkding /var/lib/linkding -R
#Need to be remove because usr need to be in read only
chown linkding:linkding /usr/share/linkding/bookmarks/static -R
su - -s /usr/bin/bash linkding -c "pip3 install -r /usr/share/linkding/requirements.txt --no-warn-script-location"
#Upgrade Database
su - -s /usr/bin/bash linkding -c "python /usr/share/linkding/manage.py migrate"
#Create secret
su - -s /usr/bin/bash linkding -c "python /usr/share/linkding/manage.py generate_secret_key"