Skip to content

Commit

Permalink
Merge pull request #93 from YunoHost-Apps/manifestv2_improvements
Browse files Browse the repository at this point in the history
Manifestv2 improvements
  • Loading branch information
Josue-T authored Feb 7, 2024
2 parents 67d5bc5 + 311a419 commit 6c7c912
Show file tree
Hide file tree
Showing 134 changed files with 652 additions and 1,850 deletions.
80 changes: 0 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,86 +25,6 @@ Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to

![Screenshot of Gitea](./doc/screenshots/screenshot.png)

## Disclaimers / important information

## Additional informations

### Notes on SSH usage

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:

```bash
PubkeyAuthentication yes
AuthorizedKeysFile /home/yunohost.app/%u/.ssh/authorized_keys
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
```

You must also add your public key to your Gitea profile.

When using SSH on any port other than 22, you need to add these lines to your SSH configuration `~/.ssh/config`:

```bash
Host domain.tld
port 2222 # change this with the port you use
```

### Upgrade

By default, a backup is performed before upgrading. To avoid this, you have the following options:
- Pass the `NO_BACKUP_UPGRADE` env variable with `1` at each upgrade. For example `NO_BACKUP_UPGRADE=1 yunohost app upgrade gitea`.
- Set `disable_backup_before_upgrade` to `1`. You can set it with this command:

`yunohost app setting gitea disable_backup_before_upgrade -v 1`

After that, the settings will be applied for **all** the next updates.

From command line:

`yunohost app upgrade gitea`

### Backup

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:

- Stop Gitea service with this command:

`systemctl stop gitea.service`

- Launch Gitea backup with this command:

`yunohost backup create --app gitea`

- 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/gitea`.
- Restart Gitea service with theses command:

`systemctl start gitea.service`

### Remove

Due of the backup core only feature the data directory in `/home/yunohost.app/gitea` **is not removed**. It must be manually deleted to purge user data from the app.

### LFS setup
To use a repository with an `LFS` setup, you need to activate it on `/opt/gitea/custom/conf/app.ini`

```ini
[server]
LFS_START_SERVER = true
LFS_HTTP_AUTH_EXPIRY = 20m
```
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/my.domain.tld.d/gitea.conf`.
```
client_max_body_size 200M;
```
Don't forget to restart Gitea `sudo systemctl restart gitea.service`.

> These settings are restored to the default configuration when updating Gitea. Remember to restore your configuration after all updates.
### Git command access with HTTPS

If you want to use the Git command (like `git clone`, `git pull`, `git push`), you need to set this app as **public**.

## Documentation and resources

* Official app website: <https://gitea.io/>
Expand Down
80 changes: 0 additions & 80 deletions README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,86 +25,6 @@ Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to

![Capture d’écran de Gitea](./doc/screenshots/screenshot.png)

## Avertissements / informations importantes

## Additional informations

### Notes on SSH usage

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:

```bash
PubkeyAuthentication yes
AuthorizedKeysFile /home/yunohost.app/%u/.ssh/authorized_keys
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
```

You must also add your public key to your Gitea profile.

When using SSH on any port other than 22, you need to add these lines to your SSH configuration `~/.ssh/config`:

```bash
Host domain.tld
port 2222 # change this with the port you use
```

### Upgrade

By default, a backup is performed before upgrading. To avoid this, you have the following options:
- Pass the `NO_BACKUP_UPGRADE` env variable with `1` at each upgrade. For example `NO_BACKUP_UPGRADE=1 yunohost app upgrade gitea`.
- Set `disable_backup_before_upgrade` to `1`. You can set it with this command:

`yunohost app setting gitea disable_backup_before_upgrade -v 1`

After that, the settings will be applied for **all** the next updates.

From command line:

`yunohost app upgrade gitea`

### Backup

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:

- Stop Gitea service with this command:

`systemctl stop gitea.service`

- Launch Gitea backup with this command:

`yunohost backup create --app gitea`

- 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/gitea`.
- Restart Gitea service with theses command:

`systemctl start gitea.service`

### Remove

Due of the backup core only feature the data directory in `/home/yunohost.app/gitea` **is not removed**. It must be manually deleted to purge user data from the app.

### LFS setup
To use a repository with an `LFS` setup, you need to activate it on `/opt/gitea/custom/conf/app.ini`

```ini
[server]
LFS_START_SERVER = true
LFS_HTTP_AUTH_EXPIRY = 20m
```
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/my.domain.tld.d/gitea.conf`.
```
client_max_body_size 200M;
```
Don't forget to restart Gitea `sudo systemctl restart gitea.service`.

> These settings are restored to the default configuration when updating Gitea. Remember to restore your configuration after all updates.
### Git command access with HTTPS

If you want to use the Git command (like `git clone`, `git pull`, `git push`), you need to set this app as **public**.

## Documentations et ressources

* Site officiel de l’app : <https://gitea.io/>
Expand Down
27 changes: 0 additions & 27 deletions check_process

This file was deleted.

92 changes: 59 additions & 33 deletions conf/app.ini
Original file line number Diff line number Diff line change
@@ -1,87 +1,113 @@
;https://github.com/gogits/gogs/blob/master/conf/app.ini
;https://github.com/go-gitea/gitea/blob/release/v1.20/custom/conf/app.example.ini
APP_NAME = Gitea
RUN_USER = __APP__
RUN_MODE = prod
WORK_PATH = __INSTALL_DIR__

[actions]
ENABLED = true
ENABLED = false

[database]
DB_TYPE = mysql
HOST = 127.0.0.1:3306
NAME = __DB_USER__
NAME = __DB_NAME__
USER = __DB_USER__
PASSWD = __DB_PASSWORD__
PASSWD = __DB_PWD__
SSL_MODE = disable
PATH = data/gitea.db
LOG_SQL = false
LOG_SQL = false

[repository]
ROOT = __REPOS_PATH__
ROOT = __DATA_DIR__/repositories
FORCE_PRIVATE = false

[server]
DOMAIN = __DOMAIN__
HTTP_PORT = __PORT__
HTTP_ADDR = 127.0.0.1
ROOT_URL = https://__DOMAIN____PATH_URL__
DISABLE_SSH = false
SSH_PORT = __SSH_PORT__
DOMAIN = __DOMAIN__
HTTP_PORT = __PORT__
HTTP_ADDR = 127.0.0.1
ROOT_URL = https://__DOMAIN____PATH__
DISABLE_SSH = false
SSH_PORT = __SSH_PORT__
OFFLINE_MODE = false
APP_DATA_PATH = __DATA_PATH__
APP_DATA_PATH = __DATA_DIR__/data
LANDING_PAGE = explore
LFS_START_SERVER = true
LFS_JWT_SECRET = __LFS_KEY__
LFS_JWT_SECRET = __LFS_JWT_SECRET__

[mailer]
ENABLED = true
SMTP_ADDR = 127.0.0.1
SMTP_PORT = 25
FROM = "Gitea" <gitea-noreply@__DOMAIN__>
SMTP_ADDR = localhost
SMTP_PORT = 587
PROTOCOL = smtp+starttls
FROM = "Gitea" <__APP__@__DOMAIN__>
USER = __APP__
PASSWD = __MAIL_PWD__
FORCE_TRUST_SERVER_CERT = true

[email.incoming]
ENABLED = true
REPLY_TO_ADDRESS = __APP__+%{token}@__DOMAIN__
HOST = localhost
PORT = 993
USE_TLS = true
SKIP_TLS_VERIFY = true
USERNAME = __APP__
PASSWORD = __MAIL_PWD__

[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = true
ENABLE_CAPTCHA = false
REQUIRE_SIGNIN_VIEW = false
ENABLE_REVERSE_PROXY_AUTHENTICATION = true
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = true
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = true
ENABLE_CAPTCHA = false
REQUIRE_SIGNIN_VIEW = false
# reverse proxy authentication disabled until https://github.com/go-gitea/gitea/pull/18452 is merged
# as it broke completely the LDAP sync
ENABLE_REVERSE_PROXY_AUTHENTICATION = false
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false

[picture]
AVATAR_UPLOAD_PATH = __DATA_PATH__/avatars
AVATAR_UPLOAD_PATH = __DATA_DIR__/data/avatars

[attachment]
PATH = __DATA_PATH__/attachments
PATH = __DATA_DIR__/data/attachments

[session]
PROVIDER = memory

[log]
MODE = file
LEVEL = Info
MODE = file
LEVEL = Info
ROOT_PATH = /var/log/__APP__
logger.access.MODE =
logger.access.MODE =
logger.router.MODE = router
logger.xorm.MODE = xorm

REDIRECT_MACARON_LOG= true
MACARON = file
REDIRECT_MACARON_LOG = true
MACARON = file

[log.file]
FILE_NAME = gitea.log
LEVEL = Info

[log.router]
MODE = file
FILE_NAME = router.log
LEVEL = Warn

[log.xorm]
MODE = file
FILE_NAME = xorm.log
LEVEL = Warn

[security]
INSTALL_LOCK = true
SECRET_KEY = __KEY__
SECRET_KEY = __SECRET_KEY__
REVERSE_PROXY_AUTHENTICATION_USER = REMOTE-USER
REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128
REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128
INTERNAL_TOKEN = __INTERNAL_TOKEN__

[oauth2]
JWT_SECRET = __JWT_SECRET__

[cron.sync_external_users]
ENABLED = true
RUN_AT_START = false
5 changes: 0 additions & 5 deletions conf/gogs_migrations

This file was deleted.

32 changes: 0 additions & 32 deletions conf/gogs_post_migration.sh

This file was deleted.

6 changes: 0 additions & 6 deletions conf/login_source.sql

This file was deleted.

Loading

0 comments on commit 6c7c912

Please sign in to comment.