Skip to content

Commit 2d3a8c6

Browse files
committed
✨ Put custom domain update behind a flag
1 parent 1a8a30c commit 2d3a8c6

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

roles/simplelogin/defaults/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
simplelogin_enabled: false
33
simplelogin_available_externally: false
44
simplelogin_enable_subscription: false
5+
simplelogin_add_builtin_domain_as_custom_domain: false
56

67
# directories
78
simplelogin_data_directory: "{{ docker_home }}/simplelogin"

roles/simplelogin/tasks/main.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,16 @@
211211
container: "{{ simplelogin_postgres_container_name }}"
212212
command: psql -U {{ simplelogin_postgres_username }} {{ simplelogin_postgres_database }} -c "UPDATE users SET lifetime = TRUE;"
213213
tags: molecule-idempotence-notest
214-
215-
# - name: Add built-in domain as custom domain (to use catch-all)
216-
# community.docker.docker_container_exec:
217-
# container: "{{ simplelogin_postgres_container_name }}"
218-
# command: psql -U {{ simplelogin_postgres_username }} {{ simplelogin_postgres_database }} -c "INSERT INTO custom_domain (created_at,user_id,domain,verified) VALUES (NOW(),1,'{{ simplelogin_email_domain }}',FALSE);"
219-
# tags: molecule-idempotence-notest
220214
when: simplelogin_enable_subscription is true
215+
216+
- name: Add built-in domain as custom domain
217+
block:
218+
- name: Add built-in domain as custom domain (to use catch-all)
219+
community.docker.docker_container_exec:
220+
container: "{{ simplelogin_postgres_container_name }}"
221+
command: psql -U {{ simplelogin_postgres_username }} {{ simplelogin_postgres_database }} -c "INSERT INTO custom_domain (created_at,user_id,domain,verified) VALUES (NOW(),1,'{{ simplelogin_email_domain }}',FALSE);"
222+
tags: molecule-idempotence-notest
223+
when: simplelogin_add_builtin_domain_as_custom_domain is true
221224
when: simplelogin_enabled is true
222225

223226
- name: Stop Simplelogin

website/docs/applications/other/simplelogin.md

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ Simplelogin web interface can be found at [http://ansible_nas_host_or_ip:7779](h
2020
After logging in, click `Sign Up` and register the account. If everything is correctly configured, you should receive an email from the system.
2121

2222
After the user is created, set `simplelogin_enable_subscription` to `true` and run the playbook again to enable premium features.
23+
24+
Optionally, if you want to use your built-in (configured) domain as custom domain with catch-all functionality, set `simplelogin_add_builtin_domain_as_custom_domain` to `true` and run the playbook again.

0 commit comments

Comments
 (0)