Compare commits
No commits in common. "42ed88bb9467915e0e5ad80fee4f7dd7b3cb4f16" and "398b2cfe3d136cc1e08736fbdf46e0fa687e8a0c" have entirely different histories.
42ed88bb94
...
398b2cfe3d
3 changed files with 9 additions and 27 deletions
6
flake.lock
generated
6
flake.lock
generated
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1691654369,
|
"lastModified": 1691368598,
|
||||||
"narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=",
|
"narHash": "sha256-ia7li22keBBbj02tEdqjVeLtc7ZlSBuhUk+7XTUFr14=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e",
|
"rev": "5a8e9243812ba528000995b294292d3b5e120947",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
vscode-server.url = "github:nix-community/nixos-vscode-server";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs }:
|
outputs = { self, nixpkgs, vscode-server }:
|
||||||
let
|
let
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
|
|
||||||
|
@ -19,6 +21,7 @@
|
||||||
specialArgs = { inherit system; };
|
specialArgs = { inherit system; };
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
|
vscode-server.nixosModules.default
|
||||||
./hosts/server/configuration.nix
|
./hosts/server/configuration.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -84,30 +84,9 @@
|
||||||
rev = "v0.29";
|
rev = "v0.29";
|
||||||
sha256 = "089ishx4482ybfsv10ig8h3cpsdw6rvgy0w874h1c7m1gk2fd7r9";
|
sha256 = "089ishx4482ybfsv10ig8h3cpsdw6rvgy0w874h1c7m1gk2fd7r9";
|
||||||
};
|
};
|
||||||
lua-resty-websocket = pkgs.fetchFromGitHub {
|
|
||||||
owner = "openresty";
|
|
||||||
repo = "lua-resty-websocket";
|
|
||||||
rev = "v0.10";
|
|
||||||
sha256 = "0zpprfi5qc3066ab7g7nyr18jwlk3n8y0006maj4nlx38rl24vfh";
|
|
||||||
};
|
|
||||||
realIpsFromList = lib.strings.concatMapStringsSep "\n" (x: "set_real_ip_from ${x};");
|
|
||||||
fileToList = x: lib.strings.splitString "\n" (builtins.readFile x);
|
|
||||||
cfipv4 = fileToList (pkgs.fetchurl {
|
|
||||||
url = "https://www.cloudflare.com/ips-v4";
|
|
||||||
sha256 = "0ywy9sg7spafi3gm9q5wb59lbiq0swvf0q3iazl0maq1pj1nsb7h";
|
|
||||||
});
|
|
||||||
cfipv6 = fileToList (pkgs.fetchurl {
|
|
||||||
url = "https://www.cloudflare.com/ips-v6";
|
|
||||||
sha256 = "1ad09hijignj6zlqvdjxv7rjj8567z357zfavv201b9vx3ikk7cy";
|
|
||||||
});
|
|
||||||
in ''
|
in ''
|
||||||
# Lua path
|
# Lua path
|
||||||
lua_package_path "/var/www/reidlab.online/lua/?.lua;;${lua-resty-template}/lib/?.lua;;${lua-resty-redis}/lib/?.lua;;${lua-resty-websocket}/lib/?.lua;;";
|
lua_package_path "/var/www/reidlab.online/lua/?.lua;;${lua-resty-template}/lib/?.lua;;${lua-resty-redis}/lib/?.lua;;";
|
||||||
|
|
||||||
# Realip
|
|
||||||
${realIpsFromList cfipv4}
|
|
||||||
${realIpsFromList cfipv6}
|
|
||||||
real_ip_header CF-Connecting-IP;
|
|
||||||
|
|
||||||
# Add HSTS header with preloading to HTTPS requests.
|
# Add HSTS header with preloading to HTTPS requests.
|
||||||
# Adding this header to HTTP requests is discouraged
|
# Adding this header to HTTP requests is discouraged
|
||||||
|
@ -200,7 +179,7 @@
|
||||||
REGISTER_EMAIL_CONFIRM = false;
|
REGISTER_EMAIL_CONFIRM = false;
|
||||||
DEFAULT_KEEP_EMAIL_PRIVATE = true;
|
DEFAULT_KEEP_EMAIL_PRIVATE = true;
|
||||||
DEFAULT_ENABLE_TIMETRACKING = true;
|
DEFAULT_ENABLE_TIMETRACKING = true;
|
||||||
DISABLE_REGISTRATION = true;
|
# DISABLE_REGISTRATION = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue