diff --git a/README.md b/README.md index 40c716e..d551234 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Status](https://img.shields.io/badge/status-in_progress-yellow.svg?style=flat)](https://github.com/magikcypress/mastodon_ynh/milestones) [![Yunohost version](https://img.shields.io/badge/yunohost-2.4.2_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost) -:warning: working process for the moment, do not working :warning: +:warning: working process for the moment, do not working correctly & do not install in production :warning: ## Mastodon c'est quoi ? diff --git a/manifest.json b/manifest.json index 23184f6..22ce245 100644 --- a/manifest.json +++ b/manifest.json @@ -50,6 +50,15 @@ }, "example": "john" }, + { + "name": "passwd", + "type": "password", + "ask": { + "en": "Add password for the Admin YunoHost", + "fr": "Ajouter le mot de passe l'Administrateur YunoHost" + }, + "example": "adminpassword" + }, { "name": "is_public", "ask": { diff --git a/scripts/install b/scripts/install index 70e9668..aa60d97 100644 --- a/scripts/install +++ b/scripts/install @@ -16,6 +16,7 @@ TRAP_ON # Active trap to stop the script if an error is detected. domain=$YNH_APP_ARG_DOMAIN path=$YNH_APP_ARG_PATH admin_mastodon=$YNH_APP_ARG_ADMIN +admin_pass=$YNH_APP_ARG_PASSWD is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME @@ -33,8 +34,8 @@ CHECK_FINALPATH ynh_app_setting_set $app domain $domain ynh_app_setting_set $app path $path ynh_app_setting_set $app admin $admin_mastodon +ynh_app_setting_set $app pass $admin_pass ynh_app_setting_set $app is_public $is_public -# ynh_app_setting_set $app language $language # Create user unix sudo adduser $app --home /opt/$app --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password --disabled-login @@ -101,13 +102,12 @@ popd # sudo chown -R $app: "${final_path}" # Install de rbenv -# Tips: rbenv init - bash (see: https://github.com/rbenv/rbenv/issues/925) sudo su - $app <> ~/.profile echo 'export PATH="/opt/mastodon/.rbenv/bin:/opt/mastodon/live/bin:$PATH"' >> ~/.bashrc -echo 'eval "\$(rbenv init - bash)"' >> ~/.bashrc +echo 'eval "\$(rbenv init -)"' >> ~/.profile COMMANDS # Install ruby-build @@ -127,19 +127,6 @@ bin/bundle install --deployment --without development test yarn install --production MCOMMANDS -# Vérif Mastodon -sudo su - $app <>>>>>> refs/remotes/magikcypress/master # Copy nginx config sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf sudo sed -i "s@__PATH__@$path@g" /etc/nginx/conf.d/$domain.d/$app.conf @@ -236,8 +235,4 @@ fi sudo yunohost app ssowatconf # Reload Nginx -sudo systemctl reload nginx || true -# debug -# sudo systemctl status nginx -# sudo systemctl reload nginx - +sudo systemctl reload nginx \ No newline at end of file diff --git a/scripts/remove b/scripts/remove index ca98596..869f63e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -64,6 +64,7 @@ ynh_psql_drop_db "${app}_production" ynh_psql_drop_role "${app}" # Remove Debian package +sudo apt-get remove --purge -y yarn #sudo apt-get remove --purge -y imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file curl git # Delete redis package #sudo apt-get remove --purge -y redis-server redis-tools @@ -84,15 +85,12 @@ SECURE_REMOVE '/var/log/$app/' # Delete cronlog SECURE_REMOVE '/etc/cron.d/$app' # Delete source.list -SECURE_REMOVE '/etc/apt/sources.list.d/backports.list' -SECURE_REMOVE '/etc/apt/sources.list.d/yarn.list' +sudo rm /etc/apt/sources.list.d/backports.list +sudo rm /etc/apt/sources.list.d/yarn.list # Delete ruby symb link # sudo rm /usr/bin/ruby -# Uninstall Yarn -sudo npm uninstall yarn - # Remove user sudo userdel -f $app