mirror of
https://framagit.org/YunoHost-Apps/gitea_ynh.git
synced 2024-11-21 18:41:35 +01:00
Merge branch 'testing' into LFS
This commit is contained in:
commit
a218277579
@ -1,9 +1,9 @@
|
|||||||
;; General
|
;; General
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld" (DOMAIN)
|
domain="domain.tld"
|
||||||
path="/path" (PATH)
|
path="/path"
|
||||||
admin="john" (USER)
|
admin="john"
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
is_public=1
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=1
|
setup_sub_dir=1
|
||||||
@ -12,6 +12,8 @@
|
|||||||
setup_private=1
|
setup_private=1
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
|
#1.14.5
|
||||||
|
upgrade=1 from_commit=7ea357724f2371aa1173f15ba5a7502609a0a131
|
||||||
upgrade=1 from_commit=349992d4f3921e4e1adb37a0cace4a5a9eb67099
|
upgrade=1 from_commit=349992d4f3921e4e1adb37a0cace4a5a9eb67099
|
||||||
upgrade=1 from_commit=4e078e91129725c8b09ba551ab2a04e0328a45b3
|
upgrade=1 from_commit=4e078e91129725c8b09ba551ab2a04e0328a45b3
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
@ -20,6 +22,8 @@
|
|||||||
port_already_use=1 (6000)
|
port_already_use=1 (6000)
|
||||||
change_url=1
|
change_url=1
|
||||||
;;; Upgrade options
|
;;; Upgrade options
|
||||||
|
; commit=7ea357724f2371aa1173f15ba5a7502609a0a131
|
||||||
|
name=1.14.5
|
||||||
; commit=349992d4f3921e4e1adb37a0cace4a5a9eb67099
|
; commit=349992d4f3921e4e1adb37a0cace4a5a9eb67099
|
||||||
name=First package version
|
name=First package version
|
||||||
; commit=4e078e91129725c8b09ba551ab2a04e0328a45b3
|
; commit=4e078e91129725c8b09ba551ab2a04e0328a45b3
|
||||||
|
@ -129,8 +129,8 @@ ynh_script_progression --message="Configuring permissions"
|
|||||||
ynh_permission_create --permission="admin" --allowed=$admin
|
ynh_permission_create --permission="admin" --allowed=$admin
|
||||||
|
|
||||||
# Add gitea to YunoHost's monitored services
|
# Add gitea to YunoHost's monitored services
|
||||||
ynh_script_progression --message="Register gitea service..."
|
ynh_script_progression --message="Register Gitea service..."
|
||||||
yunohost service add "$app" --log "/var/log/$app/gitea.log"
|
yunohost service add "$app" --log="/var/log/$app/gitea.log"
|
||||||
|
|
||||||
# Configure logrotate
|
# Configure logrotate
|
||||||
ynh_script_progression --message="Configuring log rotation..."
|
ynh_script_progression --message="Configuring log rotation..."
|
||||||
@ -141,8 +141,8 @@ ynh_app_setting_set --app $app --key upstream_version --value $(ynh_app_upstream
|
|||||||
|
|
||||||
# Reload services
|
# Reload services
|
||||||
ynh_script_progression --message="Starting gitea services..." --weight=3
|
ynh_script_progression --message="Starting gitea services..." --weight=3
|
||||||
ynh_systemd_action -l "Starting new Web server: tcp:127.0.0.1:" -p "/var/log/$app/gitea.log" -t 10
|
|
||||||
sleep 1
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/gitea.log" --line_match="Starting new Web server: tcp:127.0.0.1:"
|
||||||
|
|
||||||
# Store the checksum with the 'INTERNAL_TOKEN' value.
|
# Store the checksum with the 'INTERNAL_TOKEN' value.
|
||||||
# Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed
|
# Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed
|
||||||
|
@ -69,8 +69,8 @@ ynh_script_progression --message="Configuring log rotation..."
|
|||||||
ynh_use_logrotate --logfile "/var/log/$app"
|
ynh_use_logrotate --logfile "/var/log/$app"
|
||||||
|
|
||||||
# Add gitea to YunoHost's monitored services
|
# Add gitea to YunoHost's monitored services
|
||||||
ynh_script_progression --message="Register gitea service..."
|
ynh_script_progression --message="Register Gitea service..."
|
||||||
yunohost service add "$app" --log /var/log/"$app"/gitea.log
|
yunohost service add "$app" --log=/var/log/$app/gitea.log
|
||||||
|
|
||||||
# Reload services
|
# Reload services
|
||||||
ynh_script_progression --message="Reloading services..."
|
ynh_script_progression --message="Reloading services..."
|
||||||
|
@ -68,7 +68,7 @@ fi
|
|||||||
|
|
||||||
[[ $YNH_APP_ID == "gogs" ]] \
|
[[ $YNH_APP_ID == "gogs" ]] \
|
||||||
&& [[ "$(cat "/opt/$app/templates/.VERSION")" != 0.11.79.1211 ]] \
|
&& [[ "$(cat "/opt/$app/templates/.VERSION")" != 0.11.79.1211 ]] \
|
||||||
&& ynh_die --message "It look like that you have an old gogs install. You need first upgrade gogs instance (id : $gogs_migrate_id) and after migrate to gitea."
|
&& ynh_die --message "It look like that you have an old Gogs install. You need first upgrade Gogs instance (id: $gogs_migrate_id) and after migrate to Gitea."
|
||||||
ynh_handle_app_migration --migration_id=gogs --migration_list=gogs_migrations
|
ynh_handle_app_migration --migration_id=gogs --migration_list=gogs_migrations
|
||||||
|
|
||||||
if [[ $migration_process -eq 1 ]]; then
|
if [[ $migration_process -eq 1 ]]; then
|
||||||
@ -127,14 +127,13 @@ config_gitea
|
|||||||
ynh_script_progression --message="Updating systemd units..."
|
ynh_script_progression --message="Updating systemd units..."
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
# Modify Nginx configuration file and copy it to NGINX conf directory
|
||||||
ynh_script_progression --message="Configuring nginx..." --weight=1
|
ynh_script_progression --message="Configuring NGINX..." --weight=1
|
||||||
config_nginx
|
config_nginx
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DB migration
|
# DB migration
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrading database and sources..." --weight=6
|
ynh_script_progression --message="Upgrading database and sources..." --weight=6
|
||||||
|
|
||||||
# Before the version 1.7 the upstream version was not stored
|
# Before the version 1.7 the upstream version was not stored
|
||||||
@ -151,7 +150,7 @@ fi
|
|||||||
restart_gitea() {
|
restart_gitea() {
|
||||||
# Set permissions
|
# Set permissions
|
||||||
set_permission
|
set_permission
|
||||||
ynh_systemd_action -l "Starting new server: tcp:127.0.0.1:" -p "/var/log/$app/gitea.log" -t 30
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/gitea.log" --line_match="Starting new Web server: tcp:127.0.0.1:"
|
||||||
# Leave the time to update the database schema
|
# Leave the time to update the database schema
|
||||||
sleep 5
|
sleep 5
|
||||||
systemctl stop $app
|
systemctl stop $app
|
||||||
@ -232,8 +231,8 @@ ynh_setup_source $final_path source/$architecture
|
|||||||
restart_gitea
|
restart_gitea
|
||||||
|
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
ynh_script_progression --message="Configuring fail2ban..."
|
ynh_script_progression --message="Configuring Fail2Ban..."
|
||||||
ynh_add_fail2ban_config --logpath "/var/log/$app/gitea.log" --failregex ".*Failed authentication attempt for .* from <HOST>" --max_retry 5
|
ynh_add_fail2ban_config --logpath="/var/log/$app/gitea.log" --failregex=".*Failed authentication attempt for .* from <HOST>" --max_retry 5
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
@ -243,15 +242,15 @@ ynh_add_fail2ban_config --logpath "/var/log/$app/gitea.log" --failregex ".*Faile
|
|||||||
ynh_script_progression --message="Update permission..."
|
ynh_script_progression --message="Update permission..."
|
||||||
if ! ynh_permission_exists --permission admin; then
|
if ! ynh_permission_exists --permission admin; then
|
||||||
ynh_app_setting_delete --app $app --key unprotected_uris
|
ynh_app_setting_delete --app $app --key unprotected_uris
|
||||||
ynh_permission_create --permission 'admin' --allowed "$admin"
|
ynh_permission_create --permission="admin" --allowed="$admin"
|
||||||
# Update ldap config
|
# Update ldap config
|
||||||
ynh_replace_string --match_string "__APP__" --replace_string "$app" --target_file ../conf/login_source.sql
|
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/login_source.sql"
|
||||||
ynh_mysql_connect_as "$db_user" "$db_password" "$dbname" < ../conf/login_source.sql
|
ynh_mysql_connect_as "$db_user" "$db_password" "$dbname" < ../conf/login_source.sql
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add gitea to YunoHost's monitored services
|
# Add gitea to YunoHost's monitored services
|
||||||
ynh_script_progression --message="Register gitea service..."
|
ynh_script_progression --message="Register Gitea service..."
|
||||||
yunohost service add "$app" --log "/var/log/$app/gitea.log"
|
yunohost service add "$app" --log="/var/log/$app/gitea.log"
|
||||||
|
|
||||||
# Add ssh permission for gitea user
|
# Add ssh permission for gitea user
|
||||||
adduser $app ssh.app
|
adduser $app ssh.app
|
||||||
@ -261,23 +260,24 @@ ynh_script_progression --message="Protecting directory"
|
|||||||
set_permission
|
set_permission
|
||||||
|
|
||||||
# Save Version
|
# Save Version
|
||||||
ynh_app_setting_set --app $app --key upstream_version --value $(ynh_app_upstream_version)
|
ynh_app_setting_set --app=$app --key=upstream_version --value=$(ynh_app_upstream_version)
|
||||||
|
|
||||||
# Reload services
|
# Reload services
|
||||||
ynh_script_progression --message="Starting gitea services..." --weight=3
|
ynh_script_progression --message="Starting Gitea services..." --weight=3
|
||||||
ynh_systemd_action -l "Starting new Web server: tcp:127.0.0.1:" -p "/var/log/$app/gitea.log" -t 10
|
#ynh_systemd_action -l "Starting new Web server: tcp:127.0.0.1:" -p "/var/log/$app/gitea.log" -t 10
|
||||||
sleep 1
|
#sleep 1
|
||||||
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/gitea.log" --line_match="Starting new Web server: tcp:127.0.0.1:"
|
||||||
|
|
||||||
# Store the checksum with the 'INTERNAL_TOKEN' value.
|
# Store the checksum with the 'INTERNAL_TOKEN' value.
|
||||||
# Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed
|
# Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed
|
||||||
ynh_store_file_checksum --file "$final_path/custom/conf/app.ini"
|
ynh_store_file_checksum --file="$final_path/custom/conf/app.ini"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# FINISH MIGRATION PROCESS
|
# FINISH MIGRATION PROCESS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [[ $migration_process -eq 1 ]]; then
|
if [[ $migration_process -eq 1 ]]; then
|
||||||
echo "gogs has been successfully migrated to Gitea! \
|
echo "Gogs has been successfully migrated to Gitea! \
|
||||||
A last scheduled operation will run in a couple of minutes to finish the \
|
A last scheduled operation will run in a couple of minutes to finish the \
|
||||||
migration in YunoHost side. Do not proceed any application operation while \
|
migration in YunoHost side. Do not proceed any application operation while \
|
||||||
you don't see Gogs as installed." >&2
|
you don't see Gogs as installed." >&2
|
||||||
|
Loading…
Reference in New Issue
Block a user