mirror of
https://framagit.org/YunoHost-Apps/gitea_ynh.git
synced 2024-11-21 18:41:35 +01:00
Allow https access from git in private mode
This commit is contained in:
parent
d89b9c06c5
commit
300340cfc9
@ -81,3 +81,21 @@ set_permission() {
|
|||||||
chmod u=rwX,g=rX,o= "/home/$app"
|
chmod u=rwX,g=rX,o= "/home/$app"
|
||||||
chmod u=rwX,g=rX,o= "/var/log/$app"
|
chmod u=rwX,g=rX,o= "/var/log/$app"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_access_settings() {
|
||||||
|
if [ "$is_public" = '1' ]
|
||||||
|
then
|
||||||
|
ynh_app_setting_set $app unprotected_uris "/"
|
||||||
|
else
|
||||||
|
# For an access to the git server by https in private mode we need to allow the access to theses URL :
|
||||||
|
# - "DOMAIN/PATH/USER/REPOSITORY/info/refs"
|
||||||
|
# - "DOMAIN/PATH/USER/REPOSITORY/git-upload-pack"
|
||||||
|
# - "DOMAIN/PATH/USER/REPOSITORY/git-receive-pack"
|
||||||
|
|
||||||
|
excaped_domain=${domain//'.'/'%.'}
|
||||||
|
excaped_domain=${excaped_domain//'-'/'%-'}
|
||||||
|
excaped_path=${path_url//'.'/'%.'}
|
||||||
|
excaped_path=${excaped_path//'-'/'%-'}
|
||||||
|
ynh_app_setting_set $app skipped_regex "$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/git%-receive%-pack,$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/git%-upload%-pack,$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/info/refs"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
@ -104,10 +104,7 @@ ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ../conf/login_source.sql
|
|||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Unprotect root from SSO if public
|
# Unprotect root from SSO if public
|
||||||
if [ "$is_public" = '1' ]
|
set_access_settings
|
||||||
then
|
|
||||||
ynh_app_setting_set $app unprotected_uris "/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add gitea to YunoHost's monitored services
|
# Add gitea to YunoHost's monitored services
|
||||||
yunohost service add "$app" --log "/var/log/$app/$app.log"
|
yunohost service add "$app" --log "/var/log/$app/$app.log"
|
||||||
|
@ -106,6 +106,9 @@ config_nginx
|
|||||||
# Set permissions
|
# Set permissions
|
||||||
set_permission
|
set_permission
|
||||||
|
|
||||||
|
# Unprotect root from SSO if public
|
||||||
|
set_access_settings
|
||||||
|
|
||||||
# Reload services
|
# Reload services
|
||||||
# ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gitea.log"
|
# ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gitea.log"
|
||||||
sleep 20
|
sleep 20
|
||||||
|
Loading…
Reference in New Issue
Block a user