diff --git a/modules/nixos/services/tracks_storage_server.nix b/modules/nixos/services/tracks_storage_server.nix
index da1c5c937f395d81bb1064594207607d07f513e8..715962c8c781b0f79595ec1cd01e4c9e40ad5ea4 100644
--- a/modules/nixos/services/tracks_storage_server.nix
+++ b/modules/nixos/services/tracks_storage_server.nix
@@ -14,21 +14,67 @@ {
options.services.tracks_storage_server = {
enable = mkEnableOption "tracks_storage_server";
package = mkPackageOption pkgs "tracks_storage_server" { };
type = "emperor";
vassals.tracks = {
type = "normal";
master = true;
workers = 2;
socket = "127.0.0.1:8181";
module = "server:application";
pythonPackages = self: [ cfg.package ];
default = { };
description = ''
Configuration for nginx reverse proxy.
'';
type = types.submodule {
options = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Configure the nginx reverse proxy settings.
'';
};
hostName = mkOption {
type = types.str;
description = ''
The hostname use to setup the virtualhost configuration
'';
};
};
};
};
};
services.uwsgi.enable = true;
services.uwsgi.plugins = [ "python3" ];
services.uwsgi.instance = {
type = "emperor";
vassals.tracks = {
type = "normal";
master = true;
workers = 2;
socket = "127.0.0.1:8181";
module = "server:application";
pythonPackages = self: [ cfg.package ];
};
};
services.nginx = {
enable = true;
virtualHosts."${cfg.nginx.hostName}" = {
locations."/" = {
extraConfig = ''
uwsgi_pass localhost:8181;
include ${config.services.nginx.package}/conf/uwsgi_params;
more_clear_headers Access-Control-Allow-Origin;
more_clear_headers Access-Control-Allow-Credentials;
more_set_headers 'Access-Control-Allow-Origin: $http_origin';
more_set_headers 'Access-Control-Allow-Credentials: true';
more_set_headers 'Cache-Control: max-age=315360000';
more_set_headers 'Expires: Thu, 31 Dec 2037 23:55:55 GMT';
more_set_headers 'Vary: Origin';
'';
};
};
};
}
application/octet-stream
This content has been proxied by September (3851b).