Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa3ddf78b6 | ||
|
|
0d60b85d13 | ||
|
|
5780fe2dc1 | ||
|
|
9a040ccf3d | ||
|
|
9d31b7c8b9 | ||
|
|
a28ecf6040 | ||
|
|
c6ccae1714 | ||
|
|
aee5dc4e4d | ||
|
|
f6a0500c82 | ||
|
|
3431573950 | ||
|
|
7ddd16e1cc | ||
|
|
0c85707b05 | ||
|
|
d4d10da461 | ||
|
|
86c698e39e | ||
|
|
7737f72328 |
No files matched your search
@@ -102,7 +102,7 @@ Confirm you have connectivity (`ping -c1 github.com`) before continuing.
|
|||||||
Clone the monorepo onto the live ISO and work from that local checkout:
|
Clone the monorepo onto the live ISO and work from that local checkout:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ git clone ssh://gitea@git.alexion.dev:2022/alexion/dev.git
|
$ git clone ssh://gitea@git.alexion.dev/alexion/dev.git
|
||||||
$ cd dev
|
$ cd dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
registry,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.guests.gitea;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.guests.gitea.dataPath = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
default = null;
|
||||||
|
example = "/srv/gitea";
|
||||||
|
description = "Host path mounted as Gitea's state directory.";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = cfg.dataPath != null;
|
||||||
|
message = "guests.gitea.dataPath must point at the host directory that stores Gitea state.";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
registry.homepage.${config.networking.hostName}.gitea = {
|
||||||
|
tab = "Apps";
|
||||||
|
section = "Other";
|
||||||
|
name = "Gitea";
|
||||||
|
description = "Git forge";
|
||||||
|
icon = "gitea.png";
|
||||||
|
};
|
||||||
|
|
||||||
|
guests.gitea = {
|
||||||
|
interior.modules.services.gitea = {
|
||||||
|
enable = true;
|
||||||
|
reverseProxyAddress = registry.address.${config.networking.hostName}."reverse-proxy";
|
||||||
|
};
|
||||||
|
|
||||||
|
mounts."/var/lib/gitea" = {
|
||||||
|
directory = cfg.dataPath;
|
||||||
|
owner = config.registry."stable-uid".${config.networking.hostName}.gitea;
|
||||||
|
group = "storage";
|
||||||
|
mode = "2770";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
registry,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
giteaSshBackend = "10.23.20.45:2022";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
config = lib.mkIf config.guests.reverse-proxy.enable {
|
config = lib.mkIf config.guests.reverse-proxy.enable {
|
||||||
guests.reverse-proxy = {
|
guests.reverse-proxy = {
|
||||||
@@ -13,11 +11,6 @@ in
|
|||||||
modules.services.reverse-proxy.enable = true;
|
modules.services.reverse-proxy.enable = true;
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
"git.alexion.dev" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/".proxyPass = "http://10.23.20.32";
|
|
||||||
};
|
|
||||||
"photos.alexion.dev" = {
|
"photos.alexion.dev" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
@@ -45,12 +38,12 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 2022 ];
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||||
|
|
||||||
services.nginx.streamConfig = ''
|
services.nginx.streamConfig = ''
|
||||||
server {
|
server {
|
||||||
listen 2022;
|
listen 22;
|
||||||
proxy_pass ${giteaSshBackend};
|
proxy_pass ${registry.address.${config.networking.hostName}.gitea}:2222;
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -96,6 +96,21 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
guests.gitea = {
|
||||||
|
enable = true;
|
||||||
|
vlan = 20;
|
||||||
|
address = "10.23.20.206";
|
||||||
|
dataPath = "/pikachu/data/gitea";
|
||||||
|
reverseProxy = {
|
||||||
|
enable = true;
|
||||||
|
route = {
|
||||||
|
domain = "git.alexion.dev";
|
||||||
|
protocol = "https";
|
||||||
|
port = 3000;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
guests.romm = {
|
guests.romm = {
|
||||||
enable = true;
|
enable = true;
|
||||||
vlan = 20;
|
vlan = 20;
|
||||||
|
|||||||
@@ -33,11 +33,14 @@ let
|
|||||||
});
|
});
|
||||||
|
|
||||||
extraTargets = {
|
extraTargets = {
|
||||||
# TODO: Pin Gitea's host key after migrating it from Proxmox.
|
|
||||||
gitea = {
|
gitea = {
|
||||||
hostName = "git.alexion.dev";
|
hostName = "git.alexion.dev";
|
||||||
port = 2022;
|
|
||||||
user = "gitea";
|
user = "gitea";
|
||||||
|
hostKeys = [
|
||||||
|
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFcUl17AcZz1wS8ek2yS/bu5NRTX4ViYTuFOSnp8leHmirP3Zk5QlC33hodQp09J6EA6Vl8zUowy4qLud7BMurQ="
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICkK2W2Ev+9RXa2PNXiNPPCPF5ln2+M2jHiGoZ4cPYxX"
|
||||||
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDZSeU1iRHoaIXgbYe0kAiOAASw9LrQhu54RNCoTQ2O1rbqgnnKO2qbYJvfmUWL7jqEkEotgUBy4Xqxgfl7rXGQ9viWZe+i2tKwJdGsabNLJ+QTDCNyGCd22s1Hhl7n68JvuLTENXl4WpH56MB3yjFmK9onLHHcLG+rWiR0I6Yn264LfNVX0RuZK7TlG0tUKJR5bQBXGT6PxAE1IceYRgbgM0BYq4nakNg/s4ZSpmJFrrGfCHNsnHiEmFAXRFrGwf+0ef2STDukM/ADLziPXu0Ge7k72/UPvtEdcpgvzIDMJ2EznKTnxIoZnFkrDqhGOo8DnXK+cFVKAkkC6NgWQpO6fNnY+MEDgSb0fr/rGcwzUa1p+fON5/zEYxsAtKyAeP4D7OEAo65lsSKqi1tbt521miTobp0NOT8p4tGgHTwmshbqlmUZz0DVexN6uc7yzoHu4V/oYomEWP/j/E2uuvLi57AaJbM3Z/oAHUtrHFK9A9FFggyzpETZE7qWA9BhO/pJQUsjdWRm0pUHsPlf9Uqqit2BKVERiMSlHsBKch4tIk4ryZBazWunDD+QFcllKG74nMVISZ7i8q9IfNy+PWQuJIEm5XrT9W5pnkBIWrePlcAcPo080ALigmyhH+WOPiyO+dfueeq6PVdu2Voc+6FvtylRcn4u8O+E5Wq5amvQAQ=="
|
||||||
|
];
|
||||||
aliases = [
|
aliases = [
|
||||||
"gitea"
|
"gitea"
|
||||||
"git.alexion.dev"
|
"git.alexion.dev"
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.modules.services.gitea;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.modules.services.gitea = {
|
||||||
|
enable = lib.mkEnableOption "Gitea";
|
||||||
|
|
||||||
|
reverseProxyAddress = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
default = null;
|
||||||
|
description = "IP address of the reverse proxy trusted to forward client headers.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
{
|
||||||
|
registry."stable-uid".${config.networking.hostName}.gitea = 20007;
|
||||||
|
}
|
||||||
|
|
||||||
|
(lib.mkIf cfg.enable {
|
||||||
|
users.users.gitea = {
|
||||||
|
isSystemUser = true;
|
||||||
|
uid = config.registry."stable-uid".${config.networking.hostName}.gitea;
|
||||||
|
group = "storage";
|
||||||
|
home = "/var/lib/gitea";
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
2222
|
||||||
|
3000
|
||||||
|
];
|
||||||
|
|
||||||
|
services.gitea = {
|
||||||
|
enable = true;
|
||||||
|
user = "gitea";
|
||||||
|
group = "storage";
|
||||||
|
stateDir = "/var/lib/gitea";
|
||||||
|
repositoryRoot = "/var/lib/gitea/repositories";
|
||||||
|
lfs = {
|
||||||
|
enable = true;
|
||||||
|
contentDir = "/var/lib/gitea/data/lfs";
|
||||||
|
};
|
||||||
|
database.type = "sqlite3";
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
HTTP_ADDR = "0.0.0.0";
|
||||||
|
HTTP_PORT = 3000;
|
||||||
|
ROOT_URL = "https://git.alexion.dev/";
|
||||||
|
SSH_DOMAIN = "git.alexion.dev";
|
||||||
|
SSH_PORT = 22;
|
||||||
|
START_SSH_SERVER = true;
|
||||||
|
SSH_LISTEN_HOST = "0.0.0.0";
|
||||||
|
SSH_LISTEN_PORT = 2222;
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs (cfg.reverseProxyAddress != null) {
|
||||||
|
REVERSE_PROXY_TRUSTED_PROXIES = "${cfg.reverseProxyAddress}/32";
|
||||||
|
};
|
||||||
|
service.DISABLE_REGISTRATION = true;
|
||||||
|
session.COOKIE_SECURE = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
||||||
Reference in new issue
Block a user