forked from katzen-cafe/katzen-cafe
do too many things lmao
This commit is contained in:
parent
c3695556c2
commit
3b666eee63
15 changed files with 555 additions and 87 deletions
|
@ -8,7 +8,7 @@
|
|||
networks.calcnet.name = "calcnet";
|
||||
services = {
|
||||
"web".service = {
|
||||
image = "docker.io/waterdev/calckey_arm";
|
||||
image = "iceshrimp.dev/iceshrimp/iceshrimp:latest-arm";
|
||||
container_name = "calckey_web";
|
||||
restart = "unless-stopped";
|
||||
depends_on = [ "db" "redis" ];
|
||||
|
@ -18,8 +18,8 @@
|
|||
"NODE_ENV" = "production";
|
||||
};
|
||||
volumes = [
|
||||
"/calckey/files:/calckey/files"
|
||||
"/calckey/config:/calckey/.config:ro"
|
||||
"/calckey/files:/iceshrimp/files"
|
||||
"/calckey/config:/iceshrimp/.config:ro"
|
||||
];
|
||||
};
|
||||
"redis".service = {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./katzencafe-wiki.nix
|
||||
./phtanumb-wiki.nix
|
||||
./calckey.nix
|
||||
./penpot.nix
|
||||
|
|
100
modules/containers/katzencafe-wiki.nix
Normal file
100
modules/containers/katzencafe-wiki.nix
Normal file
|
@ -0,0 +1,100 @@
|
|||
{ pkgsOld, ... }:
|
||||
{
|
||||
containers."katzenwiki" = {
|
||||
autoStart = true;
|
||||
privateNetwork = true;
|
||||
hostAddress = "10.0.2.1";
|
||||
localAddress = "10.0.2.2";
|
||||
bindMounts = {
|
||||
"/var/lib/mediawiki" = {
|
||||
hostPath = "/katzenwiki";
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
# extraVeths = {
|
||||
# "katzenwiki" = {
|
||||
# hostAddress = "10.0.2.1";
|
||||
# localAddress = "10.0.2.2";
|
||||
# };
|
||||
# };
|
||||
config = { config, pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs; [btop ];
|
||||
networking.firewall.enable = false;
|
||||
# networking.nameservers = [ "9.9.9.9" "149.112.112.112" ];
|
||||
environment.etc."resolv.conf".text = "nameserver 9.9.9.9";
|
||||
services.mediawiki = {
|
||||
enable = true;
|
||||
name = "katzenwiki";
|
||||
database = {
|
||||
type = "mysql";
|
||||
};
|
||||
virtualHost = {
|
||||
hostName = "wiki.katzen.cafe";
|
||||
adminAddr = "admin@katzen.cafe";
|
||||
listen = [
|
||||
{
|
||||
ip = "10.0.2.2";
|
||||
port = 80;
|
||||
ssl = false;
|
||||
}
|
||||
];
|
||||
};
|
||||
passwordFile = "/var/lib/mediawiki/passwordFile";
|
||||
extraConfig = ''
|
||||
# $wgShowExceptionDetails = true;
|
||||
# $wgDebugToolbar = true;
|
||||
# $wgShowDebug = true;
|
||||
# $wgDevelopmentWarnings = true;
|
||||
|
||||
# Disable anonymous editing
|
||||
$wgGroupPermissions['*']['edit'] = false;
|
||||
$wgGroupPermissions['oidc_interface_admin'] = $wgGroupPermissions['interface_admin'];
|
||||
$wgGroupPermissions['oidc_admin'] = $wgGroupPermissions['sysop'];
|
||||
$wgGroupPermissions['oidc_admin']['userrights'] = true;
|
||||
|
||||
$oidcClientSecret = file_get_contents('/var/lib/mediawiki/keycloakClientSecret', false, null, 0, 32);
|
||||
$wgPluggableAuth_Config[] = [
|
||||
'plugin' => 'OpenIDConnect',
|
||||
'data' => [
|
||||
'providerURL' => 'https://auth.katzen.cafe/realms/katzen.cafe',
|
||||
'clientID' => 'katzenwiki',
|
||||
# hack to try dynamically get the secret
|
||||
'clientsecret' => $oidcClientSecret,
|
||||
'global_roles' => ['property' => ['realm_access', 'roles']],
|
||||
'wiki_roles' => ['property' => ['resource_access', 'katzenwiki', 'roles']]
|
||||
]
|
||||
];
|
||||
'';
|
||||
extensions = {
|
||||
PluggableAuth = pkgs.fetchzip {
|
||||
url = "https://extdist.wmflabs.org/dist/extensions/PluggableAuth-REL1_39-068be5d.tar.gz";
|
||||
sha256 = "sha256-OWfr3oq2XzyJ5tynP5bRRPm34ymqz2oIBe2vBPHK+/Q=";
|
||||
};
|
||||
OpenIDConnect = pkgs.fetchzip {
|
||||
url = "https://extdist.wmflabs.org/dist/extensions/OpenIDConnect-REL1_39-42e4d75.tar.gz";
|
||||
sha256 = "sha256-g+PGNzt0o2FebI3xyVamz5RA95E86MD2yqD4v8N6zKU=";
|
||||
};
|
||||
WikiEditor = null;
|
||||
CodeEditor = null;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
};
|
||||
};
|
||||
deployment.keys = {
|
||||
# NOTE: for some reason, i ahd to manually chown +r the password file for mediawiki to work.
|
||||
# i should figure out why to make this work when setting up new instances...
|
||||
"katzenwikiPwFile" = {
|
||||
keyCommand = [ "cat" "/home/jade/keys-tmp/katzenwiki-passwordFile" ];
|
||||
destDir = "/katzenwiki";
|
||||
name = "passwordFile";
|
||||
};
|
||||
"katzenwikiKeycloakClientSecret" = {
|
||||
keyCommand = [ "cat" "/home/jade/keys-tmp/katzenwiki-keycloak-secret" ];
|
||||
destDir = "/katzenwiki";
|
||||
name = "keycloakClientSecret";
|
||||
permissions = "0604";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -9,6 +9,8 @@
|
|||
services = {
|
||||
"penpot-backend".service = {
|
||||
image = "penpotapp/backend:latest";
|
||||
# NOTE: you have to change the owner of the assets folder to 1001:1001
|
||||
# command: # chown -R 1001:1001 /penpot/assets
|
||||
volumes = [ "/penpot/assets:/opt/data/assets" ];
|
||||
depends_on = [ "penpot-postgres" "penpot-redis" ];
|
||||
networks = [ "penpot" ];
|
||||
|
|
|
@ -1,40 +1,42 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgsOld, ... }:
|
||||
{
|
||||
containers."phtanumb-wiki" = {
|
||||
autoStart = true;
|
||||
hostAddress = "127.0.0.1";
|
||||
privateNetwork = true;
|
||||
hostAddress = "10.0.1.1";
|
||||
localAddress = "10.0.1.2";
|
||||
nixpkgs = pkgsOld.path;
|
||||
bindMounts = {
|
||||
"/var/mediawiki" = {
|
||||
hostPath = "/phtanum-b/wiki";
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
forwardPorts = [
|
||||
{
|
||||
protocol = "tcp";
|
||||
hostPort = 5432;
|
||||
containerPort = 5432;
|
||||
}
|
||||
{
|
||||
protocol = "tcp";
|
||||
hostPort = 8081;
|
||||
containerPort = 8081;
|
||||
}
|
||||
];
|
||||
# extraVeths = {
|
||||
# "phtanumb" = {
|
||||
# hostAddress = "10.0.1.1";
|
||||
# localAddress = "10.0.1.2";
|
||||
# };
|
||||
# };
|
||||
config = { config, pkgs, ... }: {
|
||||
environment.systemPackages = with pkgs; [ luajit ];
|
||||
networking.firewall.enable = false;
|
||||
# networking.nameservers = [ "9.9.9.9" "149.112.112.112" ];
|
||||
environment.etc."resolv.conf".text = "nameserver 9.9.9.9";
|
||||
services.mediawiki = {
|
||||
enable = true;
|
||||
name = "phtanum-b";
|
||||
virtualHost.listen = [
|
||||
{
|
||||
ip = "127.0.0.2";
|
||||
port = 8081;
|
||||
ssl = false;
|
||||
}
|
||||
];
|
||||
virtualHost.hostName = "wiki.phtanum-b.katzen.cafe";
|
||||
virtualHost.adminAddr = "admin@katzen.cafe";
|
||||
virtualHost = {
|
||||
hostName = "wiki.phtanum-b.katzen.cafe";
|
||||
adminAddr = "admin@katzen.cafe";
|
||||
listen = [
|
||||
{
|
||||
ip = "10.0.1.2";
|
||||
port = 80;
|
||||
ssl = false;
|
||||
}
|
||||
];
|
||||
};
|
||||
passwordFile = "/var/mediawiki/passwordFile";
|
||||
extraConfig = ''
|
||||
# $wgShowExceptionDetails = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue