Compare commits

..

2 Commits

Author SHA1 Message Date
David Markowitz
6943e2048f remove md5 new
tested that sqlite hash is still calculated
2024-05-01 03:06:31 -07:00
Daniel Seiler
35c463656d Use volume for mariadb persistence (#1555)
I initially used the bind mount because it's arguably easier to back up and move around than a volume, but turns out with https://github.com/DarkflameUniverse/NexusDashboard/issues/92 it's nothing we can recommend for Docker Desktop on WSL, which unfortunately is the primary setup newcomers will try this with. So changing the default to be a volume should address that (presumably by hosting the volume within the WSL Docker VM, as opposed to the host NTFS filesystem)
2024-04-29 22:51:13 +02:00
2 changed files with 9 additions and 8 deletions

View File

@@ -282,24 +282,22 @@ int main(int argc, char** argv) {
}
const int32_t bufferSize = 1024;
MD5* md5 = new MD5();
MD5 md5;
char fileStreamBuffer[1024] = {};
while (!fileStream.eof()) {
memset(fileStreamBuffer, 0, bufferSize);
fileStream.read(fileStreamBuffer, bufferSize);
md5->update(fileStreamBuffer, fileStream.gcount());
md5.update(fileStreamBuffer, fileStream.gcount());
}
fileStream.close();
const char* nullTerminateBuffer = "\0";
md5->update(nullTerminateBuffer, 1); // null terminate the data
md5->finalize();
databaseChecksum = md5->hexdigest();
delete md5;
md5.update(nullTerminateBuffer, 1); // null terminate the data
md5.finalize();
databaseChecksum = md5.hexdigest();
LOG("FDB Checksum calculated as: %s", databaseChecksum.c_str());
}

View File

@@ -7,7 +7,7 @@ services:
- darkflame
image: mariadb:latest
volumes:
- ${DB_DATA_DIR:-./db/data}:/var/lib/mysql
- ${DB_DATA_DIR:-db-data}:/var/lib/mysql
environment:
- MARIADB_RANDOM_ROOT_PASSWORD=1
- MARIADB_USER=${MARIADB_USER:-darkflame}
@@ -79,3 +79,6 @@ services:
networks:
darkflame:
volumes:
db-data: