clowzed / sero

Sero is a web server that allows you to easily host your static sites without pain. The idea was inspired by surge.sh but gives you full control.
https://clowzed.github.io/sero-docs/
MIT License
26 stars 1 forks source link

optional flat file backend would be nice #15

Closed jonassmedegaard closed 3 months ago

jonassmedegaard commented 10 months ago

This looks like a quite nice tool. But unfortunately it is not really as lightweight as I would prefer for my self-hosted needs.

Would be nice if the use of Postgres SQL was made optional - i.e. if possible to compile with a backend consisting of a directory with plain files. I imagine that would be slightly slower, but for users of merely hundreds (not thousands) of non-SQL-needing sites it might be beneficial.

clowzed commented 10 months ago

Hello @jonassmedegaard. Thank you very much for your offer! I have a few questions that would help improve this software

1) You said that it is not lightweight enough for your needs. What do you mean by this? Is the image size too large (maybe I should change postgres:latest to alpine)? Or you do not have enough ram to run this project?

2) The idea with flat files can be implemented. Perhaps you can offer an idea for the architects, I mean how each request (its flow) will be processed.

PS. I should add that the downloaded files are stored on the operating system; the database stores information such as login and password, a list of file paths for the subdomain and CORS settings

jonassmedegaard commented 10 months ago

Sorry if I was unclear: I did not offer a flat file backend, I only suggest it - as an idea for you (or anyone) to implement.

What I mean by lightweight is the sum of all resources consumed on the server host: A system that involves running an SQL service will undoubtedly consume more disk space and/or CPU and/or memory than a system keeping track of its sites using e.g. a pile of TOML files.

It seems you are mimicking (or at least heavily inspired by) an existing framework for spawning sites, and I am not familiar with that, so cannot tell in detail how all mechanics could be covered using flat files. What I do now is hand-edit Apache2 configs on tiny 32bit i686 and armel systems with 2-4 GB RAM each. I have one file for each site - even if that one site can be accessed by multiple means (e.g. both http and https and perhaps also http+haproxy) and even if that one site can be accessed as multiple hostnames (e.g. both as a public .org site and an internal .local site).

clowzed commented 3 months ago

Closing. If someone will have time to implement it - he can take a chance.