mirror of
https://framagit.org/YunoHost-Apps/gitea_ynh.git
synced 2024-11-23 19:41:36 +01:00
Add jwt secret because gitea edit config if not present
This commit is contained in:
parent
676d283d14
commit
b7b73bbf89
@ -2,7 +2,7 @@
|
|||||||
APP_NAME = Gitea
|
APP_NAME = Gitea
|
||||||
RUN_USER = __APP__
|
RUN_USER = __APP__
|
||||||
RUN_MODE = prod
|
RUN_MODE = prod
|
||||||
WORK_PATH =__INSTALL_DIR__
|
WORK_PATH = __INSTALL_DIR__
|
||||||
|
|
||||||
[actions]
|
[actions]
|
||||||
ENABLED = false
|
ENABLED = false
|
||||||
@ -78,7 +78,7 @@ logger.access.MODE =
|
|||||||
logger.router.MODE = router
|
logger.router.MODE = router
|
||||||
logger.xorm.MODE = xorm
|
logger.xorm.MODE = xorm
|
||||||
|
|
||||||
REDIRECT_MACARON_LOG= true
|
REDIRECT_MACARON_LOG = true
|
||||||
MACARON = file
|
MACARON = file
|
||||||
|
|
||||||
[log.file]
|
[log.file]
|
||||||
@ -101,3 +101,6 @@ SECRET_KEY = __SECRET_KEY__
|
|||||||
REVERSE_PROXY_AUTHENTICATION_USER = REMOTE-USER
|
REVERSE_PROXY_AUTHENTICATION_USER = REMOTE-USER
|
||||||
REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128
|
REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128
|
||||||
INTERNAL_TOKEN = __INTERNAL_TOKEN__
|
INTERNAL_TOKEN = __INTERNAL_TOKEN__
|
||||||
|
|
||||||
|
[oauth2]
|
||||||
|
JWT_SECRET = __JWT_SECRET__
|
||||||
|
@ -45,10 +45,12 @@ ynh_script_progression --message="Configuring application, step 1/2..."
|
|||||||
internal_token=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret INTERNAL_TOKEN)
|
internal_token=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret INTERNAL_TOKEN)
|
||||||
secret_key=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret SECRET_KEY)
|
secret_key=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret SECRET_KEY)
|
||||||
lfs_jwt_secret=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)
|
lfs_jwt_secret=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)
|
||||||
|
jwt_secret=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)
|
||||||
|
|
||||||
ynh_app_setting_set --app="$app" --key=internal_token --value="$internal_token"
|
ynh_app_setting_set --app="$app" --key=internal_token --value="$internal_token"
|
||||||
ynh_app_setting_set --app="$app" --key=secret_key --value="$secret_key"
|
ynh_app_setting_set --app="$app" --key=secret_key --value="$secret_key"
|
||||||
ynh_app_setting_set --app="$app" --key=lfs_jwt_secret --value="$lfs_jwt_secret"
|
ynh_app_setting_set --app="$app" --key=lfs_jwt_secret --value="$lfs_jwt_secret"
|
||||||
|
ynh_app_setting_set --app "$app" --key jwt_secret --value="$jwt_secret"
|
||||||
|
|
||||||
ynh_add_config --template='app.ini' --destination="$install_dir/custom/conf/app.ini"
|
ynh_add_config --template='app.ini' --destination="$install_dir/custom/conf/app.ini"
|
||||||
|
|
||||||
|
@ -81,6 +81,11 @@ if [[ -z "${lfs_jwt_secret:-}" ]]; then
|
|||||||
ynh_app_setting_set --app "$app" --key lfs_jwt_secret --value="$lfs_jwt_secret"
|
ynh_app_setting_set --app "$app" --key lfs_jwt_secret --value="$lfs_jwt_secret"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${jwt_secret:-}" ]]; then
|
||||||
|
jwt_secret=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)
|
||||||
|
ynh_app_setting_set --app "$app" --key jwt_secret --value="$jwt_secret"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user