Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master proxy-enable-https: 409 add domain as param #410

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ This is done by certbot.
In order for this state to run successfully, it is important that the proxy is already accessible from the Internet and the DNS entries are set.
To execute the state you have to log in to the salt master using `doil salt:login`. The following command is then executed there:
```bash
salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{"email": "<your_email>"}'
salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{"email": "<your_email>", "domain": "<your_domain>"}'
```
If the state has run successfully, the current status of the proxy still needs to be committed. To do this, leave the
salt master again with `ctrl-d` and execute the following command:
Expand Down
7 changes: 4 additions & 3 deletions setup/stack/states/proxy-enable-https/https/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This state must be executed on the salt master. The following command is used for this.
# Please note that you must provide your email address.
#
# salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{"email": "<your_email>"}'
# salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{"email": "<your_email>", "domain" = "<your_domain>"}'
#
# After applying the state, it is important that you commit the new proxy status to the docker image on the docker host.
# To do this, run the following command on the Docker host.
Expand All @@ -14,6 +14,7 @@
# so https take effect in ILIAS.

{% set email = salt['pillar.get']('email', '') %}
{% set domain = salt['pillar.get']('domain', '') %}

{% if email != "" %}
https_packages:
Expand All @@ -25,7 +26,7 @@ https_packages:

install_cert:
cmd.run:
- name: certbot -n --nginx --agree-tos --email {{ email }}
- name: certbot -n --nginx --agree-tos --email {{ email }} --domains {{ domain }}
- runas: root

cert_renew_by_cron:
Expand All @@ -36,6 +37,6 @@ cert_renew_by_cron:
{% else %}
custom_raise:
test.fail_without_changes:
- msg: "Missing email! Please use this command: salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{\"email\": \"<your_email>\"}'"
- msg: "Missing email! Please use this command: salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{\"email\": \"<your_email>\", \"domain\": \"<your_domain>\"}'"
- failhard: True
{% endif %}
Loading