azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
3.65k stars 130 forks source link

[FEAT]: Use more logic operators for cosmos-compose.json #312

Open eralumin opened 2 months ago

eralumin commented 2 months ago

Feature Description

Current template engine for cosmose-compose.json seems to use whiskers.js which has some limitations, and/or operators are not implemented and the project itself seems dead.

madejackson commented 2 months ago

I'd support this. whiskers.js is too limited. Several template frameworks I used in the past, f.e. mustache or jinja, are more feature rich.

Porting the json-files from whiskers to jinja f.e. should be fairly easy (simple regex replace). mustache probably not so much as it's logic-less and hence would have to be done manually.

azukaar commented 2 months ago

While I do agree that improvement can be made, it would need to be done in a way that keeps the retro-compatibility with existing cosmos-compose, which I think is quite a challenge and is not possible by just "migrating" all the files to a new format, because there are multiple stores out there that i not maintained by me

madejackson commented 2 months ago

I think at least in the case of jinja, this should be doable with a simple translation layer for a limited time period to give maintainers enough time to update their repos. I could support you with doing the necessary PR's in the publicly known repos.