if you want full opensource, Headscale (opensource self-hosted version of Tailscale)
You should look at Freedombox. You could run your box over an onion address on TOR. With Yunohost you will have a lot of stuff you don’t need running.
I am thinking of trying to run a server without Yunohost in the future, too. I don’t need XMPP, Yunohost settings, or email. It would be nice to have some toggles to disable some things that we don’t really need but some are so integral to how Yunohost runs, it is probably impossible.
Old, bitter grandpa rant : people think the word “secure” alone means something, but it means nothing without a threat model. Hell you can’t even be secure against everything all at once, because sometimes the security measures you should put in place for 2 different threats are effectively opposite.
Security is very often associated with a cost in usability.
Based on your description, you seem to have requirements similar to top-secret military project, so are you really willing to put all that effort … Saying this also because people often want the MAXIMUM security (assuming this even means something… again, security against what?) without realizing the practical implications.
That’s a big one, at least for example because this means you can’t automatically get a Lets Encrypt certificate (which requires port 80 to be forwarded). I guess you can live with a self-signed cert but
I guess you could have your phone connect via a VPN … but even then your VPN needs some sort of external endpoint to attach to, one way or another …
Yyyyyeah … Well if you’re not using Lets Encrypt certificates, you’re gonna at least one day want updates, which means relying on third party such as yunohost or debian repositories …
And I’m pretty sure you could find a dozen of external service which you need one way or another, such as DNS resolvers, npm/pip/git repositories, etc …
There are plenty of stuff people don’t need in their home computer or smartphone, yet people don’t go full “I’m gonna build my own computer”, so what exactly are you trying to achieve with this … The point of YunoHost (or your home computer, or your car) is that it should just work so you can focus with what matter in life instead of spending literally thousands of hours on boring technical shit