♻: move roundcube app dir

This commit is contained in:
VC
2025-03-09 13:41:00 +01:00
parent c266e0f4fe
commit a86577d5c1
4 changed files with 25 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
server { server {
{% include './templates/header.conf.j2' %} {% include './templates/header.conf.j2' %}
root /srv/http/mail.libertus.eu/; root /var/www/mail.libertus.eu/;
index index.html index.htm index.php; index index.html index.htm index.php;
client_max_body_size 512M; client_max_body_size 512M;

View File

@@ -1,9 +1,14 @@
--- ---
## Remove previous app & install new version
- name: Remove roundcube previous version
ansible.builtin.file:
state: absent
dest: "{{ roundcube_app_home }}"
- name: Create application directory - name: Create application directory
ansible.builtin.file: ansible.builtin.file:
state: directory state: directory
dest: "{{ roundcube_home }}" dest: "{{ roundcube_app_home }}"
owner: "root" owner: "root"
group: "www-data" group: "www-data"
mode: "0o750" mode: "0o750"
@@ -12,13 +17,11 @@
ansible.builtin.unarchive: ansible.builtin.unarchive:
remote_src: true remote_src: true
src: "{{ roundcube_url }}" src: "{{ roundcube_url }}"
dest: "{{ roundcube_home }}" dest: "{{ roundcube_app_home }}"
owner: root owner: root
group: www-data group: www-data
mode: "a-rwx,u+rwX,g+rX" mode: "a-rwx,u+rwX,g+rX"
extra_opts: ['--strip-components=1'] extra_opts: ['--strip-components=1']
exclude:
- "{{ roundcube_config_path }}"
- name: Put roundcube configuration - name: Put roundcube configuration
ansible.builtin.template: ansible.builtin.template:
@@ -32,10 +35,8 @@
ansible.builtin.file: ansible.builtin.file:
state: directory state: directory
recurse: true recurse: true
dest: "{{ roundcube_home }}/{{ item }}" dest: "{{ roundcube_app_home }}/{{ item }}"
owner: root owner: root
group: www-data group: www-data
mode: "g+w" mode: "g+w"
loop: loop: "{{ roundcube_writable_app_dirs }}"
- "logs"
- "temp"

View File

@@ -1,10 +1,15 @@
--- ---
- name: Remove carddav plugin
ansible.builtin.file:
state: absent
dest: "{{ roundcube_app_home }}/plugins/carddav"
- name: Unzip carddav plugin - name: Unzip carddav plugin
ansible.builtin.unarchive: ansible.builtin.unarchive:
remote_src: true remote_src: true
src: "{{ roundcube_carddav_url }}" src: "{{ roundcube_carddav_url }}"
dest: "{{ roundcube_home }}/plugins" dest: "{{ roundcube_app_home }}/plugins"
owner: root owner: root
group: www-data group: www-data
mode: "a-rwx,u+rwX,g+rX" mode: "a-rwx,u+rwX,g+rX"
@@ -12,7 +17,7 @@
- name: Put carddav config file - name: Put carddav config file
ansible.builtin.template: ansible.builtin.template:
src: "carddav.config.inc.php.j2" src: "carddav.config.inc.php.j2"
dest: "{{ roundcube_home }}/plugins/carddav/config.inc.php" dest: "{{ roundcube_app_home }}/plugins/carddav/config.inc.php"
owner: root owner: root
group: www-data group: www-data
mode: "0o640" mode: "0o640"

View File

@@ -7,9 +7,15 @@ roundcube_url: "https://github.com/roundcube/roundcubemail/releases/download/{{
# only the first occurence is supported # only the first occurence is supported
roundcube_access_url: "{{ web_hostname | selectattr('type', 'defined') | selectattr('type', '==', 'roundcube') | map(attribute='host') | first }}" roundcube_access_url: "{{ web_hostname | selectattr('type', 'defined') | selectattr('type', '==', 'roundcube') | map(attribute='host') | first }}"
roundcube_home: "/srv/http/{{ roundcube_access_url }}" roundcube_app_home: "/var/www/{{ roundcube_access_url }}"
roundcube_config_path: "{{ roundcube_home }}/config/config.inc.php" roundcube_config_path: "{{ roundcube_app_home }}/config/config.inc.php"
# App dirs
roundcube_writable_app_dirs:
- logs
- temp
# CardDAV extension
roundcube_carddav_version: "5.1.0" roundcube_carddav_version: "5.1.0"
roundcube_carddav_url: "https://github.com/mstilkerich/rcmcarddav/releases/download/v{{ roundcube_carddav_version }}/carddav-v{{ roundcube_carddav_version }}.tar.gz" roundcube_carddav_url: "https://github.com/mstilkerich/rcmcarddav/releases/download/v{{ roundcube_carddav_version }}/carddav-v{{ roundcube_carddav_version }}.tar.gz"
roundcube_carddav_discovery_url: "{{ web_hostname | selectattr('type', 'defined') | selectattr('type', '==', 'nextcloud') | map(attribute='host') | first }}" roundcube_carddav_discovery_url: "{{ web_hostname | selectattr('type', 'defined') | selectattr('type', '==', 'nextcloud') | map(attribute='host') | first }}"