Fix Gogs guide
Dieser Commit ist enthalten in:
Ursprung
118bdf0cdf
Commit
b28ed759e5
1 geänderte Dateien mit 18 neuen und 30 gelöschten Zeilen
|
@ -1,64 +1,52 @@
|
||||||
With Gogs' ability to authenticate over SMTP it is trivial to integrate it with mailcow. Few changes are needed:
|
With Gogs' ability to authenticate over SMTP it is trivial to integrate it with mailcow. Few changes are needed:
|
||||||
|
|
||||||
1\. Open `docker-compose.yml` and add Gogs:
|
1\. Open `docker-compose.override.yml` and add Gogs:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
version: '2.1'
|
||||||
|
services:
|
||||||
|
|
||||||
gogs-mailcow:
|
gogs-mailcow:
|
||||||
image: gogs/gogs
|
image: gogs/gogs
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/gogs:/data
|
- ./data/gogs:/data
|
||||||
networks:
|
networks:
|
||||||
mailcow-network:
|
mailcow-network:
|
||||||
ipv4_address: 172.22.1.123
|
|
||||||
aliases:
|
aliases:
|
||||||
- gogs
|
- gogs
|
||||||
ports:
|
ports:
|
||||||
- "${GOGS_SSH_PORT:-50022}:22"
|
- "${GOGS_SSH_PORT:-127.0.0.1:4000}:22"
|
||||||
- "${GOGS_WWW_PORT:-50080}:3000"
|
|
||||||
dns:
|
|
||||||
- 172.22.1.254
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
2\. Open `data/conf/nginx/site.conf` and add in each `server{}` block
|
2\. Create `data/conf/nginx/site.gogs.custom`, add:
|
||||||
```
|
```
|
||||||
location /gogs/ {
|
location /gogs/ {
|
||||||
proxy_pass http://172.22.1.123:3000/;
|
proxy_pass http://gogs:3000/;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
3\. Open `mailcow.conf` and define ports you want Gogs to open, as well as future database password. Example:
|
3\. Open `mailcow.conf` and define the binding you want Gogs to use for SSH. Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
GOGS_WWW_PORT=3000
|
GOGS_SSH_PORT=127.0.0.1:4000
|
||||||
GOGS_SSH_PORT=4000
|
|
||||||
DBGOGS=CorrectHorseBatteryStaple
|
|
||||||
```
|
```
|
||||||
|
|
||||||
4\. Create database and user for Gogs to use.
|
5\. Run `docker-compose up -d` to bring up the Gogs container and run `docker-compose restart nginx-mailcow` afterwards.
|
||||||
|
|
||||||
```
|
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.
|
||||||
. ./mailcow.conf
|
|
||||||
docker-compose exec mysql-mailcow mysql -uroot -p$DBROOT
|
|
||||||
mysql> CREATE USER gogs IDENTIFIED BY 'CorrectHorseBatteryStaple';
|
|
||||||
mysql> CREATE DATABASE gogs;
|
|
||||||
mysql> GRANT ALL PRIVILEGES ON gogs.* to gogs;
|
|
||||||
```
|
|
||||||
|
|
||||||
5\. Run `docker-compose up -d` to bring up Gogs container. Verify with `curl http://172.22.1.123:3000/` that it is running.
|
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).
|
||||||
|
|
||||||
6\. Proceed to installer from browser, for the time being using direct url `http://${MAILCOW_HOSTNAME}:${GOGS_WWW_PORT}/`, for example `http://example.org:3000/`. For database details set `mysql` as database host, user `gogs`, database name `gogs` and password as set above
|
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.
|
||||||
|
|
||||||
7\. Once install is complete, login as admin and in settings - authorization enable SMTP. SMTP Host should be `172.22.1.8` with port `587`. You'll probably want to set `Skip TLS Verify`.
|
|
||||||
|
|
||||||
8\. Edit `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.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
[server]
|
[server]
|
||||||
SSH_LISTEN_PORT = 22
|
SSH_LISTEN_PORT = 22
|
||||||
SSH_DOMAIN = [domain where ssh is available - used for ssh clone url]
|
# For GOGS_SSH_PORT=127.0.0.1:4000 in mailcow.conf, set:
|
||||||
SSH_PORT = [port where ssh is open on host - used for ssh clone url]
|
SSH_DOMAIN = 127.0.0.1
|
||||||
ROOT_URL = https://[url]/gogs/
|
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/
|
||||||
```
|
```
|
||||||
|
|
||||||
9\. Restart Gogs with `docker-compose restart gogs-mailcow`. Your users should be able to login with mailcow managed accounts.
|
9\. Restart Gogs with `docker-compose restart gogs-mailcow`. Your users should be able to login with mailcow managed accounts.
|
||||||
|
|
Laden …
In neuem Issue referenzieren