mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-21 11:25:56 +00:00
feat: database access through the container for Docker installations
Db runs mysql, mysqldump and mysqladmin inside the database container with docker exec -i when the server folder is a Docker installation, connecting over TCP on the container's loopback like the repack's commands do on the host. The password still travels only in MYSQL_PWD. Every caller keeps using Db unchanged (accounts, backups, population, migrations, the RA service account), and the host needs no MySQL client. The repack path is untouched: one line before its tools are looked up. A stopped container or a missing one is reported as a database that is not running. Tested: 4 new tests (commands built for the container, no password on a command line, repack unchanged, error classification), and a real run against the Docker folder: SQL queries, a quick backup (156 characters tables), restore with the previous database kept, a damaged backup refused, the RA service account created by SQL, the world server console reached through its published loopback port, an account created through it and listed by the Manager.
This commit is contained in:
1 parent
162bfd1e04
commit
58b5ddeb07
3 files changed
+127
-6
No files matched your search
@@ -92,6 +92,11 @@ impl Config {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Name of the database container (the one `docker exec` talks to).
|
||||
pub(crate) fn database_container(&self) -> String {
|
||||
self.names().db
|
||||
}
|
||||
|
||||
pub(crate) fn names(&self) -> Names {
|
||||
let p = &self.project;
|
||||
Names { network: format!("coa-{p}"), volume: format!("coa-{p}-db"), db: format!("coa-{p}-db"), world: format!("coa-{p}-world"), auth: format!("coa-{p}-auth") }
|
||||
|
||||
Reference in new issue
Block a user