Open gabboman opened 3 weeks ago
I'll try to write a Dockerfile for it or something
Okay, so the issue is that the way Wafrn is configured is a bit annoying, because the installer script does a ton of work that should optimally be done by the user (editing the environment.ts file, setting up a reverse proxy and database, etc.)
So if you want a Docker build then users will have to also remember to set up a MySQL container (which is very easy) and Apache or their favorite reverse proxy (and certbot if they're using a Stone Age proxy)
Otherwise installation + running + healthcheck + running + updates can be done very easily with a Docker build.
there is a docker-compose, it has a postgres thing i use for dev. if you can also use that container it would be neat @CPlusPatch
Oh totally, you'll be able to add the wafrn
container to that docker-compose
file fine.
Also, I'm not sure why you have to do that forceSync
thing, but that will need to either be turned into a config option or outright removed (which would be better).
There are many ways to synchronize the database schema without losing any data
Also, I'm not sure why you have to do that
forceSync
thing, but that will need to either be turned into a config option or outright removed (which would be better).There are many ways to synchronize the database schema without losing any data
yeah probably there is a better way of doing this with sequelize but im not sure haha
Try looking for a feature called “migrations” in whatever ORM you use, that might solve the problem
this basicaly is a "force first db creation" thing but yeah. I could create a script that is "setupDatabase" or something like that
Yeah it creates all the necessary tables and columns right?
and the admin user (equivalent of instance actor lol) and deleted user
So you can fix this by setting forceSync to false
and removing the instruction to set it to true
(it will still create tables and columns if they don't exist).
Then, to create the relevant admin and deleted users, you can run a check on startup to see if they exist: if not, create them (this also acts as a brick protection I guess)
Relevant Sequelize docs -> https://sequelize.org/docs/v7/models/model-synchronization/
@CPlusPatch I have improved the thing :D I hope this can help a bit
oh shit i forgot :trollface:
If you take a look to the install guide, besides being a bit outdated is hard to replicate. I need a way of easily serving the backend for people wanting to host their own wafrn.
Would be ok to add a initialize command that compiled the backend. I may need to add some changes so by default, the frontend always go for /api and stuff like that, but please let me know about this