nix: make allowedHosts actually work
This commit is contained in:
parent
f52447f7d2
commit
dee8428504
1 changed files with 6 additions and 2 deletions
|
@ -15,6 +15,7 @@ let
|
||||||
env = {
|
env = {
|
||||||
DEBUG = if cfg.debug then "true" else "false";
|
DEBUG = if cfg.debug then "true" else "false";
|
||||||
DOMAIN = cfg.domain;
|
DOMAIN = cfg.domain;
|
||||||
|
ALLOWED_HOSTS = lib.concatStringsSep "," cfg.allowedHosts;
|
||||||
BOOKWYRM_DATABASE_BACKEND = "postgres";
|
BOOKWYRM_DATABASE_BACKEND = "postgres";
|
||||||
MEDIA_ROOT = (builtins.toPath cfg.stateDir) + "/images";
|
MEDIA_ROOT = (builtins.toPath cfg.stateDir) + "/images";
|
||||||
STATIC_ROOT = (builtins.toPath cfg.stateDir) + "/static";
|
STATIC_ROOT = (builtins.toPath cfg.stateDir) + "/static";
|
||||||
|
@ -117,10 +118,13 @@ in
|
||||||
|
|
||||||
allowedHosts = mkOption {
|
allowedHosts = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [ ];
|
default = [ "*" ];
|
||||||
|
example = [ "bookwyrm.example.com" ];
|
||||||
description = ''
|
description = ''
|
||||||
List of hosts to allow, checked against the <literal>Host:</literal>
|
List of hosts to allow, checked against the <literal>Host:</literal>
|
||||||
header. Leave empty to accept all hosts.
|
header. Leave default to accept all hosts.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
debug = mkOption {
|
debug = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
|
Loading…
Add table
Reference in a new issue