From 0b21b71ddcfd129eae2037af08d1fb5d78f546bd Mon Sep 17 00:00:00 2001 From: Daniel Sissom Date: Tue, 27 Aug 2024 16:13:31 -0500 Subject: [PATCH] Added readme to explain project setup. --- README.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f86c46c --- /dev/null +++ b/README.md @@ -0,0 +1,83 @@ +Example Web Server/Site Template +================================ + +------------------------------------------------- +Project Layout +------------------------------------------------- + +## Project Working Copy + +``` +~/Projects/Web/example.com/ # git repo (git ignore www) + | + |- docker-compose.yml + | + |- service/ + | | + | |- docker-compose.yml + | + |- www/ # git repo (git ignore build) + | | + | |- Makefile + | | + | |- index.pug + | | + | |- build/ # git repo (if not building target on server, e.g. static GitHub pages) + | | | + | | |- index.html + | | + | |- config/ +``` + +## Project Collaboration + +``` +git@examplecodehost.com:organization/example.com.git +git@examplecodehost.com:organization/www.example.com.git +``` + +## Server Deployment + +``` +/usr/local/src/web/example.com/ + | + |- server/ # bare git repo + | + |- www/ # bare git repo +``` + +``` +/srv/dev/example.com/ +/srv/beta/example.com/ +/srv/prod/example.com/ +``` + +In build upstream bare repo (webserver:/usr/local/src/web/example.com/www/), run: + # chown root:srv . + # chmod g+ws . + # setfacl -d -m g::rwx . + # git init --bare --shared=group + # git config receive.denyCurrentBranch updateInstead + # git config receive.denyNonFastForwards false + ?(# git config core.sharedRepository true) # if needed because of missing init option + +Set upstream and push branches to new bare repo, then run: + # git worktree add /srv/prod/example.com/www master + # git worktree add /srv/beta/example.com/www release + # git worktree add /srv/dev/example.com/www dev + + # chmod -R g+w . + # chmod g+w /srv/*/example.com/www + + + # chown -R root:srv . + # chmod -R g+swX . + # chown root:srv /srv/prod/example.com/www + # chmod g+swX /srv/prod/example.com/www + # chown root:srv /srv/beta/example.com/www + # chmod g+swX /srv/beta/example.com/www + # chown root:srv /srv/dev/example.com/www + # chmod g+swX /srv/dev/example.com/www +and add your user (on the server) to the srv group. + +