-
-
Notifications
You must be signed in to change notification settings - Fork 59
feat: starttls #558
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
Open
JacobCoffee
wants to merge
16
commits into
main
Choose a base branch
from
add-starttls
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: starttls #558
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1db665f
feat: starttls
JacobCoffee e655530
(broken) auto lets encrypt via acme state
JacobCoffee 65dd645
(broken) correct commited result
JacobCoffee 0dbf3ca
correct commited result again
JacobCoffee 0aefff2
properly install PSF_CA certificate so certbot can use it
ewdurbin 10a5006
uncomment working parts
JacobCoffee 98dc839
stuff acme certs into appropriate pillar data
JacobCoffee ca751e4
feat: move acme stuff into pillar data
JacobCoffee 50e70e7
fix: less suck, more good
JacobCoffee 4d172e7
docs: explain a little
JacobCoffee 536578a
fix: just one bugs section
JacobCoffee 43ab883
fix: requires proper name to not break
JacobCoffee fa30753
feat: install certs alongside other certs.
JacobCoffee 4d250dd
feat: read actual cert instead of config..
JacobCoffee bcb7bf6
chore: lint
JacobCoffee f2ab9c1
chore: lint again
JacobCoffee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
include: | ||
- .pebble | ||
- .lego | ||
|
||
ssl-cert: | ||
pkg.installed | ||
|
||
certbot: | ||
pkg.installed | ||
|
||
{% for name in salt["pillar.get"]("tls:ca", {}) %} # " Syntax Hack | ||
/etc/ssl/certs/{{ name }}.pem: | ||
|
@@ -11,8 +17,21 @@ ssl-cert: | |
- mode: "0644" | ||
- require: | ||
- pkg: ssl-cert | ||
|
||
/usr/local/share/ca-certificates/{{ name }}.crt: | ||
file.managed: | ||
- contents_pillar: tls:ca:{{ name }} | ||
- user: root | ||
- group: ssl-cert | ||
- mode: "0644" | ||
- require: | ||
- pkg: ssl-cert | ||
{% endfor %} | ||
|
||
/usr/sbin/update-ca-certificates: | ||
cmd.run: | ||
- onchanges: | ||
- file: /usr/local/share/ca-certificates/*.crt | ||
|
||
{% for name in salt["pillar.get"]("tls:certs", {}) %} # " Syntax Hack | ||
/etc/ssl/private/{{ name }}.pem: | ||
|
@@ -25,3 +44,44 @@ ssl-cert: | |
- require: | ||
- pkg: ssl-cert | ||
{% endfor %} | ||
|
||
# Install acme.cert certs prepended with acme-* to avoic conflicts | ||
{% for name in salt["pillar.get"]("tls:acme_certs", {}) %} | ||
/etc/ssl/private/acme-{{ name }}.pem: | ||
file.managed: | ||
- contents_pillar: tls:acme_certs:{{ name }} | ||
- user: root | ||
- group: ssl-cert | ||
- mode: "0640" | ||
- show_diff: False | ||
- require: | ||
- pkg: ssl-cert | ||
{% endfor %} | ||
|
||
{% if salt["match.compound"](pillar["roles"]["salt-master"]["pattern"]) %} | ||
# Process ACME certificates | ||
{% for domain, domain_config in salt["pillar.get"]("tls:acme_certs", {}).items() %} | ||
{{ domain }}: | ||
acme.cert: | ||
- email: [email protected] | ||
- webroot: /etc/lego | ||
- renew: 14 | ||
{% if domain_config.get('aliases') %} | ||
- aliases: | ||
{% for alias in domain_config.get('aliases', []) %} | ||
- {{ alias }} | ||
{% endfor %} | ||
{% endif %} | ||
{% if pillar["dc"] == "vagrant" %} | ||
- server: https://salt-master.vagrant.psf.io:14000/dir | ||
ewdurbin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{% endif %} | ||
{% if domain_config.get('validation') == "dns" %} | ||
- dns_plugin: {{ domain_config.get('dns_plugin') }} | ||
- dns_plugin_credentials: {{ domain_config.get('dns_plugin_credentials') }} | ||
{% else %} | ||
- require: | ||
- sls: tls.lego | ||
- pkg: certbot | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.