Skip to content

Commit

Permalink
✨ Put custom domain update behind a flag
Browse files Browse the repository at this point in the history
  • Loading branch information
anarion80 committed Oct 6, 2024
1 parent 1a8a30c commit 2d3a8c6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions roles/simplelogin/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
simplelogin_enabled: false
simplelogin_available_externally: false
simplelogin_enable_subscription: false
simplelogin_add_builtin_domain_as_custom_domain: false

# directories
simplelogin_data_directory: "{{ docker_home }}/simplelogin"
Expand Down
15 changes: 9 additions & 6 deletions roles/simplelogin/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,16 @@
container: "{{ simplelogin_postgres_container_name }}"
command: psql -U {{ simplelogin_postgres_username }} {{ simplelogin_postgres_database }} -c "UPDATE users SET lifetime = TRUE;"
tags: molecule-idempotence-notest

# - name: Add built-in domain as custom domain (to use catch-all)
# community.docker.docker_container_exec:
# container: "{{ simplelogin_postgres_container_name }}"
# 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);"
# tags: molecule-idempotence-notest
when: simplelogin_enable_subscription is true

- name: Add built-in domain as custom domain
block:
- name: Add built-in domain as custom domain (to use catch-all)
community.docker.docker_container_exec:
container: "{{ simplelogin_postgres_container_name }}"
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);"
tags: molecule-idempotence-notest
when: simplelogin_add_builtin_domain_as_custom_domain is true
when: simplelogin_enabled is true

- name: Stop Simplelogin
Expand Down
2 changes: 2 additions & 0 deletions website/docs/applications/other/simplelogin.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ Simplelogin web interface can be found at [http://ansible_nas_host_or_ip:7779](h
After logging in, click `Sign Up` and register the account. If everything is correctly configured, you should receive an email from the system.

After the user is created, set `simplelogin_enable_subscription` to `true` and run the playbook again to enable premium features.

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 comments on commit 2d3a8c6

Please sign in to comment.