MBBSEmu icon indicating copy to clipboard operation
MBBSEmu copied to clipboard

[MBBSEmu] MBBSEmu - read/write file remapping to support proper containerization

Open brianmiller opened this issue 4 years ago • 6 comments

In order to better support containerization it would be great to have the ability to map all read/write files (e.g. databases) via appsettings.json.

We already have "Database.File" giving us this benefit for "mbbsemu.db" as well as the ability to assign unique activation codes for individual modules.

An example of what I was thinking:

{ "GSBL.BTURNO": "12345678", "GSBL.BTURNO.RTSLORD": "87654321",

"Database.File": "/opt/mbbsemu/databases/mbbsemu/mbbsemu.db", "Database.File.BBSUSR": "/opt/mbbsemu/databases/mbbsemu/BBSUSR.DB", "Database.File.BBSGEN": "/opt/mbbsemu/databases/mbbsemu/BBSGEN.DB", "Database.File.HVSXROAD": "/opt/mbbsemu/databases/modules/HVSXROAD/HVSXPLAY.DB", "Database.File.RTSLORD": "/opt/mbbsemu/databases/modules/RTSLORD/RTSLORD.DB", }

This way, we know we just need to backup the "databases" persistent volume in this example.

brianmiller avatar Nov 18 '20 21:11 brianmiller

Would you prefer explicit paths for each module like you've outlined, or would a common directory be sufficient?

Something like this:

"Database.Directory": "/opt/mbbsemu/databases"

Then all database files are either relative to that, or absolute if given an absolute path

fletcherm avatar Nov 18 '20 22:11 fletcherm

That works! That would make it even easier to backup.

brianmiller avatar Nov 18 '20 22:11 brianmiller

Then I'd argue that whoever implements it gets to pick...I don't feel strongly about it one way or another either :)

fletcherm avatar Nov 18 '20 22:11 fletcherm

Modules also read/write random files as well, are you talking about a separate read/write path that differs from a read-only path for example (modules/dlls/binaries)?

paladine avatar Nov 18 '20 22:11 paladine

@paladine Yeah, I'm referring to sqlite files only. I don't think we can control that fact that some modules, like RTSLORD, like to piss text files all over the place.

fletcherm avatar Nov 18 '20 22:11 fletcherm

Modules also read/write random files as well, are you talking about a separate read/write path that differs from a read-only path for example (modules/dlls/binaries)?

I wasn't sure if this was true or not--I suspected other files may be written to as well. Writing to files in a read-only container works fine--as long as it isn't important data upon the next restart.

Any written data that needs to be permanently stored, I.e., accounting, highscores, etc... are truly the only files that need to be persistent. Transient data that is either written to a file or memory then picked up my MBBSEmu's engine and written to a database don't need to be stored persistently--those are more of a working file, for the current execution.

brianmiller avatar Nov 18 '20 22:11 brianmiller