mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-03-29 17:27:24 -04:00
get the framework for the wordpress sites into a file
This commit is contained in:
parent
fb241568a2
commit
5015c369b4
2 changed files with 77 additions and 0 deletions
71
modules/quadlets/flamesites/default.nix
Normal file
71
modules/quadlets/flamesites/default.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
volumePath = "/overseer/services";
|
||||
swPort = lib.custom.autoport "swgalaxysite";
|
||||
bandPort = lib.custom.autoport "flamebandsite";
|
||||
in
|
||||
{
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${volumePath}/flamesites 0750 crow"
|
||||
"d ${volumePath}/flamesites/swgalaxyproject 0750 crow"
|
||||
"d ${volumePath}/flamesites/nnsbluegrass 0750 crow"
|
||||
"d ${volumePath}/flamesites/swgalaxyproject/dbBackups 0750 crow"
|
||||
"d ${volumePath}/flamesites/nnsbluegrass/dbBackups 0750 crow"
|
||||
];
|
||||
|
||||
systemd.timers.flamesite-backup = {
|
||||
enable = true;
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "1hr";
|
||||
OnUnitActiveSec = "1hr";
|
||||
Unit = "flamesite-backup.service";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.flamesite-backup = { # TODO: Remove when replication setup
|
||||
script = ''
|
||||
${pkgs.podman}/bin/podman exec swgal_db_1 sh -c 'exec mysqldump --no-tablespaces -usgr_user -psgr_pass sgr_db' > ${volumePath}/flamesites/swgalaxyproject/dbBackups/db.sql
|
||||
${pkgs.podman}/bin/podman exec nnsbluegrass_db_1 sh -c 'exec mysqldump --no-tablespaces -unns_user -pnns_pass nns_db' > ${volumePath}/flamesites/nnsbluegrass/dbBackups/db.sql
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "crow";
|
||||
};
|
||||
};
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts = {
|
||||
"swgalaxyproject.com".extraConfig = ''
|
||||
reverse_proxy http://localhost:${builtins.toString swPort}
|
||||
'';
|
||||
"nnsbluegrass.com".extraConfig = ''
|
||||
reverse_proxy http://localhost:${builtins.toString bandPort}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.quadlet = {
|
||||
containers = {
|
||||
swgalaxysite.containerConfig = {
|
||||
image = "wordpress";
|
||||
publishPorts = [
|
||||
"${builtins.toString swPort}:80"
|
||||
];
|
||||
# TODO: Need to actually store secrets in a safe manner here when we cutover
|
||||
};
|
||||
flamebandsite.containerConfig = {
|
||||
image = "wordpress";
|
||||
publishPorts = [
|
||||
"${builtins.toString bandPort}:80"
|
||||
];
|
||||
# TODO: Need to actually store secrets in a safe manner here when we cutover
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue