1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/chtickynotes_ynh.git synced 2024-09-03 18:15:57 +02:00
This commit is contained in:
ericgaspar 2020-11-05 13:58:06 +01:00
parent 61733c16d0
commit 3001da8c68
No known key found for this signature in database
GPG key ID: 574F281483054D44
7 changed files with 122 additions and 23 deletions

View file

@ -1,16 +1,16 @@
# Chtickynotes for YunoHost
# ChtickyNotes for YunoHost
[![Integration level](https://dash.yunohost.org/integration/chtickynotes.svg)](https://dash.yunohost.org/appci/app/chtickynotes) ![](https://ci-apps.yunohost.org/ci/badges/chtickynotes.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/chtickynotes.maintain.svg)
[![Install chtickynotes with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=chtickynotes)
[![Install ChtickyNotes with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=chtickynotes)
*[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install chtickynotes quickly and simply on a YunoHost server.
> *This package allows you to install ChtickyNotes quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview
chtickynotes_ynh core is based on [Post It All!](https://github.com/txusko/PostItAll).
chtickynotes_ynh is a "simple post-it" application. Its main features are:
ChtickyNotes core is based on [Post It All!](https://github.com/txusko/PostItAll).
ChtickyNotes is a "simple post-it" application. Its main features are:
- notes movable and resizable
- edit note by just typing on it (or CTRL-V to paste chunks of HTML)
- menu on each note to change its color, and so on
@ -24,14 +24,6 @@ chtickynotes_ynh is a "simple post-it" application. Its main features are:
![](https://lh4.googleusercontent.com/-ATC-XA5iVsc/VM06cI3ClLI/AAAAAAAACHo/uBhDViaSBRg/s800/chtickynotes.gif)
## Demo
* [Official demo](Link to a demo site for this app.)
## Configuration
How to configure this app: From an admin panel, a plain file with SSH, or any other way.
## Documentation
* Official documentation: Link to the official documentation of this app
@ -41,8 +33,8 @@ How to configure this app: From an admin panel, a plain file with SSH, or any ot
#### Multi-user support
Are LDAP and HTTP auth supported?
Can the app be used by multiple users?
* Are LDAP and HTTP auth supported?
* Can the app be used by multiple users?
#### Supported architectures

View file

@ -46,4 +46,4 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
ynh_print_info --message="Backup script completed for ChtickyNotes. (YunoHost will then actually copy those files to the archive)."

View file

@ -0,0 +1,107 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
# Stop script if errors
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
old_domain=$YNH_APP_OLD_DOMAIN
old_path=$YNH_APP_OLD_PATH
new_domain=$YNH_APP_NEW_DOMAIN
new_path=$YNH_APP_NEW_PATH
app=$YNH_APP_INSTANCE_NAME
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up ChtickyNotes before changing its URL (may take a while)..." --weight=2
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED
#=================================================
change_domain=0
if [ "$old_domain" != "$new_domain" ]
then
change_domain=1
fi
change_path=0
if [ "$old_path" != "$new_path" ]
then
change_path=1
fi
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
# Change the path in the NGINX config file
if [ $change_path -eq 1 ]
then
# Make a backup of the original NGINX config file if modified
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
# Set global variables for NGINX helper
domain="$old_domain"
path_url="$new_path"
# Create a dedicated NGINX config
ynh_add_nginx_config
fi
# Change the domain for NGINX
if [ $change_domain -eq 1 ]
then
# Delete file checksum for the old conf file location
ynh_delete_file_checksum --file="$nginx_conf_path"
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
# Store file checksum for the new config file location
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
fi
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for ChtickyNotes" --last

View file

@ -88,4 +88,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last
ynh_script_progression --message="Installation of ChtickyNotes completed" --last

View file

@ -22,7 +22,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing app main directory..." --weight=2
ynh_script_progression --message="Removing ChtickyNotes main directory..." --weight=2
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
@ -39,4 +39,4 @@ ynh_remove_nginx_config
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last
ynh_script_progression --message="Removal of ChtickyNotes completed" --last

View file

@ -47,7 +47,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=2
ynh_script_progression --message="Restoring ChtickyNotes main directory..." --weight=2
ynh_restore_file --origin_path="$final_path"
@ -78,4 +78,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app" --last
ynh_script_progression --message="Restoration completed for ChtickyNotes" --last

View file

@ -49,7 +49,7 @@ fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
ynh_script_progression --message="Backing up ChtickyNotes before upgrading (may take a while)..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
@ -87,4 +87,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last
ynh_script_progression --message="Upgrade of ChtickyNotes completed" --last