Initial commit
This commit is contained in:
9
debscripts/conffiles
Normal file
9
debscripts/conffiles
Normal file
@@ -0,0 +1,9 @@
|
||||
/usr/bin/url-shortener
|
||||
/etc/nginx/conf.d/url-shortener-servers.conf
|
||||
/etc/nginx/snippets/url-shortener-server-snippet.conf
|
||||
/etc/systemd/system/url-shortener-gui.service
|
||||
/etc/url-shortener/conf.sh
|
||||
/etc/url-shortener/uwsgi.ini
|
||||
/etc/cron.d/url-shortener-restart-nginx
|
||||
/etc/cron.d/url-shortener-update
|
||||
/etc/logrotate.d/url-shortener
|
||||
39
debscripts/postinst
Executable file
39
debscripts/postinst
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
base=/var/cache/url-shortener
|
||||
|
||||
[[ -f /etc/url-shortener/conf.sh ]] && . /etc/url-shortener/conf.sh
|
||||
[[ -z "$URL_SHORTENER_CACHE_BASE" ]] && base=$URL_SHORTENER_CACHE_BASE
|
||||
|
||||
mkdir -p /var/log/url-shortener
|
||||
chmod 777 /var/log/url-shortener
|
||||
|
||||
# look for installed sites
|
||||
if [[ -z "$(find $base -maxdepth 2 -type f -name 'server.conf')" ]]; then
|
||||
read -p "$(echo -e "\e[0;31mInstall a Default Site? [Y,n]: \e[0m")" defgen
|
||||
if [[ ! "$defgen" =~ n|N ]]; then
|
||||
/usr/bin/url-shortener create-host default
|
||||
fi
|
||||
fi
|
||||
|
||||
installdir=/usr/share/url-shortener
|
||||
py=./venv/bin/python3
|
||||
pip="$py -mpip"
|
||||
|
||||
cd $installdir
|
||||
if [[ ! -f $py ]]; then
|
||||
rm -rf venv
|
||||
python3 -mvenv venv
|
||||
cd -
|
||||
fi
|
||||
if ! $pip freeze | grep -qi flask; then
|
||||
$pip install -r requirements.txt
|
||||
fi
|
||||
cd -
|
||||
systemctl daemon-reload
|
||||
systemctl enable url-shortener-gui.service
|
||||
systemctl restart url-shortener-gui.service || echo "Could not restart"
|
||||
nginx -t && systemctl restart nginx
|
||||
exit 0
|
||||
|
||||
2
debscripts/postrm
Executable file
2
debscripts/postrm
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
exit 0
|
||||
2
debscripts/preinst
Executable file
2
debscripts/preinst
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
exit 0
|
||||
4
debscripts/prerm
Executable file
4
debscripts/prerm
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
systemctl stop url-shortener-gui.service
|
||||
systemctl disable url-shortener-gui.service
|
||||
exit 0
|
||||
7
debscripts/src-to-builddir
Normal file
7
debscripts/src-to-builddir
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
rsync -av --exclude venv \
|
||||
--exclude __pycyche__ \
|
||||
--exclude '*.pyc' \
|
||||
--exclude node_modules \
|
||||
src/* \
|
||||
"${INSTALL_DIR}"
|
||||
Reference in New Issue
Block a user