mirror of
https://github.com/RGBCube/Site
synced 2025-07-31 13:07:46 +00:00
Set default port to 4777 and add configureNginx option
This commit is contained in:
parent
798f766943
commit
b7db8421fb
3 changed files with 31 additions and 3 deletions
|
@ -22,7 +22,7 @@ Default: false.
|
|||
|
||||
Specifies on which port the site service listens for connections.
|
||||
|
||||
Default: 8080.
|
||||
Default: 4777.
|
||||
|
||||
### `services.site.logLevel`
|
||||
|
||||
|
@ -30,6 +30,12 @@ Specifies the log level that the site service will log stuff with.
|
|||
|
||||
Default: info.
|
||||
|
||||
### `services.site.configureNginx`
|
||||
|
||||
Whether to configure Nginx and set the reverse proxy settings.
|
||||
|
||||
Default: false.
|
||||
|
||||
## License
|
||||
|
||||
All the markdown files under the `src/` directory are licensed
|
||||
|
|
24
flake.nix
24
flake.nix
|
@ -111,7 +111,7 @@
|
|||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 8080;
|
||||
default = 4777;
|
||||
example = 80;
|
||||
description = mdDoc ''
|
||||
Specifies on which port the site service listens for connections.
|
||||
|
@ -126,10 +126,32 @@
|
|||
Specifies the log level that the site service will log stuff with.
|
||||
'';
|
||||
};
|
||||
|
||||
configureNginx = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = mdDoc ''
|
||||
Whether to configure Nginx and set the reverse proxy settings.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.nginx = let
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
urlStripped = removeSuffix "/" (removePrefix "https://" cargoToml.package.homepage);
|
||||
in mkIf cfg.configureNginx {
|
||||
enable = true;
|
||||
|
||||
recommendedGzipSettings = mkDefault true;
|
||||
recommendedOptimisation = mkDefault true;
|
||||
recommendedProxySettings = mkDefault true;
|
||||
recommendedTlsSettings = mkDefault true;
|
||||
|
||||
virtualHosts.${urlStripped}.proxyPass = "http://127.0.0.1:${cfg.port}";
|
||||
};
|
||||
|
||||
systemd.services.site = {
|
||||
description = "RGBCube's Homepage";
|
||||
requires = [ "network.target" ];
|
||||
|
|
|
@ -18,7 +18,7 @@ use tower_http::trace::TraceLayer;
|
|||
#[command(author, version, about)]
|
||||
struct Cli {
|
||||
/// The port to listen for connections on
|
||||
#[arg(long, default_value = "8080")]
|
||||
#[arg(long, default_value = "4777")]
|
||||
port: u16,
|
||||
/// The log level to log stuff with
|
||||
#[arg(long, default_value = "info")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue