From b11baa5df1b1e724e6ab5b4d9de45f3587f928a6 Mon Sep 17 00:00:00 2001 From: fabreg Date: Thu, 9 Feb 2023 21:47:14 +0100 Subject: [PATCH] Added new gitea database (#528) Excluded gitea database from mailcow --- docs/third_party/gitea/third_party-gitea.en.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/third_party/gitea/third_party-gitea.en.md b/docs/third_party/gitea/third_party-gitea.en.md index 6679f4e71..d89b4d231 100644 --- a/docs/third_party/gitea/third_party-gitea.en.md +++ b/docs/third_party/gitea/third_party-gitea.en.md @@ -1,6 +1,14 @@ With Gitea' ability to authenticate over SMTP it is trivial to integrate it with mailcow. Few changes are needed: -1\. Open `docker-compose.override.yml` and add gitea: +1\. In order to create a database for gitea, connect to your shell and execute the following commands: +``` +source mailcow.conf +docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "CREATE DATABASE gitea;" +docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "CREATE USER 'gitea'@'%' IDENTIFIED BY 'your_strong_password';" +docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'%'; +``` + +2\. Open `docker-compose.override.yml` and add gitea: ```yaml version: '2.1' @@ -18,14 +26,14 @@ services: - "${GITEA_SSH_PORT:-127.0.0.1:4000}:22" ``` -2\. Create `data/conf/nginx/site.gitea.custom`, add: +3\. Create `data/conf/nginx/site.gitea.custom`, add: ``` location /gitea/ { proxy_pass http://gitea:3000/; } ``` -3\. Open `mailcow.conf` and define the binding you want gitea to use for SSH. Example: +4\. Open `mailcow.conf` and define the binding you want gitea to use for SSH. Example: ``` GITEA_SSH_PORT=127.0.0.1:4000 @@ -63,7 +71,7 @@ GITEA_SSH_PORT=127.0.0.1:4000 Go head with step 7 (Remember to use https instead of http, `https://mx.example.org/gitea/`) -7\. Open `http://${MAILCOW_HOSTNAME}/gitea/`, for example `http://mx.example.org/gitea/`. 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. +7\. Open `http://${MAILCOW_HOSTNAME}/gitea/`, for example `http://mx.example.org/gitea/`. For database details set `mysql` as database host. Use gitea as database name, gitea as database user and your_strong_password you previously definied at step 1 as database password. 8\. 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). @@ -91,4 +99,4 @@ ROOT_URL = https://mx.example.org/gitea/ ``` bash docker-compose restart gitea-mailcow - ``` \ No newline at end of file + ```