updated member app and authelia nginx
This commit is contained in:
parent
23faf44b39
commit
74ff08576a
3 changed files with 9 additions and 21 deletions
|
@ -76,22 +76,8 @@ let
|
|||
error_page 401 =302 https://auth.fricloud.dk/?rd=$target_url;
|
||||
'';
|
||||
in {
|
||||
mine.shared.lib.authelia.mkProtectedWebsite = { vhostConfig, endpoint ? "/" }: lib.recursiveUpdate {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
|
||||
extraConfig = "include ${autheliaLocation};";
|
||||
|
||||
locations."${endpoint}" = {
|
||||
extraConfig = "include ${autheliaRequest};";
|
||||
};
|
||||
} vhostConfig;
|
||||
|
||||
services.nginx.virtualHosts."test.fricloud.dk" = config.mine.shared.lib.authelia.mkProtectedWebsite {
|
||||
vhostConfig = {
|
||||
locations."/".root = pkgs.writeTextDir "index.html" ''
|
||||
ACCESS GRANTED!
|
||||
'';
|
||||
};
|
||||
mine.shared.lib.authelia.mkProtectedWebsite = { vhostConfig, endpoint ? "/" }: lib.recursiveUpdate vhostConfig {
|
||||
extraConfig = (lib.attrByPath [ "extraConfig" ] "" vhostConfig) + "\n" + "include ${autheliaLocation};";
|
||||
locations."${endpoint}".extraConfig = (lib.attrByPath [ "locations" endpoint "extraConfig" ] "" vhostConfig) + "\n" + "include ${autheliaRequest};";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -25,16 +25,17 @@ tmpl_index = """
|
|||
{% for name, info in services.items() %}
|
||||
<h3>{{ info.name }}</h3>
|
||||
{{ info.description }}
|
||||
{% if info.url %}
|
||||
<br>
|
||||
<a href="{{ info.url }}">{{ info.url }}</a>
|
||||
Link: <a href="{{ info.url }}">{{ info.url }}</a>
|
||||
{% endif %}
|
||||
<pre>
|
||||
Package name: {{ info.package.name }}
|
||||
Package version: {{ info.package.version }}
|
||||
Package homepage: {{ info.package.meta.homepage }}
|
||||
License: <a href="{{ info.package.meta.license.url }}">{{ info.package.meta.license.spdxId }} ({{ info.package.meta.license.shortName }})</a>
|
||||
Unfree: {{ info.package.meta.unfree }}
|
||||
|
||||
<pre>
|
||||
</pre>
|
||||
<hr>
|
||||
{% endfor %}
|
||||
"""
|
||||
|
@ -76,6 +77,7 @@ def extract_secrets() -> dict[str, str]:
|
|||
|
||||
|
||||
@app.route("/")
|
||||
@app.route("/members")
|
||||
def index():
|
||||
# extract user information
|
||||
user_info = {
|
||||
|
|
|
@ -20,7 +20,7 @@ in {
|
|||
services.nginx.virtualHosts."${config.mine.shared.settings.domain}" = config.mine.shared.lib.authelia.mkProtectedWebsite {
|
||||
endpoint = urlpath;
|
||||
vhostConfig.locations."${urlpath}" = {
|
||||
extraConfig = "rewrite ^${urlpath}(.*)$ /$1 break;";
|
||||
# extraConfig = "rewrite ^${urlpath}(.*)$ /$1 break;";
|
||||
proxyPass = "http://localhost:${builtins.toString port}";
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue