switch to cap based home configs
This commit is contained in:
parent
50ee9aac83
commit
49b6f5bde0
64 changed files with 2064 additions and 1779 deletions
56
hosts/fili/services/obsidian-sync.nix
Normal file
56
hosts/fili/services/obsidian-sync.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
secrets,
|
||||
...
|
||||
}:
|
||||
let
|
||||
port = 5984;
|
||||
in
|
||||
{
|
||||
sops.secrets.obsidian-sync = {
|
||||
sopsFile = "${secrets}/obsidian-sync.ini";
|
||||
format = "ini";
|
||||
owner = "couchdb";
|
||||
};
|
||||
|
||||
services.couchdb = {
|
||||
enable = true;
|
||||
inherit port;
|
||||
package = pkgs.couchdb3;
|
||||
configFile = config.sops.secrets.obsidian-sync.path;
|
||||
|
||||
extraConfig = {
|
||||
chttpd = {
|
||||
require_valid_user = true;
|
||||
enable_cors = true;
|
||||
max_http_request_size = 4294967296;
|
||||
};
|
||||
|
||||
chttpd_auth.require_valid_user = true;
|
||||
httpd = {
|
||||
WWW-Authenticate = ''Basic realm="couchdb"'';
|
||||
enable_cors = true;
|
||||
};
|
||||
|
||||
couchdb.max_document_size = 50000000;
|
||||
|
||||
cors = {
|
||||
credentials = true;
|
||||
headers = "accept, authorization, content-type, origin, referer";
|
||||
methods = "GET,PUT,POST,HEAD,DELETE";
|
||||
max_age = 3600;
|
||||
origins = "app://obsidian.md,capacitor://localhost,http://localhost,https://localhost,capacitor://obsidian.donsz.nl,http://obsidian.donsz.nl,https://obsidian.donsz.nl";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."obsidian.donsz.nl" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = ''
|
||||
client_max_body_size 512M;
|
||||
'';
|
||||
locations."/".proxyPass = "http://localhost:${toString port}";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue