*actually* upload nixcloud configs
This commit is contained in:
@@ -0,0 +1 @@
|
||||
this was the old configs for FrontendFriendly, a project of Team SDS, which i have since left.
|
||||
@@ -0,0 +1,127 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
domain = "frontendfriendly.xyz";
|
||||
host = "stackoverflow.${domain}";
|
||||
upstreamPort = 7101;
|
||||
|
||||
# 1) Fetch source from GitHub
|
||||
anonymousOverflowSrc = pkgs.fetchFromGitHub {
|
||||
owner = "httpjamesm";
|
||||
repo = "AnonymousOverflow";
|
||||
rev = "v1.13.0"; # pin a release tag
|
||||
# TODO: replace with real hash after first build
|
||||
sha256 = "sha256-hvcOJctvNswEws+cCoeGQSvFzZvnThhKk3fJ7TnNulY=";
|
||||
};
|
||||
|
||||
# 2) Build the Go binary
|
||||
anonymousOverflowPkg = pkgs.buildGoModule {
|
||||
pname = "anonymousoverflow";
|
||||
version = "1.13.0";
|
||||
|
||||
src = anonymousOverflowSrc;
|
||||
|
||||
# code is at repo root
|
||||
subPackages = [ "." ];
|
||||
|
||||
# TODO: replace with real vendor hash after first build
|
||||
vendorHash = "sha256-P3kUGFJhj/pTNeVTwtg4IqhoHBH9rROfkr+ZsrUtmdo=";
|
||||
};
|
||||
in
|
||||
{
|
||||
containers.anonymousoverflow = {
|
||||
autoStart = true;
|
||||
|
||||
# Simple veth connection between host and container
|
||||
privateNetwork = true;
|
||||
hostAddress = "10.250.0.1";
|
||||
localAddress = "10.250.0.2";
|
||||
|
||||
# Rootfs is generated from this NixOS config:
|
||||
config = { config, pkgs, ... }:
|
||||
|
||||
let
|
||||
# 1) Fetch AnonymousOverflow source
|
||||
anonymousOverflowSrc = pkgs.fetchFromGitHub {
|
||||
owner = "httpjamesm";
|
||||
repo = "AnonymousOverflow";
|
||||
# Pin some tag or commit
|
||||
rev = "v1.13.0";
|
||||
# TODO: replace with real hash after first build
|
||||
sha256 = "sha256-hvcOJctvNswEws+cCoeGQSvFzZvnThhKk3fJ7TnNulY=";
|
||||
};
|
||||
|
||||
# 2) Build the Go binary
|
||||
anonymousOverflowPkg = pkgs.buildGoModule {
|
||||
pname = "anonymousoverflow";
|
||||
version = "1.13.0";
|
||||
|
||||
src = anonymousOverflowSrc;
|
||||
|
||||
# repo root
|
||||
subPackages = [ "." ];
|
||||
|
||||
# TODO: replace with real vendor hash after first build
|
||||
vendorHash = "sha256-P3kUGFJhj/pTNeVTwtg4IqhoHBH9rROfkr+ZsrUtmdo=";
|
||||
};
|
||||
in
|
||||
{
|
||||
# Set this to match your host’s stateVersion
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
# Optional but nice: container firewall allowing port 80
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
|
||||
systemd.services.anonymousoverflow = {
|
||||
description = "AnonymousOverflow StackOverflow frontend (container)";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
# Runs as root in container; that’s fine here, it needs port 80
|
||||
ExecStart = "${anonymousOverflowPkg}/bin/anonymousoverflow";
|
||||
|
||||
Restart = "always";
|
||||
RestartSec = 3;
|
||||
};
|
||||
};
|
||||
|
||||
# If AO needs env vars / config, set them here:
|
||||
# systemd.services.anonymousoverflow.serviceConfig.Environment = [
|
||||
# "PORT=80"
|
||||
# "BIND_ADDR=0.0.0.0"
|
||||
# ];
|
||||
};
|
||||
};
|
||||
|
||||
#################################
|
||||
## Anubis in front of it ##
|
||||
#################################
|
||||
|
||||
services.anubis.instances.anonymousoverflow = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
# Must use this prefix form: /run/anubis/anubis-<name>/...
|
||||
BIND = "/run/anubis/anubis-anonymousoverflow/anubis.sock";
|
||||
METRICS_BIND = "/run/anubis/anubis-anonymousoverflow/metrics.sock";
|
||||
|
||||
# If you keep the default :8080:
|
||||
# TARGET = "http://127.0.0.1:8080";
|
||||
|
||||
# If you configure the app to listen on 127.0.0.1:${upstreamPort}:
|
||||
TARGET = "http://10.250.0.2:${toString upstreamPort}";
|
||||
|
||||
SERVE_ROBOTS_TXT = true;
|
||||
};
|
||||
};
|
||||
|
||||
#################################
|
||||
## Caddy vhost ##
|
||||
#################################
|
||||
|
||||
services.caddy.virtualHosts.${host}.extraConfig = ''
|
||||
reverse_proxy unix//run/anubis/anubis-anonymousoverflow/anubis.sock
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
domain = "frontendfriendly.xyz";
|
||||
host = "dumb.${domain}";
|
||||
upstreamPort = 5555;
|
||||
in
|
||||
{
|
||||
virtualisation.oci-containers.containers.dumb = {
|
||||
image = "ghcr.io/rramiachraf/dumb:latest";
|
||||
autoStart = true;
|
||||
ports = [ "127.0.0.1:${toString upstreamPort}:5555" ];
|
||||
# environment = { ... } if Dumb needs configuration
|
||||
};
|
||||
|
||||
services.anubis.instances.dumb = {
|
||||
enable = true;
|
||||
settings = {
|
||||
BIND = "/run/anubis/anubis-dumb/anubis.sock";
|
||||
METRICS_BIND = "/run/anubis/anubis-dumb/metrics.sock";
|
||||
TARGET = "http://127.0.0.1:${toString upstreamPort}";
|
||||
SERVE_ROBOTS_TXT = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts.${host}.extraConfig = ''
|
||||
reverse_proxy unix//run/anubis/anubis-dumb/anubis.sock
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
users.users.caddy.extraGroups = [ config.users.groups.anubis.name ];
|
||||
|
||||
# hacky fix since ssl was broken
|
||||
|
||||
services.caddy.virtualHosts."frontendfriendly.xyz".extraConfig = ''
|
||||
root /var/www/frontendfriendly.xyz
|
||||
file_server
|
||||
handle /webhook/828e8c10-af83-4a9b-a7ee-1b687ba12adc {
|
||||
reverse_proxy https://n8n.teamsds.net {
|
||||
transport http {
|
||||
tls_insecure_skip_verify
|
||||
}
|
||||
header_up Host n8n.teamsds.net
|
||||
}
|
||||
}
|
||||
handle /webhook-test/828e8c10-af83-4a9b-a7ee-1b687ba12adc {
|
||||
reverse_proxy https://n8n.teamsds.net {
|
||||
transport http {
|
||||
tls_insecure_skip_verify
|
||||
}
|
||||
header_up Host n8n.teamsds.net
|
||||
}
|
||||
}
|
||||
|
||||
'';
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
domain = "frontendfriendly.xyz";
|
||||
host = "redlib.${domain}";
|
||||
upstreamPort = 7105;
|
||||
in
|
||||
{
|
||||
services.redlib = {
|
||||
enable = true;
|
||||
address = "127.0.0.1";
|
||||
port = upstreamPort;
|
||||
# extraSettings = { ... }; # if you want instance-specific options
|
||||
};
|
||||
|
||||
services.anubis.instances.redlib = {
|
||||
enable = true;
|
||||
settings = {
|
||||
BIND = "/run/anubis/anubis-redlib/anubis.sock";
|
||||
METRICS_BIND = "/run/anubis/anubis-redlib/metrics.sock";
|
||||
TARGET = "http://127.0.0.1:${toString upstreamPort}";
|
||||
SERVE_ROBOTS_TXT = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts.${host}.extraConfig = ''
|
||||
reverse_proxy unix//run/anubis/anubis-redlib/anubis.sock
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
domain = "frontendfriendly.xyz";
|
||||
host = "rimgo.${domain}";
|
||||
upstreamPort = 7104;
|
||||
in
|
||||
{
|
||||
services.rimgo = {
|
||||
enable = true;
|
||||
# Rimgo uses a port in its settings; set it to local only
|
||||
settings = {
|
||||
ADDRESS = "127.0.0.1";
|
||||
PORT = upstreamPort;
|
||||
};
|
||||
};
|
||||
|
||||
services.anubis.instances.rimgo = {
|
||||
enable = true;
|
||||
settings = {
|
||||
BIND = "/run/anubis/anubis-rimgo/anubis.sock";
|
||||
METRICS_BIND = "/run/anubis/anubis-rimgo/metrics.sock";
|
||||
TARGET = "http://127.0.0.1:${toString upstreamPort}";
|
||||
SERVE_ROBOTS_TXT = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts.${host}.extraConfig = ''
|
||||
reverse_proxy unix//run/anubis/anubis-rimgo/anubis.sock
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user