~afontaine/home

409697d8688c8266116f6a13844d8784316c23ff — Andrew Fontaine 6 months ago 79c3f31
Set the URL via an Environment Variable

This is for route generation to be able to not just be `example.com`.
2 files changed, 8 insertions(+), 0 deletions(-)

M config/releases.exs
M flake.nix
M config/releases.exs => config/releases.exs +1 -0
@@ 30,6 30,7 @@ secret_key_base =
    """

config :home_web, HomeWeb.Endpoint,
  url: [scheme: "https", host: System.get_env("HOSTNAME")],
  http: [
    port: String.to_integer(System.get_env("PORT") || "4000"),
    transport_options: [socket_opts: [:inet6]]

M flake.nix => flake.nix +7 -0
@@ 173,6 173,11 @@
                  default = "home-web";
                  description = "The group the user is in";
                };
                host = lib.mkOption {
                  type = lib.types.str;
                  description =
                    "The host to configure the router generation from";
                };
              };
            };
            config = lib.mkIf cfg.enable {


@@ 212,6 217,7 @@
                    SECRET_KEY_BASE_FILE = cfg.secretKeyBaseFile;
                    DATABASE_NAME = cfg.databaseName;
                    DATABASE_SOCKET_DIR = cfg.databaseSocketDir;
                    HOSTNAME = cfg.host;
                  };
                };



@@ 235,6 241,7 @@
                    PORT = builtins.toString cfg.port;
                    DATABASE_NAME = cfg.databaseName;
                    DATABASE_SOCKET_DIR = cfg.databaseSocketDir;
                    HOSTNAME = cfg.host;
                  };
                };
              };