feat(self_host/git): moving from gitea to forgejo
This commit is contained in:
parent
94af056548
commit
997042d9be
1 changed files with 43 additions and 35 deletions
|
|
@ -1,49 +1,57 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
giteaDomain = "git.enium.eu";
|
gitDomain = "git.enium.eu";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.gitea = {
|
services = {
|
||||||
enable = true;
|
forgejo = {
|
||||||
appName = "Enium Git";
|
enable = true;
|
||||||
user = "gitea";
|
database.type = "postgres";
|
||||||
group = "gitea";
|
|
||||||
database.type = "sqlite3";
|
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
server = {
|
server = {
|
||||||
DOMAIN = giteaDomain;
|
"DEFAULT.APP_NAME" = "Enium Git";
|
||||||
ROOT_URL = "https://${giteaDomain}/";
|
"DEFAULT.APP_SLOGAN" = "Born2Code";
|
||||||
SSH_PORT = 42131;
|
DOMAIN = gitDomain;
|
||||||
HTTP_ADDR = "127.0.0.1";
|
ROOT_URL = "https://${gitDomain}/";
|
||||||
HTTP_PORT = 3042;
|
SSH_PORT = 42131;
|
||||||
DISABLE_REGISTRATION = true;
|
HTTP_ADDR = "127.0.0.1";
|
||||||
ALLOW_ONLY_EXTERNAL_REGISTRATION = true;
|
HTTP_PORT = 3042;
|
||||||
SHOW_REGISTRATION_BUTTON = false;
|
DISABLE_REGISTRATION = true;
|
||||||
DISABLE_REGULAR_LOGIN = true;
|
ALLOW_ONLY_EXTERNAL_REGISTRATION = true;
|
||||||
};
|
SHOW_REGISTRATION_BUTTON = false;
|
||||||
|
DISABLE_REGULAR_LOGIN = true;
|
||||||
|
};
|
||||||
|
|
||||||
service = {
|
oauth2 = {
|
||||||
DISABLE_REGISTRATION = true;
|
ENABLED = true;
|
||||||
ALLOW_ONLY_EXTERNAL_REGISTRATION = true;
|
NAME = "Enium";
|
||||||
};
|
CLIENT_ID = "forgejo";
|
||||||
|
CLIENT_SECRET = "${config.age.secrets.forgejo-oidc-secret.path}";
|
||||||
|
SCOPES = "openid email profile groups";
|
||||||
|
LOGIN_ATTRIBUTE_PATH = "preferred_username";
|
||||||
|
AUTH_URL = "https://git.enium.eu/ui/oauth2";
|
||||||
|
TOKEN_URL = "https://git.enium.eu/oauth2/token";
|
||||||
|
API_URL = "https://git.enium.eu/oauth2/openid/forgejo/userinfo";
|
||||||
|
CODE_CHALLENGE_METHOD = "S256";
|
||||||
|
ENABLE_AUTO_REGISTRATION = true;
|
||||||
|
UPDATE_AVATAR = true;
|
||||||
|
};
|
||||||
|
|
||||||
web = {
|
security = {
|
||||||
DISABLE_LOCAL_LOGIN = true;
|
LOGIN_REMEMBER_DAYS = 14;
|
||||||
};
|
};
|
||||||
|
|
||||||
oauth2_client = {
|
|
||||||
ENABLE_AUTO_REGISTRATION = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."${giteaDomain}" = {
|
nginx.virtualHosts."${gitDomain}" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:3042";
|
proxyPass = "http://127.0.0.1:3042";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue