nixos-config/machines/weilite/services/ocis.nix

35 lines
1.3 KiB
Nix
Raw Normal View History

2024-09-14 08:33:01 +00:00
{ config, pkgs, ... }:
{
services.ocis = {
enable = true;
2024-09-23 12:17:26 +00:00
package = pkgs.ocis;
2024-09-14 08:33:01 +00:00
stateDir = "/var/lib/ocis";
url = "https://drive.xinyang.life:8443";
address = "127.0.0.1";
port = 9200;
2024-09-23 12:17:26 +00:00
configDir = "/var/lib/ocis/config";
2024-09-14 08:33:01 +00:00
environment = {
OCIS_INSECURE = "false";
2024-09-23 12:17:26 +00:00
PROXY_TLS = "false";
OCIS_LOG_LEVEL = "debug";
2024-09-14 08:33:01 +00:00
OCIS_LOG_PRETTY = "true";
2024-09-23 12:17:26 +00:00
PROXY_AUTOPROVISION_ACCOUNTS = "true";
PROXY_USER_OIDC_CLAIM = "preferred_username";
2024-09-30 07:20:07 +00:00
PROXY_OIDC_ISSUER = "https://auth.xinyang.life/oauth2/openid/owncloud-android";
PROXY_OIDC_REWRITE_WELLKNOWN = "true";
2024-09-23 12:17:26 +00:00
PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD = "none";
2024-09-14 08:33:01 +00:00
OCIS_EXCLUDE_RUN_SERVICES = "idp";
2024-09-23 12:17:26 +00:00
WEB_HTTP_ADDR = "127.0.0.1:12345";
2024-09-30 07:20:07 +00:00
WEB_OIDC_METADATA_URL = "https://auth.xinyang.life/oauth2/openid/owncloud-android/.well-known/openid-configuration";
WEB_OIDC_AUTHORITY = "https://auth.xinyang.life/oauth2/openid/owncloud-android";
WEB_OIDC_CLIENT_ID = "owncloud-android";
2024-09-14 08:33:01 +00:00
};
2024-09-23 12:17:26 +00:00
# environmentFile = config.sops.secrets."ocis/env".path;
2024-09-14 08:33:01 +00:00
};
2024-09-23 12:17:26 +00:00
networking.firewall.allowedTCPPorts = [ 8443 ];
2024-09-14 08:33:01 +00:00
services.caddy.virtualHosts."${config.services.ocis.url}".extraConfig = ''
2024-09-23 12:17:26 +00:00
reverse_proxy ${config.services.ocis.address}:${toString config.services.ocis.port}
2024-09-14 08:33:01 +00:00
'';
}