From 383afca10c79cbe1e9932fccff5a7bb650384513 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 10 May 2019 11:36:13 +0200 Subject: switch to ynh_send_readme_to_admin__2 --- scripts/_common.sh | 57 ------------------------------------------------------ 1 file changed, 57 deletions(-) (limited to 'scripts/_common.sh') diff --git a/scripts/_common.sh b/scripts/_common.sh index 79dc04c..4a70d0b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -19,60 +19,3 @@ pkg_dependencies="imagemagick libpq-dev libxml2-dev libxslt1-dev file curl apt-t #================================================= # FUTURE OFFICIAL HELPERS #================================================= - -# Send an email to inform the administrator -# -# usage: ynh_send_readme_to_admin app_message [recipients] -# | arg: app_message - The message to send to the administrator. -# | arg: recipients - The recipients of this email. Use spaces to separate multiples recipients. - default: root -# example: "root admin@domain" -# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you -# example: "root admin@domain user1 user2" -ynh_send_readme_to_admin() { - local app_message="${1:-...No specific information...}" - local recipients="${2:-root}" - - # Retrieve the email of users - find_mails () { - local list_mails="$1" - local mail - local recipients=" " - # Read each mail in argument - for mail in $list_mails - do - # Keep root or a real email address as it is - if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@" - then - recipients="$recipients $mail" - else - # But replace an user name without a domain after by its email - if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null) - then - recipients="$recipients $mail" - fi - fi - done - echo "$recipients" - } - recipients=$(find_mails "$recipients") - - local mail_subject="☁️🆈🅽🅷☁️: \`$app\` was just installed!" - - local mail_message="This is an automated message from your beloved YunoHost server. -Specific information for the application $app. -$app_message ---- -Automatic diagnosis data from YunoHost -$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" - - # Define binary to use for mail command - if [ -e /usr/bin/bsd-mailx ] - then - local mail_bin=/usr/bin/bsd-mailx - else - local mail_bin=/usr/bin/mail.mailutils - fi - - # Send the email to the recipients - echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" -} -- cgit v1.2.3-70-g09d2 From 7dc905542a19caab58eb5769165d7b1426492f8c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 14 May 2019 21:04:05 +0200 Subject: Cleanup dependencies --- scripts/_common.sh | 4 ++-- scripts/install | 17 +---------------- scripts/restore | 18 ++---------------- scripts/upgrade | 15 +++++---------- 4 files changed, 10 insertions(+), 44 deletions(-) (limited to 'scripts/_common.sh') diff --git a/scripts/_common.sh b/scripts/_common.sh index 4a70d0b..904553d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,8 +5,8 @@ #================================================= # dependencies used by the app -#pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core g++ libprotobuf-dev protobuf-compiler pkg-config gcc autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev nginx redis-server redis-tools postgresql postgresql-contrib certbot yarn libidn11-dev libicu-dev libjemalloc-dev" -pkg_dependencies="imagemagick libpq-dev libxml2-dev libxslt1-dev file curl apt-transport-https pkg-config libprotobuf-dev protobuf-compiler libicu-dev libidn11-dev redis-server redis-tools postgresql autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev ffmpeg yarn" +#pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core g++ libprotobuf-dev protobuf-compiler pkg-config nodejs gcc autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev nginx redis-server redis-tools postgresql postgresql-contrib certbot python-certbot-nginx yarn libidn11-dev libicu-dev libjemalloc-dev" + pkg_dependencies="imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core g++ libprotobuf-dev protobuf-compiler pkg-config gcc autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev redis-server redis-tools postgresql postgresql-contrib libidn11-dev libicu-dev libjemalloc-dev curl apt-transport-https" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index ff03433..2742e1d 100644 --- a/scripts/install +++ b/scripts/install @@ -88,24 +88,9 @@ ynh_app_setting_set --app=$app --key=port_stream --value=$port_stream #================================================= ynh_script_progression --message="Installing dependencies..." --weight=86 -# Import debian archive pubkey, need on ARM arch -arch=$(uname -m) -if [[ "$arch" = arm* ]]; then - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553 - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 -fi - -# Install extra_repo debian package backports & yarn -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - ynh_install_extra_repo --repo="deb http://httpredir.debian.org/debian jessie-backports main" --append -fi - -ynh_install_extra_repo --repo="deb https://dl.yarnpkg.com/debian/ stable main" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" --append - -# install nodejs ynh_install_nodejs --nodejs_version="8" - ynh_install_app_dependencies $pkg_dependencies +ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # CREATE A POSTGRESQL DATABASE diff --git a/scripts/restore b/scripts/restore index e85815c..b26661f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -85,23 +85,9 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Reinstalling dependencies..." --weight=63 -# Import debian archive pubkey, need on ARM arch -arch=$(uname -m) -if [[ "$arch" = arm* ]]; then - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553 - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 -fi - -# Install extra_repo debian package backports & yarn -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - ynh_install_extra_repo --repo="deb http://httpredir.debian.org/debian jessie-backports main" --append -fi -ynh_install_extra_repo --repo="deb https://dl.yarnpkg.com/debian/ stable main" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" --append - -# install nodejs ynh_install_nodejs --nodejs_version="8" - -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies +ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # INSTALLING RUBY AND BUNDLER diff --git a/scripts/upgrade b/scripts/upgrade index 7562d85..93cb3f0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -104,6 +104,9 @@ if [[ -z "$vapid_private_key" ]]; then ynh_app_setting_set "$app" vapid_public_key "$vapid_public_key" fi +#Remove previous added repository +ynh_remove_extra_repo + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -166,17 +169,9 @@ ynh_add_nginx_config 'port_web port_stream' #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=24 -# Install extra_repo debian package backports & yarn -if [ "$(lsb_release --codename --short)" == "jessie" ]; then - ynh_install_extra_repo --repo="deb http://httpredir.debian.org/debian jessie-backports main" --append -fi -ynh_install_extra_repo --repo="deb https://dl.yarnpkg.com/debian/ stable main" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" --append - -# Install nodejs ynh_install_nodejs --nodejs_version="8" - -# TODO: use the same mecanism with other files -ynh_install_app_dependencies $pkg_dependencies +ynh_install_app_dependencies $pkg_dependencies +ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg" #================================================= # CREATE DEDICATED USER -- cgit v1.2.3-70-g09d2