mirror of
https://github.com/YunoHost-Apps/keeweb_ynh.git
synced 2024-09-03 19:26:33 +02:00
commit
29dd3c38fa
3 changed files with 19 additions and 20 deletions
|
@ -13,10 +13,17 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
path=$YNH_APP_ARG_PATH
|
path=$YNH_APP_ARG_PATH
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
|
||||||
# Remove trailing "/" for next commands
|
# Correct path
|
||||||
path=${path%/}
|
if [ "${path:0:1}" != "/" ]; then
|
||||||
|
path="/$path"
|
||||||
|
fi
|
||||||
|
if [ "${path:${#path}-1}" == "/" ] && [ ${#path} -gt 1 ]; then
|
||||||
|
path="${path:0:${#path}-1}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Save app settings
|
# Save app settings
|
||||||
|
ynh_app_setting_set "$app" domain "$domain"
|
||||||
|
ynh_app_setting_set "$app" path "$path"
|
||||||
ynh_app_setting_set "$app" is_public "$is_public"
|
ynh_app_setting_set "$app" is_public "$is_public"
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check domain/path availability
|
||||||
|
@ -24,8 +31,8 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
|| ynh_die "Path not available: ${domain}${path}"
|
|| ynh_die "Path not available: ${domain}${path}"
|
||||||
|
|
||||||
# Download source
|
# Download source
|
||||||
sudo wget https://raw.githubusercontent.com/keeweb/keeweb/gh-pages/index.html
|
sudo wget -q https://raw.githubusercontent.com/keeweb/keeweb/gh-pages/index.html
|
||||||
sudo wget https://raw.githubusercontent.com/keeweb/keeweb/gh-pages/manifest.appcache
|
sudo wget -q https://raw.githubusercontent.com/keeweb/keeweb/gh-pages/manifest.appcache
|
||||||
sudo sed -i.bak 's/(no-config)/config.json/g' index.html
|
sudo sed -i.bak 's/(no-config)/config.json/g' index.html
|
||||||
|
|
||||||
# Copy source files
|
# Copy source files
|
||||||
|
@ -43,7 +50,6 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
# If app is public, add url to SSOWat conf as skipped_uris
|
# If app is public, add url to SSOWat conf as skipped_uris
|
||||||
if [[ $is_public -eq 1 ]]; then
|
if [[ $is_public -eq 1 ]]; then
|
||||||
# unprotected_uris allows SSO credentials to be passed anyway.
|
|
||||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,12 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get "$app" domain)
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
path=$(ynh_app_setting_get "$app" path)
|
path=$(ynh_app_setting_get "$app" path)
|
||||||
|
|
||||||
# Check domain/path availability
|
# Restore NGINX configuration
|
||||||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
conf=/etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|| ynh_die "Path not available: ${domain}${path}"
|
if [ -f $conf ]; then
|
||||||
|
ynh_die "There is already a nginx conf file at this path: $conf"
|
||||||
|
fi
|
||||||
|
sudo cp -a ./nginx.conf $conf
|
||||||
|
|
||||||
# Restore sources & data
|
# Restore sources & data
|
||||||
src_path="/var/www/${app}"
|
src_path="/var/www/${app}"
|
||||||
|
@ -23,8 +26,5 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
# Restore permissions to app files
|
# Restore permissions to app files
|
||||||
sudo chown -R root: "$src_path"
|
sudo chown -R root: "$src_path"
|
||||||
|
|
||||||
# Restore NGINX configuration
|
|
||||||
sudo cp -a ./nginx.conf "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
|
||||||
|
|
||||||
# Restart webserver
|
# Restart webserver
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
|
|
|
@ -12,17 +12,10 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get "$app" domain)
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
path=$(ynh_app_setting_get "$app" path)
|
path=$(ynh_app_setting_get "$app" path)
|
||||||
is_public=$(ynh_app_setting_get "$app" is_public)
|
is_public=$(ynh_app_setting_get "$app" is_public)
|
||||||
|
|
||||||
# Remove trailing "/" for next commands
|
|
||||||
path=${path%/}
|
|
||||||
|
|
||||||
# Check domain/path availability
|
|
||||||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
|
||||||
|| ynh_die "Path not available: ${domain}${path}"
|
|
||||||
|
|
||||||
# Download source
|
# Download source
|
||||||
sudo wget https://raw.githubusercontent.com/keeweb/keeweb/gh-pages/index.html
|
sudo wget -q https://raw.githubusercontent.com/keeweb/keeweb/gh-pages/index.html
|
||||||
sudo wget https://raw.githubusercontent.com/keeweb/keeweb/gh-pages/manifest.appcache
|
sudo wget -q https://raw.githubusercontent.com/keeweb/keeweb/gh-pages/manifest.appcache
|
||||||
sudo sed -i.bak 's/(no-config)/config.json/g' index.html
|
sudo sed -i.bak 's/(no-config)/config.json/g' index.html
|
||||||
|
|
||||||
# Copy source files
|
# Copy source files
|
||||||
|
|
Loading…
Reference in a new issue