Skip to content

Commit dfe55bc

Browse files
Merge pull request #295 from mapswipe/docs
Add contributing guidelines to README & Change certbot renewal setup docs.
2 parents dd7b8df + 42527bd commit dfe55bc

File tree

2 files changed

+42
-22
lines changed

2 files changed

+42
-22
lines changed

README.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,48 @@ Please refer to the documentation for more information: https://mapswipe-workers
1515

1616
## Ressources
1717

18-
- GitHub repository of the MapSwipe Back-End: https://github.com/mapswipe/python-mapswipe-workers
19-
- GitHub repository of the MapSwipe Website: https://github.com/mapswipe/mapswipe.github.io
20-
- GitHub repository of the MapSwipe App https://github.com/mapswipe/mapswipe
21-
- Website of MapSwipe: https://mapswipe.org
22-
- OSM-Wiki page of MapSwipe: https://wiki.openstreetmap.org/wiki/MapSwipe
18+
- MapSwipe Back-End: https://github.com/mapswipe/python-mapswipe-workers
19+
- MapSwipe App https://github.com/mapswipe/mapswipe
20+
- MapSwipe Website: https://mapswipe.org
21+
- MapSwipe OSM-Wiki: https://wiki.openstreetmap.org/wiki/MapSwipe
22+
23+
24+
## Contributing Guidelines
25+
26+
### Feature Branch
27+
28+
To contribute to the MapSwipe back-end please create dedicated feature branches based on the `dev` branch. After the changes create a Pull Request of the `feature` branch into the `dev` branch on GitHub:
29+
30+
```bash
31+
git checkout dev
32+
git checkout -b featureA
33+
# Hack away ...
34+
git commit -am 'Describe changes.'
35+
git push -u origin featureA
36+
# Create a Pull Request from feature branch into the dev branch on GitHub.
37+
```
38+
39+
> Note: If a bug in production (master branch) needs fixing before a new versions of MapSwipe Workers gets released (merging dev into master branch), a hotfix branch should be created. In the hotfix branch the bug should be fixed and then merged with the master branch (and also dev).
40+
41+
42+
### Style Guide
43+
44+
This project uses [black](https://github.com/psf/black) and [flake8](https://gitlab.com/pycqa/flake8) to achieve a unified style.
45+
46+
Use [pre-commit](https://pre-commit.com/) to run `black` and `flake8` prior to any git commit. `pre-commit`, `black` and `flake8` should already be installed in your virtual environment since they are listed in `requirements.txt`. To setup pre-commit simply run:
47+
48+
```
49+
pre-commit install
50+
```
51+
52+
From now on `black` and `flake8` should run automatically whenever `git commit` is executed.
2353

2454

2555
## License
2656

2757
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details
2858

59+
2960
## Authors
3061

3162
* **Benjamin Herfort** - HeiGIT - [Hagellach37](https://github.com/Hagellach37)
@@ -34,6 +65,7 @@ This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENS
3465

3566
See also the list of [contributors](contributors.md) who participated in this project.
3667

68+
3769
## Acknowledgements
3870

3971
* Humanitarian organizations can't help people if they can't find them.

docs/source/installation.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -251,28 +251,16 @@ certbot certonly \
251251
--non-interactive
252252
```
253253

254+
> Note: Certbot systemd timer for renewal of certificate will not work for standalone certificates because the service (docker nginx) which occupies port 80 has to be stopped before renewal.
254255
255-
Enable and start Certbot systemd timer for renewal of certificates:
256+
For certificate renewal a cronjob is used:
256257

257258
```bash
258-
systemctl enable certbot.timer
259-
systemctl start certbot.timer
260-
# To check if certbot.timer is enabled run:
261-
systemctl list-units --type timer | grep certbot
262-
```
263-
264-
Add renewal post hook to reload nginx after certificate renwal:
265-
266-
- `mkdir -p /etc/letsencrypt/renewal-hooks/deploy`
267-
- `vim /etc/letsencrypt/renewal-hooks/deploy/nginx`
259+
SHELL=/bin/sh
260+
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
268261

262+
0 */12 * * * certbot -q renew --pre-hook "docker stop nginx" --post-hook "docker start nginx"
269263
```
270-
#!/usr/bin/env bash
271-
272-
docker container restart nginx
273-
```
274-
275-
- `chmod +x /etc/letsencrypt/renewal-hooks/deploy/nginx`
276264

277265

278266
### Nginx

0 commit comments

Comments
 (0)