mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-03-23 06:21:31 -04:00
migrate sites to central db
This commit is contained in:
parent
09fac5ab72
commit
5322e95d73
4 changed files with 39 additions and 26 deletions
10
hosts/nixos/HandlerOne/database.nix
Normal file
10
hosts/nixos/HandlerOne/database.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
mycli
|
||||
];
|
||||
|
||||
services.mysql = {
|
||||
enable = true;
|
||||
package = pkgs.mariadb_118;
|
||||
};
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
# FIXME(TODO): Turn this into it's own backup module
|
||||
./backup.nix
|
||||
./database.nix
|
||||
|
||||
# Disks
|
||||
inputs.disko.nixosModules.disko
|
||||
|
|
|
|||
|
|
@ -59,13 +59,13 @@ in
|
|||
];
|
||||
# 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
|
||||
};
|
||||
# flamebandsite.containerConfig = {
|
||||
# image = "wordpress";
|
||||
# publishPorts = [
|
||||
# "${builtins.toString bandPort}:80"
|
||||
# ];
|
||||
# # TODO: Need to actually store secrets in a safe manner here when we cutover
|
||||
# };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
volumePath = "/overseer/services";
|
||||
maintFile = lib.custom.relativeToRoot "assets/maint.html";
|
||||
in
|
||||
{
|
||||
systemd.tmpfiles.rules = [
|
||||
|
|
@ -13,26 +15,26 @@ in
|
|||
"d ${volumePath}/flamesites/nnsbluegrass 0750 crow"
|
||||
];
|
||||
|
||||
systemd.timers.flamesite-backup = {
|
||||
enable = true;
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "1hr";
|
||||
OnUnitActiveSec = "1hr";
|
||||
Unit = "flamesite-backup.service";
|
||||
};
|
||||
};
|
||||
# systemd.timers.flamesite-backup = {
|
||||
# enable = false;
|
||||
# wantedBy = [ "timers.target" ];
|
||||
# timerConfig = {
|
||||
# OnBootSec = "1hr";
|
||||
# OnUnitActiveSec = "1hr";
|
||||
# Unit = "flamesite-backup.service";
|
||||
# };
|
||||
# };
|
||||
|
||||
systemd.services.flamesite-backup = {
|
||||
script = ''
|
||||
${pkgs.podman}/bin/podman exec swgal_db_1 sh -c 'exec mysqldump --no-tablespaces -usgr_user -psgr_pass sgr_db' > ${volumePath}/flamesites/swgalaxyproject/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/db.sql
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "crow";
|
||||
};
|
||||
};
|
||||
# systemd.services.flamesite-backup = {
|
||||
# # ${pkgs.podman}/bin/podman exec swgal_db_1 sh -c 'exec mysqldump --no-tablespaces -usgr_user -psgr_pass sgr_db' > ${volumePath}/flamesites/swgalaxyproject/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/db.sql
|
||||
# script = ''
|
||||
# '';
|
||||
# serviceConfig = {
|
||||
# Type = "oneshot";
|
||||
# User = "crow";
|
||||
# };
|
||||
# };
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue