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
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
|
||||
# Remove trailing "/" for next commands
|
||||
path=${path%/}
|
||||
# Correct 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
|
||||
ynh_app_setting_set "$app" domain "$domain"
|
||||
ynh_app_setting_set "$app" path "$path"
|
||||
ynh_app_setting_set "$app" is_public "$is_public"
|
||||
|
||||
# Check domain/path availability
|
||||
|
@ -24,8 +31,8 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|| ynh_die "Path not available: ${domain}${path}"
|
||||
|
||||
# Download source
|
||||
sudo wget 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/index.html
|
||||
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
|
||||
|
||||
# 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 [[ $is_public -eq 1 ]]; then
|
||||
# unprotected_uris allows SSO credentials to be passed anyway.
|
||||
ynh_app_setting_set "$app" unprotected_uris "/"
|
||||
fi
|
||||
|
||||
|
|
|
@ -12,9 +12,12 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
domain=$(ynh_app_setting_get "$app" domain)
|
||||
path=$(ynh_app_setting_get "$app" path)
|
||||
|
||||
# Check domain/path availability
|
||||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
||||
|| ynh_die "Path not available: ${domain}${path}"
|
||||
# Restore NGINX configuration
|
||||
conf=/etc/nginx/conf.d/$domain.d/$app.conf
|
||||
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
|
||||
src_path="/var/www/${app}"
|
||||
|
@ -23,8 +26,5 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
# Restore permissions to app files
|
||||
sudo chown -R root: "$src_path"
|
||||
|
||||
# Restore NGINX configuration
|
||||
sudo cp -a ./nginx.conf "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
||||
|
||||
# Restart webserver
|
||||
sudo service nginx reload
|
||||
|
|
|
@ -13,16 +13,9 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
path=$(ynh_app_setting_get "$app" path)
|
||||
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
|
||||
sudo wget 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/index.html
|
||||
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
|
||||
|
||||
# Copy source files
|
||||
|
|
Loading…
Reference in a new issue