I'm interested in building the same but if yours already works well then I see no point in duplicating important work.
Here's a gist to the script: https://gist.github.com/sklarsa/845152721ee9292eb01f70756b89...
As for gitea, I'm just hosting it using Docker and orchestrating using a simple docker-compose file that maps the gitea data directory to a Volume on the synology: https://gist.github.com/sklarsa/0dd6d6094dac6bf6e7bf61df9ca5...
It's all hosted on my private network at home.