diff --git a/conf/.env b/conf/.env index 85c138e..2d91850 100644 --- a/conf/.env +++ b/conf/.env @@ -3,3 +3,4 @@ CACP_REDIRECT_HOST=https://__DOMAIN__ CACP_REDIRECT_PATH=__PATH_URL__ CACP_DEBUG=FALSE CACP_LOG=FALSE +CACP_BYPASS_SANDBOX=__BYPASS_SANDBOX__ diff --git a/scripts/install b/scripts/install index d64af45..861bc00 100755 --- a/scripts/install +++ b/scripts/install @@ -208,6 +208,19 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 +# We must use chrome sandbox for kernels 5.x, 6.x doesn't need it anymore +kernel_release=$(uname -r) +if [[ $kernel_release == 5.* ]] +then + bypass_sandbox="TRUE" + if [ $install_chromium -eq 1 ] + then + ynh_print_warn --message="Using non sandboxed chromium as kernel release is less than 6.x" + fi +else + bypass_sandbox="FALSE" +fi + ynh_add_config --template=".env" --destination="$final_path/.env" # FIXME: this should be handled by the core in the future diff --git a/scripts/upgrade b/scripts/upgrade index 2d95ecb..66d1d60 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -192,10 +192,18 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=1 -### Same as during install -### -### The file will automatically be backed-up if it's found to be manually modified (because -### ynh_add_config keeps track of the file's checksum) +# We must use chrome sandbox for kernels 5.x, 6.x doesn't need it anymore +kernel_release=$(uname -r) +if [[ $kernel_release == 5.* ]] +then + bypass_sandbox="TRUE" + if [ $install_chromium -eq 1 ] + then + ynh_print_warn --message="Using non sandboxed chromium as kernel release is less than 6.x" + fi +else + bypass_sandbox="FALSE" +fi ynh_add_config --template=".env" --destination="$final_path/.env"