summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2024-11-01 17:37:56 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2024-11-01 17:37:56 +0100
commit936e4036876048a25d3b64a53ffd3c7af16b73b8 (patch)
tree91253b18e917739e74c9e87585004657e429ff55
parent38dc1cde0d8ff6c52c39ec71be14a98946f04bad (diff)
bump version; update unit file and deployment script
-rw-r--r--depoly.yml12
-rw-r--r--script/jwebmail.service.in19
-rw-r--r--src/jwebmail/__init__.py2
3 files changed, 23 insertions, 10 deletions
diff --git a/depoly.yml b/depoly.yml
index e55d2bb..684f593 100644
--- a/depoly.yml
+++ b/depoly.yml
@@ -3,7 +3,7 @@
vars:
wheels: "{{ lookup('ansible.builtin.fileglob', 'dist/*.whl', wantlist=True)|map('basename') }}"
- latest_version: "{{ wheels|map('split', '-')|map(attribute='1')|community.general.version_sort|last }}"
+ latest_version: "{{ wheels|map('split', '-')|map(attribute=1)|community.general.version_sort|last }}"
tasks:
- name: Info
@@ -13,10 +13,13 @@
ansible.builtin.copy:
src: "dist/jwebmail-{{ latest_version }}-py3-none-any.whl"
dest: "jwebmail-{{ latest_version }}-py3-none-any.whl"
+ register: new_version
- name: Update
ansible.builtin.pip:
- extra_args: "--target /usr/local/jwebmail --upgrade"
- name: "file:///home/jannis/jwebmail-{{ latest_version }}-py3-none-any.whl"
+ name:
+ - "file:///home/{{ ansible_facts.user_id }}/jwebmail-{{ latest_version }}-py3-none-any.whl"
+ - "toml"
+ virtualenv: "/usr/local/jwebmail"
become: true
- name: Scripts
ansible.builtin.copy:
@@ -26,7 +29,7 @@
become: true
- name: Extract
ansible.builtin.copy:
- src: "script/extract"
+ src: "script/extract-release"
dest: "/usr/local/bin/jwebmail-extract"
mode: "0755"
become: true
@@ -35,3 +38,4 @@
name: jwebmail
state: restarted
become: true
+ when: new_version is changed
diff --git a/script/jwebmail.service.in b/script/jwebmail.service.in
index 2be6e5d..d080738 100644
--- a/script/jwebmail.service.in
+++ b/script/jwebmail.service.in
@@ -1,16 +1,25 @@
[Unit]
Description=JWebmail managed by gunicorn
-After=network.target
+After=network-online.target
Requires=redis.service
[Service]
-Type=exec
-User=jmhoffmann
-Environment=JWEBMAIL_CONFIG="/@PREFIX@/jwebmail.toml"
-ExecStart=@PROJECT_PATH@/.venv/bin/gunicorn -b :5000 -w 4 --pythonpath "@PROJECT_PATH@/src/" -n jwebmail 'jwebmail:create_app()'
+Type=simple
+User=jwebmail
+RuntimeDirectory=jwebmail
+Environment=JWEBMAIL_CONFIG="@CONFDIR@/jwebmail.toml"
+ExecStart=@BINDIR@/gunicorn -b unix:%t/jwebmail/jwebmail.socket -w 4 -n jwebmail 'jwebmail:create_app()'
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
+PrivateTmp=yes
+ProtectSystem=full
+ProtectProc=invisible
+ProtectControlGroups=yes
+
+KeyringMode=private
+RemoveIPC=yes
+
[Install]
WantedBy=multi-user.target
diff --git a/src/jwebmail/__init__.py b/src/jwebmail/__init__.py
index 51df9d9..c3239c8 100644
--- a/src/jwebmail/__init__.py
+++ b/src/jwebmail/__init__.py
@@ -36,7 +36,7 @@ else:
toml_read_file = dict(load=toml_load, text=True)
-__version__ = "2.2.1.dev6"
+__version__ = "2.2.1.dev7"
csrf = CSRFProtect()