Deploy Forgejo trial instance
This commit is contained in:
parent
ff560ea84c
commit
b49138d95a
4 changed files with 580 additions and 0 deletions
66
modules/forgejo.nix
Normal file
66
modules/forgejo.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
services.forgejo = {
|
||||
enable = true;
|
||||
package = pkgs.forgejo-lts;
|
||||
|
||||
stateDir = "/var/lib/forgejo";
|
||||
repositoryRoot = "/var/lib/forgejo/repositories";
|
||||
|
||||
database = {
|
||||
type = "sqlite3";
|
||||
path = "/var/lib/forgejo/data/forgejo.db";
|
||||
};
|
||||
|
||||
lfs.enable = false;
|
||||
|
||||
settings = {
|
||||
server = {
|
||||
PROTOCOL = "http";
|
||||
HTTP_ADDR = "127.0.0.1";
|
||||
HTTP_PORT = 3001;
|
||||
|
||||
DOMAIN = "git.tobiasostner.de";
|
||||
ROOT_URL = "https://git.tobiasostner.de/";
|
||||
|
||||
SSH_DOMAIN = "git.tobiasostner.de";
|
||||
SSH_PORT = 22;
|
||||
SSH_USER = "forgejo";
|
||||
START_SSH_SERVER = false;
|
||||
};
|
||||
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
session.COOKIE_SECURE = true;
|
||||
|
||||
actions.ENABLED = false;
|
||||
packages.ENABLED = false;
|
||||
mailer.ENABLED = false;
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."git.tobiasostner.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
extraConfig = ''
|
||||
merge_slashes off;
|
||||
'';
|
||||
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:3001";
|
||||
extraConfig = ''
|
||||
client_max_body_size 512M;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Connection $http_connection;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.forgejo-lts ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue