Split up search in extra config and add CORS header
This commit is contained in:
parent
92bccb7713
commit
d8036ba713
|
@ -33,6 +33,7 @@
|
||||||
# services
|
# services
|
||||||
../../2configs/bgt/savarcast/download.nix
|
../../2configs/bgt/savarcast/download.nix
|
||||||
../../2configs/bgt/savarcast/comments.nix
|
../../2configs/bgt/savarcast/comments.nix
|
||||||
|
../../2configs/bgt/savarcast/search.nix
|
||||||
|
|
||||||
# backup
|
# backup
|
||||||
#../../2configs/backup/state.nix
|
#../../2configs/backup/state.nix
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
configFile = config.sops.secrets."isso.conf".path;
|
configFile = config.sops.secrets."isso.conf".path;
|
||||||
searchdir = "/var/www/search";
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
sops.secrets."isso.conf" = {
|
sops.secrets."isso.conf" = {
|
||||||
|
@ -14,21 +13,8 @@ in {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.stork = {
|
|
||||||
group = "stork";
|
|
||||||
isNormalUser = true;
|
|
||||||
home = searchdir;
|
|
||||||
createHome = false;
|
|
||||||
openssh.authorizedKeys.keys = [
|
|
||||||
# GitHub deploy search (bgt_github_deploy.pub)
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGrj6cLVxv6LR0INj2OL/EVdEFMZSk0fOc0pCeXVTirz hi@l33t.name"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups.isso = {};
|
users.groups.isso = {};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [ "d ${searchdir} 0770 stork nginx - -" ];
|
|
||||||
|
|
||||||
services.isso.enable = true;
|
services.isso.enable = true;
|
||||||
# override the startup to allow secrets in the configFile
|
# override the startup to allow secrets in the configFile
|
||||||
# following relevant config is inside:
|
# following relevant config is inside:
|
||||||
|
@ -40,15 +26,8 @@ in {
|
||||||
systemd.services.isso.serviceConfig.ExecStart = lib.mkForce "${pkgs.isso}/bin/isso -c ${configFile}" ;
|
systemd.services.isso.serviceConfig.ExecStart = lib.mkForce "${pkgs.isso}/bin/isso -c ${configFile}" ;
|
||||||
systemd.services.isso.serviceConfig.DynamicUser = lib.mkForce false;
|
systemd.services.isso.serviceConfig.DynamicUser = lib.mkForce false;
|
||||||
|
|
||||||
services.nginx.virtualHosts."search.binaergewitter.de" = {
|
|
||||||
locations."/" = {
|
|
||||||
root = "/var/www/search/";
|
|
||||||
tryFiles = "/bgt.st =404";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# savarcast is behind traefik, do not configure tls
|
# savarcast is behind traefik, do not configure tls
|
||||||
services.nginx.virtualHosts."comments.binaergewitter.de" = {
|
services.nginx.virtualHosts."comments.binaergewitter.de" = {
|
||||||
locations."= /bgt.st".root = "/var/www/search/";
|
|
||||||
locations."/".proxyPass = "http://localhost:9292";
|
locations."/".proxyPass = "http://localhost:9292";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
29
2configs/bgt/savarcast/search.nix
Normal file
29
2configs/bgt/savarcast/search.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
searchdir = "/var/www/search";
|
||||||
|
in {
|
||||||
|
|
||||||
|
users.users.stork = {
|
||||||
|
group = "stork";
|
||||||
|
isNormalUser = true;
|
||||||
|
home = searchdir;
|
||||||
|
createHome = false;
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
# GitHub deploy search (bgt_github_deploy.pub)
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGrj6cLVxv6LR0INj2OL/EVdEFMZSk0fOc0pCeXVTirz hi@l33t.name"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [ "d ${searchdir} 0770 stork nginx - -" ];
|
||||||
|
|
||||||
|
# savarcast is behind traefik, do not configure tls
|
||||||
|
services.nginx.virtualHosts."search.binaergewitter.de" = {
|
||||||
|
locations."/" = {
|
||||||
|
extraConfig = ''
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
'';
|
||||||
|
root = "/var/www/search/";
|
||||||
|
tryFiles = "/bgt.st =404";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue