yunohost-gitea_ynh/doc/ADMIN.md

108 lines
3.1 KiB
Markdown
Raw Permalink Normal View History

## Git access
2022-04-01 22:54:46 +02:00
### Via HTTPS
2022-04-01 22:54:46 +02:00
If you want to use git repositories with `https` remotes, you need to set this app as **public**.
### Via SSH
If you want to use Gitea with SSH and be able to pull/push with your SSH key, your SSH daemon must be properly configured to use private/public keys.
Here is a sample configuration `/etc/ssh/sshd_config` that works with Gitea:
2022-04-01 22:54:46 +02:00
```bash
PubkeyAuthentication yes
2022-04-23 19:40:27 +02:00
AuthorizedKeysFile /home/yunohost.app/%u/.ssh/authorized_keys
2022-04-01 22:54:46 +02:00
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
```
2022-06-07 11:43:05 +02:00
You must also add your public key to your Gitea profile.
2022-04-01 22:54:46 +02:00
2022-06-07 11:43:05 +02:00
When using SSH on any port other than 22, you need to add these lines to your SSH configuration `~/.ssh/config`:
2022-04-01 22:54:46 +02:00
```bash
Host __DOMAIN__
2022-04-01 22:54:46 +02:00
port 2222 # change this with the port you use
```
## LFS setup
2022-04-01 22:54:46 +02:00
To use a repository with an `LFS` setup, you need to activate it on `__INSTALL_DIR__/custom/conf/app.ini`
2022-04-01 22:54:46 +02:00
```ini
[server]
LFS_START_SERVER = true
LFS_HTTP_AUTH_EXPIRY = 20m
```
2022-04-01 22:54:46 +02:00
By default, NGINX is configured with a maximum value for uploading files at 200 MB. It's possible to change this value on `/etc/nginx/conf.d/__DOMAIN__.d/__APP__.conf`.
2022-04-01 22:54:46 +02:00
```nginx
client_max_body_size 200M;
```
2022-04-01 22:54:46 +02:00
Don't forget to restart Gitea:
2022-04-01 22:54:46 +02:00
```bash
sudo systemctl restart __APP__.service.
```
2022-04-01 22:54:46 +02:00
> These settings are restored to the default configuration when updating Gitea. Remember to restore your configuration after all updates.
2022-04-01 22:54:46 +02:00
## Upgrade
2022-04-01 22:54:46 +02:00
From command line:
2022-04-01 22:54:46 +02:00
```bash
yunohost app upgrade __APP__
```
2022-04-01 22:54:46 +02:00
If you want to bypass the safety backup before upgrading, run:
2022-04-01 22:54:46 +02:00
```bash
yunohost app upgrade --no-safety-backup __APP__
```
2022-04-01 22:54:46 +02:00
## Group management
Gitea support Yunohost group sync with Gitea Organisation Team.
As the organisation link to the group depends of the instance this should be configured by the admin on the gitea configuration interface in `DOMAIN/GITEA_PATH/admin/auths/1`.
Normally the admin just need to set the correct value of the `LDAP Group Team Map` parameter with something like this:
```json
{"cn=GROUPE_A_YNH,ou=groups,dc=yunohost,dc=org": {"gitea_organisation": ["gitea_team_A"]},
"cn=GROUPE_B_YNH,ou=groups,dc=yunohost,dc=org": {"gitea_organisation": ["gitea_team_B"]}}
```
By this all members of the Yunohost groupe `GROUPE_A_YNH` will be member of the gitea team `gitea_team_A` of the organisation `gitea_organisation`.
**Note all others parameter are managed by the Yunohost package and should not be changed.**
## Backup
2022-04-01 22:54:46 +02:00
This application now uses the core-only feature of the backup. To keep the integrity of the data and to have a better guarantee of the restoration it is recommended to proceed as follows:
2022-04-01 22:54:46 +02:00
- Stop Gitea service:
2022-06-07 11:43:05 +02:00
```bash
systemctl stop __APP__.service
2022-04-01 22:54:46 +02:00
```
- Launch Gitea backup:
```bash
yunohost backup create --app __APP__
2022-04-01 22:54:46 +02:00
```
- Backup your data with your specific strategy (could be with rsync, borg backup or just cp). The data is generally stored in `/home/yunohost.app/__APP__`.
- Restart Gitea service:
```bash
systemctl stop __APP__.service
```
2022-04-01 22:54:46 +02:00
## Remove
2022-04-01 22:54:46 +02:00
Due of the backup core only feature the data directory in `/home/yunohost.app/__APP__` **is not removed**. It must be manually deleted to purge user data from the app.