added reverse proxy + acme
This commit is contained in:
parent
12f5f682d1
commit
3028efad4f
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
boot.isContainer = true;
|
boot.isContainer = true;
|
||||||
# creates /sbin/init
|
boot.loader.initScript.enable = true; ## creates /sbin/init
|
||||||
boot.loader.initScript.enable = true;
|
|
||||||
nix.useSandbox = false;
|
nix.useSandbox = false;
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./modules/nix.nix
|
./modules/nix.nix
|
||||||
./modules/networking.nix
|
./modules/networking.nix
|
||||||
./modules/gitea.nix
|
./modules/gitea.nix
|
||||||
|
./modules/nginx.nix
|
||||||
|
|
||||||
./modules/admin.nix
|
./modules/admin.nix
|
||||||
./modules/ssh.nix
|
./modules/ssh.nix
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#/usr/bin/env bash -e
|
#/usr/bin/env bash -e
|
||||||
|
|
||||||
DUMP=gitea-dump-1630784448
|
DUMP=gitea-dump-1633035257
|
||||||
USER=gitea
|
USER=gitea
|
||||||
DATABASE=gitea
|
DATABASE=gitea
|
||||||
|
|
||||||
|
@ -10,9 +10,10 @@ unzip gitea-repo.zip
|
||||||
|
|
||||||
systemctl stop gitea
|
systemctl stop gitea
|
||||||
|
|
||||||
|
rm -r /var/lib/gitea/repositories/*
|
||||||
mv gitea-repositories/* /var/lib/gitea/repositories/
|
mv gitea-repositories/* /var/lib/gitea/repositories/
|
||||||
chown -R gitea:gitea /var/lib/gitea
|
chown -R gitea:gitea /var/lib/gitea
|
||||||
|
|
||||||
psql -U $USER -d $DATABASE < gitea-db.sql
|
sudo -u gitea psql -U $USER -d $DATABASE < gitea-db.sql
|
||||||
|
|
||||||
systemctl start gitea
|
systemctl start gitea
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
START_SSH_SERVER = true;
|
START_SSH_SERVER = true;
|
||||||
SSH_DOMAIN = domain;
|
SSH_DOMAIN = domain;
|
||||||
SSH_PORT = ssh.clonePort;
|
SSH_PORT = ssh.clonePort;
|
||||||
|
ENABLE_GZIP = true;
|
||||||
};
|
};
|
||||||
mailer = {
|
mailer = {
|
||||||
ENABLED = true;
|
ENABLED = true;
|
||||||
|
@ -45,6 +46,12 @@
|
||||||
REGISTER_EMAIL_CONFIRM = true;
|
REGISTER_EMAIL_CONFIRM = true;
|
||||||
ENABLE_NOTIFY_MAIL = true;
|
ENABLE_NOTIFY_MAIL = true;
|
||||||
};
|
};
|
||||||
|
database = {
|
||||||
|
LOG_SQL = false;
|
||||||
|
};
|
||||||
|
time = {
|
||||||
|
DEFAULT_UI_LOCATION = config.time.timeZone;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
security.acme = {
|
||||||
|
email = "admin@c3d2.de";
|
||||||
|
acceptTerms = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
virtualHosts."gitea.c3d2.de" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/".proxyPass = "http://localhost:3000";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue