1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitea_ynh.git synced 2024-09-03 20:36:22 +02:00
This commit is contained in:
Éric Gaspar 2022-07-17 15:12:30 +02:00
commit 9ca89be8a1
No known key found for this signature in database
GPG key ID: 574F281483054D44
6 changed files with 237 additions and 64 deletions

55
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,55 @@
---
name: Bug report
about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
---
**How to post a meaningful bug report**
1. *Read this whole template first.*
2. *Determine if you are on the right place:*
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
- *When in doubt, post here and we will figure it out together.*
3. *Delete the italic comments as you write over them below, and remove this guide.*
---
### Describe the bug
*A clear and concise description of what the bug is.*
### Context
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
- YunoHost version: x.x.x
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
- If yes, please explain:
- Using, or trying to install package version/branch:
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
### Steps to reproduce
- *If you performed a command from the CLI, the command itself is enough. For example:*
```sh
sudo yunohost app install the_app
```
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
- *If the error occurs in your browser, explain what you did:*
1. *Go to '...'*
2. *Click on '...'*
3. *Scroll down to '...'*
4. *See error*
### Expected behavior
*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
### Logs
*When an operation fails, YunoHost provides a simple way to share the logs.*
- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
*If applicable and useful, add screenshots to help explain your problem.*

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,16 @@
## Problem
- *Description of why you made this PR*
## Solution
- *And how do you fix that problem*
## PR Status
- [ ] Code finished and ready to be reviewed/tested
- [ ] The fix/enhancement were manually tested (if applicable)
## Automatic tests
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

116
README.md
View file

@ -5,84 +5,124 @@ It shall NOT be edited by hand.
# Gitea for YunoHost # Gitea for YunoHost
[![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/gitea.svg)](https://dash.yunohost.org/appci/app/gitea) ![Working status](https://ci-apps.yunohost.org/ci/badges/gitea.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/gitea.maintain.svg)
[![Install Gogs with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gogs) [![Install Gitea with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gitea)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install Gogs quickly and simply on a YunoHost server. > *This package allows you to install Gitea quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview ## Overview
Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its particularity is that it is light and can run on an ARM card, which makes it suitable for self-hosting. Gogs has a web interface similar to that of GitHub. Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub.
### Features
- User dashboard, user profile and activity timeline.
- User, organization and repository management.
- Repository and organization webhooks, including Slack, Discord and Dingtalk.
- Repository Git hooks, deploy keys and Git LFS.
- Repository issues, pull requests, wiki, protected branches and collaboration.
- Migrate and mirror repositories with wiki from other code hosts.
- Web editor for quick editing repository files and wiki.
- Jupyter Notebook and PDF rendering.
- Authentication via SMTP, LDAP.
- Customize HTML templates, static files and many others.
**Shipped version:** 0.12.6~ynh1 **Shipped version:** 1.16.9~ynh1
**Demo:** https://try.gogs.io/user/login
## Screenshots ## Screenshots
![](./doc/screenshots/screenshot.png) ![Screenshot of Gitea](./doc/screenshots/screenshot.png)
## Disclaimers / important information ## Disclaimers / important information
## Notes on SSH usage ## Additional informations
If you want to use Gogs with SSH and be able to pull/push with you SSH key, your SSH daemon must be properly configured to use private/public keys. Here is a sample configuration of `/etc/ssh/sshd_config` that works with Gogs: [![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg)
[![Install Gogs with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gogs)
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 ```bash
PubkeyAuthentication yes PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys AuthorizedKeysFile /home/yunohost.app/%u/.ssh/authorized_keys
ChallengeResponseAuthentication no ChallengeResponseAuthentication no
PasswordAuthentication no PasswordAuthentication no
UsePAM no UsePAM no
``` ```
You also need to add your public key to your Gogs profile. You must also add your public key to your Gitea profile.
If you use SSH on another port than 22, you need to add theses lines to your ssh config in `~/.ssh/config`: When using SSH on any port other than 22, you need to add these lines to your SSH configuration `~/.ssh/config`:
```bash ```bash
Host domain.tld Host domain.tld
port 2222 # change this with the port you use port 2222 # change this with the port you use
``` ```
## Private Mode ### Upgrade
Actually it's possible to access to the Git repositories by the `git` command over HTTP also in private mode installation. It's important to know that in this mode the repository could be ALSO getted if you don't set the repository as private in the repos settings. 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 ## Documentation and resources
* Official app website: http://gogs.io * Official app website: <https://gitea.io/>
* Official admin documentation: https://gogs.io/docs * Official admin documentation: <https://docs.gitea.io/>
* Upstream app code repository: https://github.com/gogs/gogs * Upstream app code repository: <https://github.com/go-gitea/gitea>
* YunoHost documentation for this app: https://yunohost.org/app_gogs * YunoHost documentation for this app: <https://yunohost.org/app_gitea>
* Report a bug: https://github.com/YunoHost-Apps/gogs_ynh/issues * Report a bug: <https://github.com/YunoHost-Apps/gitea_ynh/issues>
## Developer info ## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/gogs_ynh/tree/testing). Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/gitea_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the testing branch, please proceed like that.
```
sudo yunohost app install https://github.com/YunoHost-Apps/gogs_ynh/tree/testing --debug ``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/gitea_ynh/tree/testing --debug
or or
sudo yunohost app upgrade gogs -u https://github.com/YunoHost-Apps/gogs_ynh/tree/testing --debug sudo yunohost app upgrade gitea -u https://github.com/YunoHost-Apps/gitea_ynh/tree/testing --debug
``` ```
**More info regarding app packaging:** https://yunohost.org/packaging_apps **More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,71 +1,127 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# Gitea pour YunoHost # Gitea pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) [![Niveau d'intégration](https://dash.yunohost.org/integration/gitea.svg)](https://dash.yunohost.org/appci/app/gitea) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/gitea.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/gitea.maintain.svg)
[![Installer Gogs avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gogs) [![Installer Gitea avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gitea)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Gogs rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet d'installer Gitea rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble ## Vue d'ensemble
Gogs (Go Git Service) est une forge multiplateforme basée sur git écrite en Go. Sa particularité est dêtre léger et pouvant fonctionner sur carte ARM, ce qui fait quil est adapté à lauto-hébergement. Gogs a une interface web similaire à celle de GitHub. Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub.
**Version incluse :** 0.12.6~ynh1 **Version incluse :** 1.16.9~ynh1
**Démo :** https://try.gogs.io/user/login
## Captures d'écran ## Captures d'écran
![](./doc/screenshots/screenshot.png) ![Capture d'écran de Gitea](./doc/screenshots/screenshot.png)
## Avertissements / informations importantes ## Avertissements / informations importantes
## Notes on SSH usage ## Additional informations
If you want to use Gogs with SSH and be able to pull/push with you SSH key, your SSH daemon must be properly configured to use private/public keys. Here is a sample configuration of `/etc/ssh/sshd_config` that works with Gogs: ### 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 ```bash
PubkeyAuthentication yes PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys AuthorizedKeysFile /home/yunohost.app/%u/.ssh/authorized_keys
ChallengeResponseAuthentication no ChallengeResponseAuthentication no
PasswordAuthentication no PasswordAuthentication no
UsePAM no UsePAM no
``` ```
You also need to add your public key to your Gogs profile. You must also add your public key to your Gitea profile.
If you use SSH on another port than 22, you need to add theses lines to your ssh config in `~/.ssh/config`: When using SSH on any port other than 22, you need to add these lines to your SSH configuration `~/.ssh/config`:
```bash ```bash
Host domain.tld Host domain.tld
port 2222 # change this with the port you use port 2222 # change this with the port you use
``` ```
## Private Mode ### Upgrade
Actually it's possible to access to the Git repositories by the `git` command over HTTP also in private mode installation. It's important to know that in this mode the repository could be ALSO getted if you don't set the repository as private in the repos settings. 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 ## Documentations et ressources
* Site officiel de l'app : http://gogs.io * Site officiel de l'app : <https://gitea.io/>
* Documentation officielle de l'admin : https://gogs.io/docs * Documentation officielle de l'admin : <https://docs.gitea.io/>
* Dépôt de code officiel de l'app : https://github.com/gogs/gogs * Dépôt de code officiel de l'app : <https://github.com/go-gitea/gitea>
* Documentation YunoHost pour cette app : https://yunohost.org/app_gogs * Documentation YunoHost pour cette app : <https://yunohost.org/app_gitea>
* Signaler un bug : https://github.com/YunoHost-Apps/gogs_ynh/issues * Signaler un bug : <https://github.com/YunoHost-Apps/gitea_ynh/issues>
## Informations pour les développeurs ## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/gogs_ynh/tree/testing). Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/gitea_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit. Pour essayer la branche testing, procédez comme suit.
```
sudo yunohost app install https://github.com/YunoHost-Apps/gogs_ynh/tree/testing --debug ``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/gitea_ynh/tree/testing --debug
ou ou
sudo yunohost app upgrade gogs -u https://github.com/YunoHost-Apps/gogs_ynh/tree/testing --debug sudo yunohost app upgrade gitea -u https://github.com/YunoHost-Apps/gitea_ynh/tree/testing --debug
``` ```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps **Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

View file

@ -15,3 +15,4 @@
#================================================= #=================================================
# FUTURE OFFICIAL HELPERS # FUTURE OFFICIAL HELPERS
#================================================= #=================================================

View file

@ -35,6 +35,11 @@ key=$(ynh_app_setting_get --app=$app --key=key)
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
# Move data directory
if [ -e "/home/$app" ] && [ ! -e $datadir ]; then
mv "/home/$app" "$datadir"
fi
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================