diff options
author | B Stack <bgstack15@gmail.com> | 2020-12-16 08:57:05 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-12-16 08:57:05 -0500 |
commit | f2b867ace911afa59e9205047435101bc6306ae8 (patch) | |
tree | 402071caf59a2bc089e303ea5f7978b64ed6c33b /debian | |
parent | move styles to Flask static/ dir (diff) | |
download | hex-zero-f2b867ace911afa59e9205047435101bc6306ae8.tar.gz hex-zero-f2b867ace911afa59e9205047435101bc6306ae8.tar.bz2 hex-zero-f2b867ace911afa59e9205047435101bc6306ae8.zip |
add better debian install notes
Diffstat (limited to 'debian')
-rw-r--r-- | debian/README.Debian | 5 | ||||
-rw-r--r-- | debian/control | 1 | ||||
-rw-r--r-- | debian/postinst | 20 |
3 files changed, 20 insertions, 6 deletions
diff --git a/debian/README.Debian b/debian/README.Debian index 3babcfe..e2bbc21 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -2,4 +2,9 @@ hex-zero for Devuan 0x0 file upload and hosting service in Flask. +At initial install, you will need to manually install short_url with pip. The dpkg configure will demonstrate how to do this. The steps are as follows: + + sudo su hex-zero -c 'pip3 install --user short_url' + sudo dpkg-reconfigure hex-zero + -- B. Stack <bgstack15@gmail.com> Thu, 10 Dec 2020 08:10:02 -0500 diff --git a/debian/control b/debian/control index 2e46114..9f9fa4c 100644 --- a/debian/control +++ b/debian/control @@ -31,6 +31,7 @@ Depends: apache2, python3-validators, python3-werkzeug, python3:any, + python3-pip, uwsgi-core, uwsgi-plugin-python3, ${misc:Depends}, diff --git a/debian/postinst b/debian/postinst index ff6d28f..0e4f748 100644 --- a/debian/postinst +++ b/debian/postinst @@ -19,15 +19,23 @@ case "$1" in --gecos "0x0 system user" \ ${USERNAME} > ${OUT} fi - if ! test -r /var/www/hex-zero/db.sqlite || test $( stat -c "%s" /var/www/hex-zero/db.sqlite 2>/dev/null ) -lt 50 ; - then - echo "Initializing sqlite database for hex-zero" - su ${USER} -c 'cd /var/www/hex-zero ; /var/www/hex-zero/hex_zero.py db init' 2>/dev/null || : - su ${USER} -c 'cd /var/www/hex-zero ; /var/www/hex-zero/hex_zero.py db upgrade' - fi chown ${USERNAME}:${USERNAME} \ ${HOME} ${HOME}/* \ /var/log/hex-zero /var/log/hex-zero/*log 1>/${OUT} 2>&1 || : + if ! test -r /var/www/hex-zero/db.sqlite || test $( stat -c "%s" /var/www/hex-zero/db.sqlite 2>/dev/null ) -lt 50 ; + then + # detect if short_url exists for the user + result="$( su ${USERNAME} -c 'echo "import short_url" | python3 1>/dev/null 2>&1 && echo good || echo bad' )" + if test "${result}" = "bad" ; + then + echo "Please install python3 module short_url for user ${USERNAME}, and re-run \`sudo dpkg-reconfigure hex-zero\` Using the following command would work." + echo " sudo su ${USERNAME} -c 'pip3 install --user short_url'" + else + echo "Initializing sqlite database for hex-zero" + su ${USERNAME} -c 'cd /var/www/hex-zero ; /var/www/hex-zero/hex_zero.py db init' 2>/dev/null || : + su ${USERNAME} -c 'cd /var/www/hex-zero ; /var/www/hex-zero/hex_zero.py db upgrade' + fi + fi ;; abort-upgrade|abort-remove|abort-deconfigure) |