forked from fediversity/fediversity
Compare commits
9 commits
bfa3843aaf
...
715da01e90
| Author | SHA1 | Date | |
|---|---|---|---|
| 715da01e90 | |||
| d9f8b3c48c | |||
| 590d5a747e | |||
| 460f3822ab | |||
| f22a2acafe | |||
| f31278711e | |||
| 5e8ec6f9fc | |||
| 270258aaf2 | |||
| 6c754c41bb |
3 changed files with 74 additions and 157 deletions
|
|
@ -5,19 +5,26 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
networking = {
|
|
||||||
firewall.allowedTCPPorts = [
|
|
||||||
22
|
|
||||||
80
|
|
||||||
443
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
defaults.email = "something@fediversity.eu";
|
defaults.email = "something@fediversity.eu";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.groups.woodpecker-agent-docker = { };
|
||||||
|
|
||||||
|
age.secrets =
|
||||||
|
lib.mapAttrs
|
||||||
|
(_: group: {
|
||||||
|
owner = "root";
|
||||||
|
inherit group;
|
||||||
|
mode = "440";
|
||||||
|
})
|
||||||
|
{
|
||||||
|
woodpecker-gitea-client = "woodpecker-server";
|
||||||
|
woodpecker-gitea-secret = "woodpecker-server";
|
||||||
|
woodpecker-agent-container = "woodpecker-agent-docker";
|
||||||
|
};
|
||||||
|
|
||||||
# needs `sudo generate-vars`
|
# needs `sudo generate-vars`
|
||||||
vars.settings.on-machine.enable = true;
|
vars.settings.on-machine.enable = true;
|
||||||
|
|
||||||
|
|
@ -45,7 +52,6 @@
|
||||||
fileNames = [
|
fileNames = [
|
||||||
"woodpecker-gitea-client"
|
"woodpecker-gitea-client"
|
||||||
"woodpecker-gitea-secret"
|
"woodpecker-gitea-secret"
|
||||||
"woodpecker-agent-exec"
|
|
||||||
"woodpecker-agent-container"
|
"woodpecker-agent-container"
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
|
|
@ -64,6 +70,8 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# FIXME: make `WOODPECKER_AGENT_SECRET_FILE` work so i can just do the following again instead of using templates:
|
||||||
|
# `woodpecker-agents.agents.docker.environment.WOODPECKER_AGENT_SECRET_FILE = config.age.secrets.woodpecker-agent-docker.path;`
|
||||||
vars.generators."templates" = rec {
|
vars.generators."templates" = rec {
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"woodpecker"
|
"woodpecker"
|
||||||
|
|
@ -96,29 +104,9 @@
|
||||||
'') files
|
'') files
|
||||||
);
|
);
|
||||||
|
|
||||||
# files."woodpecker-server.conf" = {
|
|
||||||
# secret = true;
|
|
||||||
# template = pkgs.writeText "woodpecker-server.conf" ''
|
|
||||||
# WOODPECKER_DATABASE_DRIVER=sqlite3
|
|
||||||
# WOODPECKER_DISABLE_USER_AGENT_REGISTRATION=false
|
|
||||||
# WOODPECKER_OPEN=false
|
|
||||||
# WOODPECKER_ADMIN=kiara,fricklerhandwerk,niols
|
|
||||||
# WOODPECKER_HOST=https://woodpecker.fediversity.eu
|
|
||||||
# WOODPECKER_GITEA=true
|
|
||||||
# WOODPECKER_GITEA_URL=https://git.fediversity.eu
|
|
||||||
# WOODPECKER_GITEA_CLIENT_FILE=${config.vars.generators.woodpecker.files.woodpecker-gitea-client.placeholder}
|
|
||||||
# WOODPECKER_GITEA_SECRET_FILE=${config.vars.generators.woodpecker.files.woodpecker-gitea-secret.placeholder}
|
|
||||||
# WOODPECKER_AGENT_SECRET_FILE=${config.vars.generators.woodpecker-agent-secret.files.my-secret.placeholder}
|
|
||||||
# WOODPECKER_GRPC_SECRET_FILE=${config.vars.generators.woodpecker-rpc-secret.files.rpc-secret.placeholder}
|
|
||||||
# WOODPECKER_LOG_LEVEL=info
|
|
||||||
# WOODPECKER_DEFAULT_CLONE_PLUGIN=docker.io/woodpeckerci/plugin-git
|
|
||||||
# WOODPECKER_SERVER_ADDR=:8000
|
|
||||||
# WOODPECKER_GRPC_ADDR=:9000
|
|
||||||
# '';
|
|
||||||
# };
|
|
||||||
|
|
||||||
files =
|
files =
|
||||||
let
|
let
|
||||||
|
# https://woodpecker-ci.org/docs/administration/configuration/agent
|
||||||
shared = ''
|
shared = ''
|
||||||
WOODPECKER_SERVER=localhost:9000
|
WOODPECKER_SERVER=localhost:9000
|
||||||
WOODPECKER_USERNAME=x-oauth-basic
|
WOODPECKER_USERNAME=x-oauth-basic
|
||||||
|
|
@ -134,21 +122,28 @@
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
# https://woodpecker-ci.org/docs/administration/configuration/server
|
||||||
"woodpecker-agent-exec.conf" = {
|
"woodpecker-server.conf" = {
|
||||||
secret = true;
|
secret = true;
|
||||||
template = pkgs.writeText "woodpecker-agent-exec.conf" (
|
template = pkgs.writeText "woodpecker-server.conf" ''
|
||||||
lib.concatStringsSep "\n" [
|
WOODPECKER_DATABASE_DRIVER=sqlite3
|
||||||
shared
|
WOODPECKER_DISABLE_USER_AGENT_REGISTRATION=false
|
||||||
''
|
WOODPECKER_OPEN=false
|
||||||
WOODPECKER_AGENT_SECRET=${config.vars.generators.woodpecker.files.woodpecker-agent-exec.placeholder}
|
WOODPECKER_ADMIN=kiara,fricklerhandwerk,niols
|
||||||
WOODPECKER_BACKEND=local
|
WOODPECKER_HOST=https://woodpecker.fediversity.eu
|
||||||
WOODPECKER_AGENT_LABELS=type=local
|
WOODPECKER_GITEA=true
|
||||||
''
|
WOODPECKER_GITEA_URL=https://git.fediversity.eu
|
||||||
]
|
WOODPECKER_GITEA_CLIENT=${config.vars.generators.woodpecker.files.woodpecker-gitea-client.placeholder}
|
||||||
);
|
WOODPECKER_GITEA_SECRET=${config.vars.generators.woodpecker.files.woodpecker-gitea-secret.placeholder}
|
||||||
|
WOODPECKER_AGENT_SECRET=${config.vars.generators.woodpecker-agent-secret.files.my-secret.placeholder}
|
||||||
|
WOODPECKER_GRPC_SECRET=${config.vars.generators.woodpecker-rpc-secret.files.rpc-secret.placeholder}
|
||||||
|
WOODPECKER_LOG_LEVEL=info
|
||||||
|
WOODPECKER_DEFAULT_CLONE_PLUGIN=docker.io/woodpeckerci/plugin-git
|
||||||
|
WOODPECKER_SERVER_ADDR=:8000
|
||||||
|
WOODPECKER_GRPC_ADDR=:9000
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
# https://woodpecker-ci.org/docs/administration/configuration/backends/docker#environment-variables
|
||||||
"woodpecker-agent-podman.conf" = {
|
"woodpecker-agent-podman.conf" = {
|
||||||
secret = true;
|
secret = true;
|
||||||
template = pkgs.writeText "woodpecker-agent-podman.conf" (
|
template = pkgs.writeText "woodpecker-agent-podman.conf" (
|
||||||
|
|
@ -190,102 +185,39 @@
|
||||||
|
|
||||||
woodpecker-server = {
|
woodpecker-server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
environmentFile = config.vars.generators."templates".files."woodpecker-server.conf".path;
|
||||||
# environmentFile = config.vars.generators."templates".files."woodpecker-server.conf".path;
|
|
||||||
# https://woodpecker-ci.org/docs/administration/configuration/server
|
|
||||||
environment = {
|
|
||||||
WOODPECKER_DATABASE_DRIVER = "sqlite3";
|
|
||||||
WOODPECKER_DISABLE_USER_AGENT_REGISTRATION = "false";
|
|
||||||
|
|
||||||
WOODPECKER_OPEN = "false";
|
|
||||||
WOODPECKER_ADMIN = "kiara,fricklerhandwerk,niols";
|
|
||||||
WOODPECKER_HOST = "https://woodpecker.fediversity.eu";
|
|
||||||
|
|
||||||
WOODPECKER_GITEA = "true";
|
|
||||||
WOODPECKER_GITEA_URL = "https://git.fediversity.eu";
|
|
||||||
WOODPECKER_GITEA_CLIENT_FILE = config.age.secrets.woodpecker-gitea-client.path;
|
|
||||||
WOODPECKER_GITEA_SECRET_FILE = config.age.secrets.woodpecker-gitea-secret.path;
|
|
||||||
|
|
||||||
WOODPECKER_AGENT_SECRET_FILE = config.vars.generators.woodpecker-agent-secret.files.my-secret.path;
|
|
||||||
WOODPECKER_GRPC_SECRET_FILE = config.vars.generators.woodpecker-rpc-secret.files.rpc-secret.path;
|
|
||||||
|
|
||||||
WOODPECKER_LOG_LEVEL = "info";
|
|
||||||
WOODPECKER_DEFAULT_CLONE_PLUGIN = "docker.io/woodpeckerci/plugin-git";
|
|
||||||
WOODPECKER_SERVER_ADDR = ":8000";
|
|
||||||
WOODPECKER_GRPC_ADDR = ":9000";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://woodpecker-ci.org/docs/administration/configuration/agent
|
# https://woodpecker-ci.org/docs/administration/configuration/agent
|
||||||
woodpecker-agents.agents =
|
woodpecker-agents.agents = {
|
||||||
# let
|
docker = {
|
||||||
# shared = {
|
enable = true;
|
||||||
# WOODPECKER_SERVER = "localhost:9000";
|
environmentFile = [ config.vars.generators."templates".files."woodpecker-agent-podman.conf".path ];
|
||||||
# # TODO: separate to agent-specific tokens?
|
extraGroups = [
|
||||||
# # TODO: why will it only accept `WOODPECKER_AGENT_SECRET`, not `WOODPECKER_AGENT_SECRET_FILE`?
|
"podman"
|
||||||
# # WOODPECKER_AGENT_SECRET_FILE = config.vars.generators.woodpecker-agent-secret.files.my-secret.path;
|
"woodpecker-agent-docker"
|
||||||
# WOODPECKER_USERNAME = "x-oauth-basic";
|
];
|
||||||
# WOODPECKER_HOSTNAME = "https://woodpecker.fediversity.eu";
|
|
||||||
# WOODPECKER_MAX_WORKFLOWS = "4";
|
|
||||||
# WOODPECKER_LOG_LEVEL = "info";
|
|
||||||
# WOODPECKER_DEBUG_PRETTY = "false";
|
|
||||||
# WOODPECKER_DEBUG_NOCOLOR = "true";
|
|
||||||
# WOODPECKER_GRPC_SECURE = "false"; # TODO: fix
|
|
||||||
# WOODPECKER_GRPC_VERIFY = "false";
|
|
||||||
# WOODPECKER_HEALTHCHECK = "false";
|
|
||||||
# };
|
|
||||||
# in
|
|
||||||
{
|
|
||||||
|
|
||||||
# local
|
|
||||||
|
|
||||||
exec = {
|
|
||||||
enable = true;
|
|
||||||
path = with pkgs; [
|
|
||||||
git
|
|
||||||
git-lfs
|
|
||||||
woodpecker-plugin-git
|
|
||||||
bash
|
|
||||||
coreutils
|
|
||||||
nix
|
|
||||||
attic-client
|
|
||||||
];
|
|
||||||
environmentFile = [ config.vars.generators."templates".files."woodpecker-agent-exec.conf".path ];
|
|
||||||
# # https://woodpecker-ci.org/docs/administration/configuration/backends/local#environment-variables
|
|
||||||
# environment = lib.mkMerge [
|
|
||||||
# shared
|
|
||||||
# {
|
|
||||||
# WOODPECKER_BACKEND = "local";
|
|
||||||
# WOODPECKER_AGENT_LABELS = "type=local";
|
|
||||||
# WOODPECKER_AGENT_SECRET_FILE = config.age.secrets.woodpecker-agent-exec.path;
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# container
|
|
||||||
|
|
||||||
docker = {
|
|
||||||
enable = true;
|
|
||||||
environmentFile = [ config.vars.generators."templates".files."woodpecker-agent-podman.conf".path ];
|
|
||||||
# # https://woodpecker-ci.org/docs/administration/configuration/backends/docker#environment-variables
|
|
||||||
# environment = lib.mkMerge [
|
|
||||||
# shared
|
|
||||||
# {
|
|
||||||
# WOODPECKER_BACKEND = "docker";
|
|
||||||
# DOCKER_HOST = "unix:///run/podman/podman.sock";
|
|
||||||
# WOODPECKER_AGENT_LABELS = "type=docker";
|
|
||||||
# WOODPECKER_AGENT_SECRET_FILE = config.age.secrets.woodpecker-agent-container.path;
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking = {
|
||||||
22
|
firewall = {
|
||||||
80
|
enable = lib.mkForce true;
|
||||||
443
|
allowedTCPPorts = [
|
||||||
];
|
22
|
||||||
|
80
|
||||||
|
443
|
||||||
|
];
|
||||||
|
# needed for podman to be able to talk over dns
|
||||||
|
interfaces."podman0" = {
|
||||||
|
allowedUDPPorts = [ 53 ];
|
||||||
|
allowedTCPPorts = [ 53 ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# helps make sure DNS resolves from the containers
|
||||||
|
nftables.enable = lib.mkForce false;
|
||||||
|
};
|
||||||
|
|
||||||
virtualisation.podman = {
|
virtualisation.podman = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -293,11 +225,16 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
};
|
};
|
||||||
|
defaultNetwork.settings = {
|
||||||
|
dns_enabled = true;
|
||||||
|
ipv6_enabled = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.woodpecker-agent-docker = {
|
systemd.services = {
|
||||||
wants = [ "podman.socket" ];
|
woodpecker-agent-docker = {
|
||||||
after = [ "podman.socket" ];
|
wants = [ "podman.socket" ];
|
||||||
serviceConfig.SupplementaryGroups = [ "podman" ];
|
after = [ "podman.socket" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ concatMapAttrs
|
||||||
wiki-smtp-password = [ vm02187 ];
|
wiki-smtp-password = [ vm02187 ];
|
||||||
woodpecker-gitea-client = [ fedi203 ];
|
woodpecker-gitea-client = [ fedi203 ];
|
||||||
woodpecker-gitea-secret = [ fedi203 ];
|
woodpecker-gitea-secret = [ fedi203 ];
|
||||||
woodpecker-agent-exec = [ fedi203 ];
|
|
||||||
woodpecker-agent-container = [ fedi203 ];
|
woodpecker-agent-container = [ fedi203 ];
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
age-encryption.org/v1
|
|
||||||
-> ssh-ed25519 Jpc21A RkvPufUflL629g98PVMAPBhP8k53I7Q8I9Ij72ArdGI
|
|
||||||
+qsdje9Mir5g8p7vwCJRjSVlWgklnCwjQxxKxnEWaz8
|
|
||||||
-> ssh-ed25519 BAs8QA ezKlcV2uxteAeQSb90DuqN3pvEjQs/yHnApD5s+Kr2c
|
|
||||||
wtlZh2Q8nGL2FgaO1vcYIX+C8gplRGJovccGG7GbTZo
|
|
||||||
-> ssh-ed25519 ofQnlg esuCVxgKkSKR/58Rh8G7QBpa2WBY0Exh7yYqwFjJJS8
|
|
||||||
cmpO/zbhNqDxIzNlkTbeGazyI2rF6tG5asQgRIdLDdg
|
|
||||||
-> ssh-ed25519 COspvA x7OFSXwP27SgybnYy5b8WENz7moSRQDfr4QILI42SSs
|
|
||||||
Z9kSpxkon8xDCBzhZ98SG4rFnk1yGtG+qtAx3KdTBz0
|
|
||||||
-> ssh-ed25519 2XrTgw FrPAtSkVm6yspzCfXhrOTpXLiG4P4QRDTW9csbYeBnU
|
|
||||||
LVtwkz2GLfhnoB9tKorIC1U3THiPh+SURurxiDY9R64
|
|
||||||
-> ssh-ed25519 awJeHA Ra70XBRR/B2UdIQRzuNVlHzZ33FNRdwG8hCmlCrrIgo
|
|
||||||
RGe+toNMf9poReiLxYhJdKObNsGUF+D/iA/FZgVmwX8
|
|
||||||
-> ssh-ed25519 S1E+mw QriB2nKELdgIE6vUmA+GF+K2DKnIxliutWpzNjd+pwY
|
|
||||||
k9iA0OP2Meu9XewGABqTE1S5ohUQXvUTpyqhvPiOpVM
|
|
||||||
-> ssh-ed25519 i+ecmQ y3fiMshCkdSedW0zIp+xbgAHIYhKjtqrK6Aaif+DUnM
|
|
||||||
QuEkd8UXYDwWxvc0HRQFyJDdZh7QWBF2tl5xkEtOCaY
|
|
||||||
--- uxOW1G8fpvSDnwJDrYX+XS7FQZjmQwQddA50zax7qGo
|
|
||||||
µiÅ7 VìëCº_þ!œð¾ô¤ÞEüZØ<5A>‘@+;ãáåo‚†¹ÑN†é€<C3A9>| Kñ©À÷´ÞK–›B‡/û6ºjM$‘¾‡âw¼Î›tük
|
|
||||||
Loading…
Add table
Reference in a new issue