Skip to content

Commit

Permalink
Merge pull request #3 from EndMove/dev
Browse files Browse the repository at this point in the history
Add migration sys, Up gid & uid, Up to Gitea 1.15.10
  • Loading branch information
EndMove authored Jan 19, 2022
2 parents a7d745d + 3e13c63 commit 340ec48
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
7 changes: 6 additions & 1 deletion CONTROL/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Version: 1.15.10.r01
- Update, container running user and group.
- Add, auto-migration system for users leaving iGi's old Gitea app for this one.
- Gitea 1.15.10 release notes (https://github.com/go-gitea/gitea/releases/tag/v1.15.10).

Version: 1.15.7.r01
- Fix some bugs.
- Gitea 1.15.5 first release (https://github.com/go-gitea/gitea/releases/tag/v1.15.7).
- Gitea 1.15.7 release notes (https://github.com/go-gitea/gitea/releases/tag/v1.15.7).

Version: 1.15.6.r02
- Fixed Gitea (SSL) web server startup problem due to ADM update 4.0.0.RN53.
Expand Down
2 changes: 1 addition & 1 deletion CONTROL/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"general":{
"package":"gitea-docker",
"name":"Gitea",
"version":"1.15.7.r01",
"version":"1.15.10.r01",
"depends":[
"docker-ce(>=20.10.2.r2)"
],
Expand Down
50 changes: 50 additions & 0 deletions CONTROL/description-fr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Gitea est une solution Opensource d'hébergement de code léger et rapide écrite en Go. Elle est publiée sous la licence MIT.
Version actuelle de Gitea : 1.15.10 - Fonctionne avec une connexion HTTPS.

!!! NOUVEAU !!! : Supporte maintenant la migration de l'ancien iGi Gitea vers celui-ci.

[INFORMATION]
Cette application nécessite un nom de domaine valide et un certificat SSL. En effet, un gestionnaire de code Git nécessite ces éléments fondamentaux pour fonctionner correctement et en toute sécurité. Ajoutez votre certificat et votre domaine à ADM. Il est également possible d'utiliser le certificat par défaut d'ADM et le sous-domaine fourni par asustor voir (https://www.myasustor.com/).


[PANNEAU D'ADMINISTRATION]
Vous pouvez accéder au panneau d'administration par : "https://your-domain-name:3100".


[SETUP]
(+) Base de données
Vous avez deux choix possibles : ne rien toucher et utiliser une base de données embarquée (SQLite3) ou utiliser (MySQL) et la base de données ADM. Attention, pour utiliser la base de données ADM vous devez activer l'accès distant MariaDB et utiliser l'adresse ip du serveur.

(+) Configuration générale
Indiquez le titre du site, par défaut "Gitea : Git with a cup of tea", remplacez "localhost" par votre nom de domaine partout dans la configuration. Attention pour le paramètre "Gitea base URL" remplacer "https://localhost:3000/" par "https://your-domain:3100/" (utiliser le port 3100 pour l'URL de base). Laisser les autres paramètres de port sur 22 et 3000.

(+) Paramètres de l'email
Il est conseillé d'utiliser un serveur SMTP pour sécuriser Gitea et tenir informé vos équipes de développement. Indiquez le port de votre serveur SMTP dans la configuration du nom d'hôte, par exemple "smtp.endmove.eu:587".

(+) Compte administrateur
En bas de la page de configuration, vous trouverez la section de configuration du compte administrateur, configurez-le correctement.

(-) Si vous échouez à l'installation...
Eteignez l'application et supprimez le dossier "/volume1/Docker/Gitea", puis démarrez l'application et répétez la configuration.


[PORTs]
Gitea expose le port HTTPS 3100-tcp et le port SSH 3122-tcp sur votre serveur.


[FILES DE CONFIGURATION]
Les fichiers de configuration de Gitea sont disponibles dans le dossier : "/volume1/Docker/Gitea" le fichier de configuration principal est disponible dans "./gitea/conf/app.ini". Il est nécessaire de redémarrer Gitea pour enregistrer les changements.


[GITHUB]
Trouvez le dépôt Gitea-ADM sur GitHub en suivant ce lien : https://github.com/EndMove/gitea-adm


[ISSUES]
N'hésitez pas à signaler tout problème ou à demander de l'aide en suivant ce lien : https://github.com/EndMove/gitea-adm/issues

-----------------------------------------------------------

Mais pourquoi utiliser Gitea ?

Gitea est simple, rapide et puissant, c'est garder votre code sur VOTRE SERVEUR, pouvoir travailler avec votre équipe SANS CONNEXION INTERNET, avoir accès à une quantité infinie de dépôts privés sans jamais avoir à payer. Un rêve pour un développeur.
33 changes: 25 additions & 8 deletions CONTROL/description.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
Gitea is an Opensource solution for lightweight and fast code hosting written in Go. It is published under the MIT license.
Gitea current version: 1.15.6 - Work with an HTTPS connection.
Gitea current version: 1.15.10 - Work with an HTTPS connection.

!!! NEW !!! : Now supports the migration from the old iGi Gitea to this one.

[INFORMATION]
This application requires a valid domain name and SSL certificate. Indeed, a Git code manager requires these fundamental elements to work properly and securely. Add your certificate and domain to ADM. It is also possible to use the default certificate of ADM and the subdomain provided by asustor see (https://www.myasustor.com/).

[WARNING]
This application requires a valid domain name and SSL certificate. Indeed, a Git code manager requires these fundamental elements to work properly and securely. Add your certificate and domain to ADM.

[ADMIN PANEL]
You can access the admin panel through : "https://your-domain-name:3100".


[SETUP]
# Database
(+) Database
You have two valid choices : don't touch anything and use an embedded database (SQLite3) or use (MySQL) and the ADM database. Be careful, to use the ADM database you must activate the MariaDB remote access and use the server ip address.

# General configuration
Indicate the title of the site, by default "Gitea : Git with a cup of tea", replace "localhost" by your domain name everywhere in the configuration and in "Gitea base URL" indicate "https://localhost:3100/" by replacing the localhost [<!> web port: 3100 <!>]. Be careful not to touch the ports defined in the configuration.
(+) General configuration
Indicate the title of the site, by default "Gitea : Git with a cup of tea", replace "localhost" by your domain name everywhere in the configuration. Be careful for the "Gitea base URL" parameter replace "https://localhost:3000/" by "https://your-domain:3100/" (use port 3100 for the base URL). leave the other port parameters on 22 and 3000.

# Email settings
(+) Email settings
It is advisable to use an SMTP server to secure Gitea and keep your development teams informed. Indicate the port of your SMTP server in the hostname configuration e.g. "smtp.endmove.eu:587".

(+) Administrator account
At the bottom of the configuration page you will find the administrator account configuration section, set it up properly.

(-) If you fail the install...
Turn off the application and delete the "/volume1/Docker/Gitea" folder, then start the application and repeat the configuration.


[PORTs]
Gitea exposes HTTPS port 3100-tcp and SSH port 3122-tcp on your server.


[CONFIG FILES]
Gitea configuration files are available in the folder: "volume1/Docker/Gitea" the main configuration file is available in "Gitea/gitea/conf/app.ini".
Gitea configuration files are available in the folder: "/volume1/Docker/Gitea" the main configuration file is available in "./gitea/conf/app.ini". It is necessary to restart Gitea to save the changes.


[GITHUB]
Find the Gitea-ADM repository on GitHub by following this link: https://github.com/EndMove/gitea-adm


[ISSUES]
Do not hesitate to report any problem or ask for help by following this link: https://github.com/EndMove/gitea-adm/issues

-----------------------------------------------------------

But why use Gitea?
Expand Down
40 changes: 30 additions & 10 deletions CONTROL/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,32 @@

echo "gitea-adm: --== post-install ==--"

# Environement variables
GITEA_DATA_PATH="/volume1/Docker/Gitea"
GITEA_CONTAINER=Gitea
# Environment variables
GITEA_VERSION=$(cat $APKG_PKG_DIR/gitea_version)
GITEA_DATA_PATH='/volume1/Docker/Gitea'
GITEA_CONFIG_PATH='/gitea/conf'
GITEA_CONTAINER=Gitea
GITEA_UID=999
GITEA_GID=999

# Checking the configuration to install according to the user's settings
if [ -d ${GITEA_DATA_PATH}${GITEA_CONFIG_PATH} ]; then
cd ${GITEA_DATA_PATH}${GITEA_CONFIG_PATH} || exit 1

# Backing configuration
if [ "$APKG_PKG_STATUS" = 'upgrade' ]; then
# Saving the configuration
echo "gitea-adm: Saving configuration (app.ini.old)..."
cp app.ini app.ini.old
fi

# Integrity check
echo "gitea-adm: Integrity check-up for users of the old version of gitea by iGi"
if [ $(cat app.ini | grep RUN_USER | awk '{print $3}') != 'git' ]; then
sed -i 's/\(RUN_USER =\).*/RUN_USER = git/' app.ini
chown -R $GITEA_UID:$GITEA_GID ../../../Gitea
fi
fi

# Pull the container image
echo "gitea-adm: Fetching data"
Expand All @@ -18,19 +40,17 @@ docker create -i -t --name=$GITEA_CONTAINER \
--env GITEA__server__PROTOCOL='https' \
--env GITEA__server__CERT_FILE='/ssl/ssl.crt' \
--env GITEA__server__KEY_FILE='/ssl/ssl.key' \
--env USER_UID=0 \
--env USER_UID=$GITEA_UID \
--env USER_GID=$GITEA_GID \
--restart=unless-stopped \
--volume $GITEA_DATA_PATH:/data \
--volume /usr/builtin/etc/certificate/:/ssl/:ro \
gitea/gitea:$GITEA_VERSION

echo "gitea-adm: Installation/Update complete"

# Starting container
echo "gitea-adm: Strating container"
echo "gitea-adm: Starting container"
docker start $GITEA_CONTAINER

# Say update is done
if [ "$APKG_PKG_STATUS" == "upgrade" ]; then
echo "gitea-adm: Upgrade done"
fi

exit 0
15 changes: 7 additions & 8 deletions CONTROL/pre-uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@

echo "gitea-adm: --== pre-uninstall ==--"

# Environement variables
GITEA_DATA_PATH="/volume1/Docker/Gitea"
# Environment variables
GITEA_VERSION=$(cat $APKG_PKG_DIR/gitea_version)
GITEA_CONTAINER=$(docker container ls -a | grep Gitea | awk '{print $1}')

# Force shutdown of the container and delete it
echo "gitea-adm: Stoping and removing container"
echo "gitea-adm: Stopping and removing container"
echo " - $GITEA_CONTAINER"
if [ ! -z $GITEA_CONTAINER ]; then
docker kill $GITEA_CONTAINER
if [ -n "$GITEA_CONTAINER" ]; then
docker kill "$GITEA_CONTAINER"
sleep 2
docker rm -f $GITEA_CONTAINER
docker rm -f "$GITEA_CONTAINER"
fi


GITEA_IMAGE=$(docker images | grep gitea/gitea | grep $GITEA_VERSION | awk '{print $3}')
# REMOVE docker image on uninstalling & updating
echo "gitea-adm: Removing docker image"
echo "gitea-adm: Image ID: $GITEA_IMAGE"
if [ ! -z $GITEA_IMAGE ]; then
docker rmi -f $GITEA_IMAGE
if [ -n "$GITEA_IMAGE" ]; then
docker rmi -f "$GITEA_IMAGE"
fi

exit 0
2 changes: 1 addition & 1 deletion CONTROL/start-stop.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

# Environement variables
# Environment variables
GITEA_CONTAINER=Gitea

case "$1" in
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gitea-adm

__Gitea version__: _`1.15.7`_
__Gitea version__: _`1.15.10`_

![GitHub license](https://img.shields.io/badge/license-GPL--3.0-%23fe7d37) ![GitHub last commit](https://img.shields.io/github/last-commit/EndMove/gitea-adm)

Expand Down Expand Up @@ -33,7 +33,7 @@ __:warning: This application is not an Android application !__

## Configuration folder

This application will create a folder in `/volume1/Docker/Gitea`, this folder will contain all configuration files and the embedded database if you use it.
This application will create a folder in `/volume1/Docker/Gitea`, this folder will contain all configuration files, and the embedded database if you use it.

## Configuration

Expand Down
2 changes: 1 addition & 1 deletion gitea_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.15.7
1.15.10
Binary file removed screenshot-01.png
Binary file not shown.
Binary file removed screenshot-02.png
Binary file not shown.
Binary file removed screenshot-03.png
Binary file not shown.
Binary file removed screenshot-04.png
Binary file not shown.
Binary file removed screenshot-05.png
Binary file not shown.
Binary file removed screenshot-06.png
Binary file not shown.

0 comments on commit 340ec48

Please sign in to comment.