|
23 | 23 | formfactor = "server";
|
24 | 24 |
|
25 | 25 | networking.firewall.allowedTCPPorts = [
|
26 |
| - 443 # Nginx |
| 26 | + 443 # Nginx |
27 | 27 | # 1880 # Node-RED
|
28 | 28 | 1883 # Mosquitto
|
29 | 29 | # 3000 # Grafana
|
|
59 | 59 |
|
60 | 60 | services.authentik.environmentFile = config.age.secrets.authentik-env.path;
|
61 | 61 |
|
62 |
| - services.authentik.blueprints = [{ |
63 |
| - metadata.name = "grafana-oauth"; |
64 |
| - entries = [ |
65 |
| - { |
66 |
| - model = "authentik_providers_oauth2.oauth2provider"; |
67 |
| - state = "present"; |
68 |
| - identifiers.name = "Grafana"; |
69 |
| - id = "provider"; |
70 |
| - attrs = { |
71 |
| - authentication_flow = "!Find [authentik_flows.flow, [slug, default-authentication-flow]]"; |
72 |
| - authorization_flow = "!Find [authentik_flows.flow, [slug, default-provider-authorization-explicit-consent]]"; |
73 |
| - client_type = "confidential"; |
74 |
| - client_id = "grafana"; |
75 |
| - client_secret = "secret"; |
76 |
| - access_code_validity = "minutes=1"; |
77 |
| - access_token_validity = "minutes=5"; |
78 |
| - refresh_token_validity = "days=30"; |
79 |
| - property_mappings = [ |
80 |
| - "!Find [authentik_providers_oauth2.scopemapping, [scope_name, openid]]" |
81 |
| - "!Find [authentik_providers_oauth2.scopemapping, [scope_name, email]]" |
82 |
| - "!Find [authentik_providers_oauth2.scopemapping, [scope_name, profile]]" |
83 |
| - "!Find [authentik_providers_oauth2.scopemapping, [scope_name, offline_access]]" |
84 |
| - ]; |
85 |
| - sub_mode = "hashed_user_id"; |
86 |
| - include_claims_in_id_token = true; |
87 |
| - issuer_mode = "per_provider"; |
88 |
| - }; |
89 |
| - } |
90 |
| - { |
91 |
| - model = "authentik_core.application"; |
92 |
| - state = "present"; |
93 |
| - identifiers.slug = "grafana"; |
94 |
| - id = "grafana"; |
95 |
| - attrs = { |
96 |
| - name = "Grafana"; |
97 |
| - provider = "!KeyOf provider"; |
98 |
| - policy_engine_mode = "any"; |
99 |
| - }; |
100 |
| - } |
101 |
| - ]; |
102 |
| - }]; |
| 62 | + services.authentik.blueprints = [ |
| 63 | + { |
| 64 | + metadata.name = "grafana-oauth"; |
| 65 | + entries = [ |
| 66 | + { |
| 67 | + model = "authentik_providers_oauth2.oauth2provider"; |
| 68 | + state = "present"; |
| 69 | + identifiers.name = "Grafana"; |
| 70 | + id = "provider"; |
| 71 | + attrs = { |
| 72 | + authentication_flow = "!Find [authentik_flows.flow, [slug, default-authentication-flow]]"; |
| 73 | + authorization_flow = "!Find [authentik_flows.flow, [slug, default-provider-authorization-explicit-consent]]"; |
| 74 | + client_type = "confidential"; |
| 75 | + client_id = "grafana"; |
| 76 | + client_secret = "secret"; |
| 77 | + access_code_validity = "minutes=1"; |
| 78 | + access_token_validity = "minutes=5"; |
| 79 | + refresh_token_validity = "days=30"; |
| 80 | + property_mappings = [ |
| 81 | + "!Find [authentik_providers_oauth2.scopemapping, [scope_name, openid]]" |
| 82 | + "!Find [authentik_providers_oauth2.scopemapping, [scope_name, email]]" |
| 83 | + "!Find [authentik_providers_oauth2.scopemapping, [scope_name, profile]]" |
| 84 | + "!Find [authentik_providers_oauth2.scopemapping, [scope_name, offline_access]]" |
| 85 | + ]; |
| 86 | + sub_mode = "hashed_user_id"; |
| 87 | + include_claims_in_id_token = true; |
| 88 | + issuer_mode = "per_provider"; |
| 89 | + }; |
| 90 | + } |
| 91 | + { |
| 92 | + model = "authentik_core.application"; |
| 93 | + state = "present"; |
| 94 | + identifiers.slug = "grafana"; |
| 95 | + id = "grafana"; |
| 96 | + attrs = { |
| 97 | + name = "Grafana"; |
| 98 | + provider = "!KeyOf provider"; |
| 99 | + policy_engine_mode = "any"; |
| 100 | + }; |
| 101 | + } |
| 102 | + ]; |
| 103 | + } |
| 104 | + { |
| 105 | + metadata.name = "nodered-oauth"; |
| 106 | + entries = [ |
| 107 | + { |
| 108 | + model = "authentik_providers_oauth2.oauth2provider"; |
| 109 | + state = "present"; |
| 110 | + identifiers.name = "Node-RED"; |
| 111 | + id = "provider"; |
| 112 | + attrs = { |
| 113 | + authentication_flow = "!Find [authentik_flows.flow, [slug, default-authentication-flow]]"; |
| 114 | + authorization_flow = "!Find [authentik_flows.flow, [slug, default-provider-authorization-explicit-consent]]"; |
| 115 | + client_type = "confidential"; |
| 116 | + client_id = "node-red"; |
| 117 | + client_secret = "secret"; |
| 118 | + access_code_validity = "minutes=1"; |
| 119 | + access_token_validity = "minutes=5"; |
| 120 | + refresh_token_validity = "days=30"; |
| 121 | + property_mappings = [ |
| 122 | + "!Find [authentik_providers_oauth2.scopemapping, [scope_name, openid]]" |
| 123 | + "!Find [authentik_providers_oauth2.scopemapping, [scope_name, email]]" |
| 124 | + "!Find [authentik_providers_oauth2.scopemapping, [scope_name, profile]]" |
| 125 | + ]; |
| 126 | + sub_mode = "hashed_user_id"; |
| 127 | + include_claims_in_id_token = true; |
| 128 | + issuer_mode = "per_provider"; |
| 129 | + }; |
| 130 | + } |
| 131 | + { |
| 132 | + model = "authentik_core.application"; |
| 133 | + state = "present"; |
| 134 | + identifiers.slug = "node-red"; |
| 135 | + id = "node-red"; |
| 136 | + attrs = { |
| 137 | + name = "Node-RED"; |
| 138 | + provider = "!KeyOf provider"; |
| 139 | + policy_engine_mode = "any"; |
| 140 | + }; |
| 141 | + } |
| 142 | + ]; |
| 143 | + } |
| 144 | + ]; |
103 | 145 |
|
104 | 146 | profiles.monitoring = {
|
105 | 147 | enable = true;
|
|
0 commit comments