Add oauth2_proxy and use for calibre
oauth2_proxy is a service that allows adding authentication via proxy
headers to arbitrary web applications. As calibre doesn't support OIDC
directly, we can configure oauth2_proxy with nginx to lock users out of
calibre until they authenticate with keycloak, and then provide the
username to calibre to authenticate without a password
Change-Id: I933a6df20143ac2bd25513a4bcd2817cf6228191
Reviewed-on: https://git.clicks.codes/c/Clicks/NixFiles/+/203
Tested-by: Skyler Grey <minion@clicks.codes>
Reviewed-by: Samuel Shuert <coded@clicks.codes>
diff --git a/modules/common/calibre.nix b/modules/common/calibre.nix
index c11d0a8..88df2c2 100644
--- a/modules/common/calibre.nix
+++ b/modules/common/calibre.nix
@@ -29,9 +29,9 @@
calibreLibrary = "${config.services.nextcloud.datadir}/data/clicks-services/files/calibre";
reverseProxyAuth = {
- enable = false;
- header = "keycloak_oidc";
- }; # TODO: setup keycloak auth with oauth2_proxy
+ enable = true;
+ header = "X-User";
+ };
};
};
}
\ No newline at end of file