Codeberg might be the ideal candidate for FOSS projects, especially as Gitea is going to support decentralized forges.
Regarding analytics, <https://goaccess.io/> runs locally on the webserver and generates static HTML pages that can be served without any security risk. No javascript, no 3rd party services.
