mailcow-dockerized-docs/docs/third_party-gogs.md

53 Zeilen
1,9 KiB
Markdown

2017-05-06 00:22:26 +02:00
With Gogs' ability to authenticate over SMTP it is trivial to integrate it with mailcow. Few changes are needed:
2018-05-15 10:46:34 +02:00
1\. Open `docker-compose.override.yml` and add Gogs:
2017-05-06 00:22:26 +02:00
```
2018-05-15 10:46:34 +02:00
version: '2.1'
services:
2017-05-06 00:22:26 +02:00
gogs-mailcow:
image: gogs/gogs
volumes:
- ./data/gogs:/data
networks:
mailcow-network:
aliases:
- gogs
ports:
2018-05-15 10:46:34 +02:00
- "${GOGS_SSH_PORT:-127.0.0.1:4000}:22"
2017-05-06 00:22:26 +02:00
```
2018-05-15 10:46:34 +02:00
2\. Create `data/conf/nginx/site.gogs.custom`, add:
2017-05-06 00:22:26 +02:00
```
location /gogs/ {
2018-05-15 10:46:34 +02:00
proxy_pass http://gogs:3000/;
2017-05-06 00:22:26 +02:00
}
```
2018-05-15 10:46:34 +02:00
3\. Open `mailcow.conf` and define the binding you want Gogs to use for SSH. Example:
2017-05-06 00:22:26 +02:00
```
2018-05-15 10:46:34 +02:00
GOGS_SSH_PORT=127.0.0.1:4000
2017-05-06 00:22:26 +02:00
```
2018-05-15 10:46:34 +02:00
5\. Run `docker-compose up -d` to bring up the Gogs container and run `docker-compose restart nginx-mailcow` afterwards.
2017-05-06 00:22:26 +02:00
2018-05-15 10:46:34 +02:00
6\. Open `http://${MAILCOW_HOSTNAME}/gogs/`, for example `http://mx.example.org/gogs/`. For database details set `mysql` as database host. Use the value of DBNAME found in mailcow.conf as database name, DBUSER as database user and DBPASS as database password.
2017-05-06 00:22:26 +02:00
2018-05-15 10:46:34 +02:00
7\. Once the installation is complete, login as admin and set "settings" -> "authorization" -> "enable SMTP". SMTP Host should be `postfix` with port `587`, set `Skip TLS Verify` as we are using an unlisted SAN ("postfix" is most likely not part of your certificate).
2017-05-06 00:22:26 +02:00
2018-05-15 10:46:34 +02:00
8\. Create `data/gogs/gogs/conf/app.ini` and set following values. You can consult [Gogs cheat sheet](https://gogs.io/docs/advanced/configuration_cheat_sheet) for their meaning and other possible values.
2017-05-06 00:22:26 +02:00
```
[server]
SSH_LISTEN_PORT = 22
2018-05-15 10:46:34 +02:00
# For GOGS_SSH_PORT=127.0.0.1:4000 in mailcow.conf, set:
SSH_DOMAIN = 127.0.0.1
SSH_PORT = 4000
# For MAILCOW_HOSTNAME=mx.example.org in mailcow.conf (and default ports for HTTPS), set:
ROOT_URL = https://mx.example.org/gogs/
2017-05-06 00:22:26 +02:00
```
9\. Restart Gogs with `docker-compose restart gogs-mailcow`. Your users should be able to login with mailcow managed accounts.