mirror of
https://framagit.org/YunoHost-Apps/gitea_ynh.git
synced 2025-09-03 02:28:30 +02:00
Fix linter
This commit is contained in:
@ -41,7 +41,7 @@ fi
|
||||
|
||||
# Generate random password and key
|
||||
ynh_script_progression --message="Defining db password and key..."
|
||||
dbpass=$(ynh_string_random)
|
||||
DB_PASSWORD=$(ynh_string_random)
|
||||
key=$(ynh_string_random)
|
||||
|
||||
# Find available ports
|
||||
@ -49,9 +49,8 @@ port=$(ynh_find_port --port 6000)
|
||||
|
||||
# Store Settings
|
||||
ynh_script_progression --message="Storing installation settings..."
|
||||
ynh_app_setting_set --app $app --key mysqlpwd --value $dbpass
|
||||
ynh_app_setting_set --app $app --key mysqlpwd --value $DB_PASSWORD
|
||||
ynh_app_setting_set --app $app --key adminusername --value $admin
|
||||
ynh_app_setting_set --app $app --key is_public --value $is_public
|
||||
ynh_app_setting_set --app $app --key secret_key --value $key
|
||||
ynh_app_setting_set --app $app --key web_port --value $port
|
||||
|
||||
@ -61,7 +60,7 @@ ynh_app_setting_set --app $app --key web_port --value $port
|
||||
|
||||
# Initialize database and store mysql password for upgrade
|
||||
ynh_script_progression --message="Configuring MySQL database..."
|
||||
ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass"
|
||||
ynh_mysql_create_db "$dbname" "$db_user" "$DB_PASSWORD"
|
||||
|
||||
# Add users
|
||||
ynh_script_progression --message="Configuring system user..."
|
||||
@ -99,14 +98,14 @@ ynh_script_progression --message="Configuring application, step 2/2..."
|
||||
systemctl start "$app".service
|
||||
|
||||
# Wait untill login_source mysql table is created
|
||||
while ! $(ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" <<< "SELECT * FROM login_source;" &>/dev/null)
|
||||
while ! $(ynh_mysql_connect_as "$db_user" "$DB_PASSWORD" "$dbname" <<< "SELECT * FROM login_source;" &>/dev/null)
|
||||
do
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# Add ldap config
|
||||
ynh_replace_string --match_string "__APP__" --replace_string "$app" --target_file ../conf/login_source.sql
|
||||
ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ../conf/login_source.sql
|
||||
ynh_mysql_connect_as "$db_user" "$DB_PASSWORD" "$dbname" < ../conf/login_source.sql
|
||||
|
||||
# SETUP FAIL2BAN
|
||||
ynh_script_progression --message="Configuring fail2ban..."
|
||||
@ -118,7 +117,10 @@ ynh_add_fail2ban_config --logpath "/var/log/$app/gitea.log" --failregex ".*Faile
|
||||
|
||||
# Unprotect root from SSO if public
|
||||
ynh_script_progression --message="Protecting directory"
|
||||
set_access_settings
|
||||
if [ "$is_public" == '1' ];
|
||||
then
|
||||
ynh_permission_update --permission "main" --add "visitors"
|
||||
fi
|
||||
|
||||
# Create permission
|
||||
ynh_script_progression --message="Configuring permissions"
|
||||
|
Reference in New Issue
Block a user