From d9c3577389576c87d4064fdcdc2e79f2773dc760 Mon Sep 17 00:00:00 2001 From: eniad Date: Sun, 28 Feb 2021 12:29:08 -0500 Subject: [PATCH 1/4] add dokuwiki --- README.md | 1 + docs/applications/dokuwiki.md | 11 +++++++++++ docs/configuration/application_ports.md | 1 + group_vars/all.yml | 11 +++++++++++ nas.yml | 4 ++++ tasks/dokuwiki.yml | 26 +++++++++++++++++++++++++ 6 files changed, 54 insertions(+) create mode 100644 docs/applications/dokuwiki.md create mode 100644 tasks/dokuwiki.yml diff --git a/README.md b/README.md index 39fbd593..d4a6a664 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Ansible config and a bunch of Docker containers. * [Cloudflare DDNS](https://hub.docker.com/r/joshuaavalon/cloudflare-ddns/) - automatically update Cloudflare with your IP address * [CouchPotato](https://couchpota.to/) - for downloading and managing movies * [Deluge](https://dev.deluge-torrent.org/) - A lightweight, Free Software, cross-platform BitTorrent client. +* [DokuWiki](https://www.dokuwiki.org/) - A simple to use and highly versatile Open Source wiki software that doesn't require a database. * [Duplicati](https://www.duplicati.com/) - for backing up your stuff * [Emby](https://emby.media/) - Media streaming and management * [Firefly III](https://firefly-iii.org/) - Free and open source personal finance manager diff --git a/docs/applications/dokuwiki.md b/docs/applications/dokuwiki.md new file mode 100644 index 00000000..413ef934 --- /dev/null +++ b/docs/applications/dokuwiki.md @@ -0,0 +1,11 @@ +# DokuWiki + +Homepage: [https://www.dokuwiki.org/](https://www.dokuwiki.org/) + +DokuWiki is a simple to use and highly versatile Open Source wiki software that doesn't require a database. It is loved by users for its clean and readable syntax. The ease of maintenance, backup and integration makes it an administrator's favorite. Built in access controls and authentication connectors make DokuWiki especially useful in the enterprise context and the large number of plugins contributed by its vibrant community allow for a broad range of use cases beyond a traditional wiki. + +## Usage + +Set `dokuwiki_enabled: true` in your `inventories//nas.yml` file. + +The DokuWiki web interface can be found at http://ansible_nas_host_or_ip:8085. diff --git a/docs/configuration/application_ports.md b/docs/configuration/application_ports.md index 4579588f..2944a814 100644 --- a/docs/configuration/application_ports.md +++ b/docs/configuration/application_ports.md @@ -11,6 +11,7 @@ By default, applications can be found on the ports listed below. | Calibre-web | 8084 | Bridge | HTTP | | Cloud Commander | 7373 | Bridge | HTTP | | Couchpotato | 5050 | Bridge | HTTP | +| DokuWiki | 8085 | Bridge | HTTP | | Duplicati | 8200 | Bridge | HTTP | | Emby | 8096 | Bridge | HTTP | | Emby | 8096 | Bridge | HTTP | diff --git a/group_vars/all.yml b/group_vars/all.yml index 0bf86631..aec56342 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -51,6 +51,9 @@ ubooquity_enabled: false # Joomla joomla_enabled: false +# Wiki +dokuwiki_enabled: false + # PyTivo pytivo_enabled: false @@ -303,6 +306,14 @@ guacamole_available_externally: "false" guacamole_data_directory: "{{ docker_home }}/guacamole" guacamole_port: "8090" +### +### DokuWiki +### +dokuwiki_available_externally: "false" +dokuwiki_hostname: "dokuwiki" +dokuwiki_data_directory: "{{ docker_home }}/dokuwiki" +dokuwiki_port: "8085" + ### ### Krusader ### diff --git a/nas.yml b/nas.yml index 9765d3ca..ebba3ab2 100644 --- a/nas.yml +++ b/nas.yml @@ -332,3 +332,7 @@ - import_tasks: tasks/pytivo.yml when: (pytivo_enabled | default(False)) tags: pytivo + + - import_tasks: tasks/dokuwiki.yml + when: (dokuwiki_enabled | default(False)) + tags: dokuwiki diff --git a/tasks/dokuwiki.yml b/tasks/dokuwiki.yml new file mode 100644 index 00000000..b5bedc8a --- /dev/null +++ b/tasks/dokuwiki.yml @@ -0,0 +1,26 @@ +--- +- name: Create DokuWiki Directories + file: + path: "{{ item }}" + state: directory + with_items: + - "{{ dokuwiki_data_directory }}/data" + +- name: DokuWiki Docker Container + docker_container: + name: dokuwiki + image: linuxserver/dokuwiki:latest + pull: true + volumes: + - "{{ dokuwiki_data_directory }}:/config/dokuwiki/data:rw" + ports: + - "{{ dokuwiki_port }}:80" + restart_policy: unless-stopped + memory: 1g + labels: + traefik.enable: "{{ dokuwiki_available_externally }}" + traefik.http.routers.dokuwiki.rule: "Host(`{{ dokuwiki_hostname }}.{{ ansible_nas_domain }}`)" + traefik.http.routers.dokuwiki.tls.certresolver: "letsencrypt" + traefik.http.routers.dokuwiki.tls.domains[0].main: "{{ ansible_nas_domain }}" + traefik.http.routers.dokuwiki.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" + traefik.http.services.dokuwiki.loadbalancer.server.port: "{{ dokuwiki_port }}" From e3ba8a491d4949f6ead36b5580a2c498423de47a Mon Sep 17 00:00:00 2001 From: eniad Date: Sun, 28 Feb 2021 15:01:33 -0500 Subject: [PATCH 2/4] convert dokuwiki to new role format --- group_vars/all.yml | 11 ----------- nas.yml | 9 +++++---- roles/dokuwiki/defaults/main.yml | 10 ++++++++++ tasks/dokuwiki.yml => roles/dokuwiki/tasks/main.yml | 0 4 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 roles/dokuwiki/defaults/main.yml rename tasks/dokuwiki.yml => roles/dokuwiki/tasks/main.yml (100%) diff --git a/group_vars/all.yml b/group_vars/all.yml index aec56342..0bf86631 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -51,9 +51,6 @@ ubooquity_enabled: false # Joomla joomla_enabled: false -# Wiki -dokuwiki_enabled: false - # PyTivo pytivo_enabled: false @@ -306,14 +303,6 @@ guacamole_available_externally: "false" guacamole_data_directory: "{{ docker_home }}/guacamole" guacamole_port: "8090" -### -### DokuWiki -### -dokuwiki_available_externally: "false" -dokuwiki_hostname: "dokuwiki" -dokuwiki_data_directory: "{{ docker_home }}/dokuwiki" -dokuwiki_port: "8085" - ### ### Krusader ### diff --git a/nas.yml b/nas.yml index ebba3ab2..c4427f66 100644 --- a/nas.yml +++ b/nas.yml @@ -268,6 +268,11 @@ - znc when: (znc_enabled | default(False)) + - role: dokuwiki + tags: + - dokuwiki + when: (dokuwiki_enabled | default(False)) + tasks: - import_tasks: tasks/thelounge.yml when: (thelounge_enabled | default(False)) @@ -332,7 +337,3 @@ - import_tasks: tasks/pytivo.yml when: (pytivo_enabled | default(False)) tags: pytivo - - - import_tasks: tasks/dokuwiki.yml - when: (dokuwiki_enabled | default(False)) - tags: dokuwiki diff --git a/roles/dokuwiki/defaults/main.yml b/roles/dokuwiki/defaults/main.yml new file mode 100644 index 00000000..2451c92c --- /dev/null +++ b/roles/dokuwiki/defaults/main.yml @@ -0,0 +1,10 @@ +--- +dokuwiki_enabled: false +dokuwiki_available_externally: "false" + +# directories +dokuwiki_data_directory: "{{ docker_home }}/dokuwiki" + +# network +dokuwiki_hostname: "dokuwiki" +dokuwiki_port: "8085" diff --git a/tasks/dokuwiki.yml b/roles/dokuwiki/tasks/main.yml similarity index 100% rename from tasks/dokuwiki.yml rename to roles/dokuwiki/tasks/main.yml From 1ef43df88dce4a73d8eb5e4c72a19e078cc35251 Mon Sep 17 00:00:00 2001 From: eniad Date: Sun, 28 Feb 2021 16:16:20 -0500 Subject: [PATCH 3/4] update dokuwiki config and variables fix container port make memory configurable set uid/gid --- roles/dokuwiki/defaults/main.yml | 7 +++++++ roles/dokuwiki/tasks/main.yml | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/roles/dokuwiki/defaults/main.yml b/roles/dokuwiki/defaults/main.yml index 2451c92c..22917a50 100644 --- a/roles/dokuwiki/defaults/main.yml +++ b/roles/dokuwiki/defaults/main.yml @@ -5,6 +5,13 @@ dokuwiki_available_externally: "false" # directories dokuwiki_data_directory: "{{ docker_home }}/dokuwiki" +# uid / gid +dokuwiki_user_id: "1000" +dokuwiki_group_id: "1000" + # network dokuwiki_hostname: "dokuwiki" dokuwiki_port: "8085" + +# specs +dokuwiki_memory: 1g \ No newline at end of file diff --git a/roles/dokuwiki/tasks/main.yml b/roles/dokuwiki/tasks/main.yml index b5bedc8a..6e789f69 100644 --- a/roles/dokuwiki/tasks/main.yml +++ b/roles/dokuwiki/tasks/main.yml @@ -15,12 +15,16 @@ - "{{ dokuwiki_data_directory }}:/config/dokuwiki/data:rw" ports: - "{{ dokuwiki_port }}:80" + env: + TZ: "{{ ansible_nas_timezone }}" + PUID: "{{ dokuwiki_user_id }}" + PGID: "{{ dokuwiki_group_id }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ dokuwiki_memory }}" labels: traefik.enable: "{{ dokuwiki_available_externally }}" traefik.http.routers.dokuwiki.rule: "Host(`{{ dokuwiki_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.dokuwiki.tls.certresolver: "letsencrypt" traefik.http.routers.dokuwiki.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.dokuwiki.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" - traefik.http.services.dokuwiki.loadbalancer.server.port: "{{ dokuwiki_port }}" + traefik.http.services.dokuwiki.loadbalancer.server.port: "80" From c889d00e5af7c17d7b87993dab37e7a4bede689c Mon Sep 17 00:00:00 2001 From: eniad Date: Sun, 28 Feb 2021 16:19:36 -0500 Subject: [PATCH 4/4] fix linting issue --- roles/dokuwiki/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/dokuwiki/defaults/main.yml b/roles/dokuwiki/defaults/main.yml index 22917a50..3cad17fb 100644 --- a/roles/dokuwiki/defaults/main.yml +++ b/roles/dokuwiki/defaults/main.yml @@ -14,4 +14,4 @@ dokuwiki_hostname: "dokuwiki" dokuwiki_port: "8085" # specs -dokuwiki_memory: 1g \ No newline at end of file +dokuwiki_memory: 1g