1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gogs_ynh.git synced 2024-09-03 20:36:23 +02:00
This commit is contained in:
ericgaspar 2020-11-20 09:28:52 +01:00
parent 5251631f03
commit 2400eee2b1
No known key found for this signature in database
GPG key ID: 574F281483054D44
6 changed files with 14 additions and 48 deletions

View file

@ -1,16 +1,17 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ { location __PATH__/ {
proxy_pass http://localhost:__PORT__/;
proxy_set_header Host $host;
proxy_buffering off;
fastcgi_param REMOTE_USER $remote_user;
client_max_body_size 200M;
# Force https # Force https
if ($scheme = http) { if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;
} }
proxy_pass http://localhost:__PORT__/;
proxy_set_header Host $host;
proxy_buffering off;
fastcgi_param REMOTE_USER $remote_user;
client_max_body_size 200M;
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }

View file

@ -120,38 +120,4 @@ ynh_check_starting () {
local app_log="${2:-/var/log/$service_name/$service_name.log}" local app_log="${2:-/var/log/$service_name/$service_name.log}"
local timeout=${3:-300} local timeout=${3:-300}
ynh_clean_check_starting () {
# Stop the execution of tail.
kill -s 15 $pid_tail 2>&1
ynh_secure_remove "$templog" 2>&1
}
echo "Starting of $service_name" >&2
systemctl stop $service_name
local templog="$(mktemp)"
# Following the starting of the app in its log
tail -F -n0 "$app_log" > "$templog" &
# Get the PID of the tail command
local pid_tail=$!
systemctl start $service_name
local i=0
for i in `seq 1 $timeout`
do
# Read the log until the sentence is found, that means the app finished to start. Or run until the timeout
if grep --quiet "$line_to_match" "$templog"
then
echo "The service $service_name has correctly started." >&2
break
fi
echo -n "." >&2
sleep 1
done
if [ $i -eq $timeout ]
then
echo "The service $service_name didn't fully started before the timeout." >&2
fi
echo ""
ynh_clean_check_starting
}

View file

@ -22,7 +22,7 @@ domain=$YNH_APP_NEW_DOMAIN
path_url=$(ynh_normalize_url_path ${YNH_APP_NEW_PATH:-'/'}) path_url=$(ynh_normalize_url_path ${YNH_APP_NEW_PATH:-'/'})
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
dbpass=$(ynh_app_setting_get "$app" mysqlpwd) db_pwd=$(ynh_app_setting_get "$app" mysqlpwd)
admin=$(ynh_app_setting_get "$app" adminusername) admin=$(ynh_app_setting_get "$app" adminusername)
key=$(ynh_app_setting_get "$app" secret_key) key=$(ynh_app_setting_get "$app" secret_key)
port=$(ynh_app_setting_get "$app" web_port) port=$(ynh_app_setting_get "$app" web_port)

View file

@ -81,9 +81,8 @@ db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
dbpass=$(ynh_string_random) #to be changed
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
#================================================= #=================================================
@ -127,8 +126,8 @@ else
fi fi
ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$dbpass" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$dbuser" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini"
ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini"

View file

@ -30,7 +30,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
dbpass=$(ynh_app_setting_get --app=$app --key=mysqlpwd) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
admin=$(ynh_app_setting_get --app=$app --key=adminusername) admin=$(ynh_app_setting_get --app=$app --key=adminusername)

View file

@ -21,7 +21,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get "$app" domain) domain=$(ynh_app_setting_get "$app" domain)
path_url=$(ynh_normalize_url_path $(ynh_app_setting_get "$app" path)) path_url=$(ynh_normalize_url_path $(ynh_app_setting_get "$app" path))
dbpass=$(ynh_app_setting_get "$app" mysqlpwd) db_pwd=$(ynh_app_setting_get "$app" mysqlpwd)
admin=$(ynh_app_setting_get "$app" adminusername) admin=$(ynh_app_setting_get "$app" adminusername)
key=$(ynh_app_setting_get "$app" secret_key) key=$(ynh_app_setting_get "$app" secret_key)
is_public=$(ynh_app_setting_get "$app" is_public) is_public=$(ynh_app_setting_get "$app" is_public)
@ -87,7 +87,7 @@ fi
# Remove old authentification mecanisme, actually the registry in the database has been replaced by a config file # Remove old authentification mecanisme, actually the registry in the database has been replaced by a config file
if [[ ! -e "$final_path/custom/conf/auth.d/ldap.conf" ]] if [[ ! -e "$final_path/custom/conf/auth.d/ldap.conf" ]]
then then
ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" <<< "DELETE FROM login_source WHERE name = 'Yunohost LDAP';" ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" <<< "DELETE FROM login_source WHERE name = 'Yunohost LDAP';"
mkdir -p "$final_path/custom/conf/auth.d" mkdir -p "$final_path/custom/conf/auth.d"
fi fi