set up spacebar-server
This commit is contained in:
parent
6c6007e6d2
commit
77ed9487a2
5 changed files with 147 additions and 12 deletions
|
@ -30,8 +30,8 @@
|
|||
proxyTo = "http://localhost:9780/";
|
||||
}
|
||||
{
|
||||
domain = "www.mtgmonkey.net";
|
||||
proxyTo = "http://localhost:9080/";
|
||||
domain = "spacebar-api.mtgmonkey.net";
|
||||
proxyTo = "http://localhost:3001/";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
@ -1,9 +1,68 @@
|
|||
# Auto-generated using compose2nix v0.3.1.
|
||||
{
|
||||
ssh-pub-keys,
|
||||
spacebar-server,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}: let
|
||||
botPolicies-nix = {
|
||||
dnsbl = false;
|
||||
status_codes = {
|
||||
CHALLENGE = 200;
|
||||
DENY = 200;
|
||||
};
|
||||
bots = [
|
||||
{
|
||||
name = "catch-everything";
|
||||
user_agent_regex = ".*";
|
||||
action = "CHALLENGE";
|
||||
}
|
||||
];
|
||||
};
|
||||
in {
|
||||
services.anubis = {
|
||||
instances.spacebar = {
|
||||
enable = true;
|
||||
settings = {
|
||||
BIND = "[::1]:9780";
|
||||
BIND_NETWORK = "tcp";
|
||||
DIFFICULTY = 4;
|
||||
METRICS_BIND = "[::1]:9781";
|
||||
METRICS_BIND_NETWORK = "tcp";
|
||||
POLICY_FNAME = "/etc/anubis/spacebar.botPolicies.yaml";
|
||||
TARGET = "http://localhost:8282";
|
||||
};
|
||||
};
|
||||
};
|
||||
environment.etc."anubis/spacebar.botPolicies.yaml" = {
|
||||
source = (pkgs.formats.yaml {}).generate "" botPolicies-nix;
|
||||
mode = "644";
|
||||
};
|
||||
systemd.services.spacebar-server = {
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${lib.getExe spacebar-server.packages.x86_64-linux.default}";
|
||||
RemainAfterExit = true;
|
||||
User = "spacebar";
|
||||
Group = "spacebar";
|
||||
};
|
||||
environment = {
|
||||
DATABASE = "/var/lib/spacebar-server/database.db";
|
||||
STORAGE_LOCATION = "/var/lib/spacebar-server/files/";
|
||||
};
|
||||
};
|
||||
users.users.spacebar = {
|
||||
isSystemUser = true;
|
||||
group = "spacebar";
|
||||
description = "spacebar";
|
||||
home = "/var/lib/spacebar-server";
|
||||
createHome = true;
|
||||
packages = [pkgs.git spacebar-server.packages.x86_64-linux.default];
|
||||
shell = pkgs.bash;
|
||||
openssh.authorizedKeys.keys = ssh-pub-keys;
|
||||
};
|
||||
users.groups.spacebar = {};
|
||||
|
||||
# Enable container name DNS for non-default Docker networks.
|
||||
# https://github.com/NixOS/nixpkgs/issues/226365
|
||||
networking.firewall.interfaces."docker+".allowedUDPPorts = [53];
|
||||
|
@ -14,7 +73,7 @@
|
|||
virtualisation.oci-containers.containers."spaceclient-jank" = {
|
||||
image = "docker.io/compose2nix/spaceclient-jank";
|
||||
ports = [
|
||||
"9780:8080/tcp"
|
||||
"8282:8080/tcp"
|
||||
];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
Loading…
Add table
Add a link
Reference in a new issue