diff --git a/conf/custom.py.in b/conf/custom.py.in new file mode 100644 index 00000000..05e36dec --- /dev/null +++ b/conf/custom.py.in @@ -0,0 +1,2 @@ +# Custom settings +TIMEOUT = ${TIMEOUT} \ No newline at end of file diff --git a/conf/env.in b/conf/env.in index 916d35e5..7982691f 100644 --- a/conf/env.in +++ b/conf/env.in @@ -1 +1 @@ -TIMEOUT="${TIMEOUT}" +TIMEOUT=${TIMEOUT} diff --git a/debian/conffiles b/debian/conffiles index 2f9dbf53..0ef7d9ef 100644 --- a/debian/conffiles +++ b/debian/conffiles @@ -1,2 +1,3 @@ +opt/screamshotter/conf/custom.py.in opt/screamshotter/conf/env.in opt/screamshotter/conf/gunicorn-screamshotter.conf.py.in diff --git a/debian/install b/debian/install index fb98e434..e0923ba1 100644 --- a/debian/install +++ b/debian/install @@ -1,2 +1,3 @@ +conf/custom.py.in opt/screamshotter/conf conf/env.in opt/screamshotter/conf conf/gunicorn-screamshotter.conf.py.in opt/screamshotter/conf \ No newline at end of file diff --git a/debian/postinst b/debian/postinst index 7b52d422..604ec4b9 100644 --- a/debian/postinst +++ b/debian/postinst @@ -19,10 +19,8 @@ chown -R screamshotter:screamshotter /opt/screamshotter/static || true # Generate config files echo "Generate configuration" >&2 -[ -f /opt/screamshotter/conf/custom.py ] || touch /opt/screamshotter/conf/custom.py -sed -i "s/TIMEOUT\s*=\s*[0-9]\+/TIMEOUT = "$TIMEOUT"/" /opt/screamshotter/conf/custom.py CONF_DIR=/opt/screamshotter/conf -for f in env gunicorn-screamshotter.conf.py; do +for f in custom.py env gunicorn-screamshotter.conf.py; do cat > $CONF_DIR/$f << END # Generated by dpkg installation. DO NOT MODIFY MANUALLY.