1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mastodon_ynh.git synced 2024-09-03 19:46:02 +02:00

[fix] Clear code & fix install

This commit is contained in:
magikcypress 2017-04-16 16:08:42 +02:00
parent 9bddc797b4
commit 2be310eefa
6 changed files with 27 additions and 25 deletions

View file

@ -1,9 +1,11 @@
# Mastodon for YunoHost # Mastodon for YunoHost
[![Status](https://img.shields.io/badge/status-in_progress-yellow.svg?style=flat)](https://github.com/Snipees/couchpotato_ynh/milestones) [![Latest Version](https://img.shields.io/badge/version-_--_-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases)
[![Status](https://img.shields.io/badge/status-testing-yellow.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/milestones)
[![Dependencies](https://img.shields.io/badge/dependencies-includes-lightgrey.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies)
[![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/YunoHost-Apps/mastodon_ynh/master/LICENSE)
[![Yunohost version](https://img.shields.io/badge/yunohost-2.4.2_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost) [![Yunohost version](https://img.shields.io/badge/yunohost-2.4.2_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost)
[![GitHub issues](https://img.shields.io/github/issues/YunoHost-Apps/mastodon_ynh.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/issues)
:warning: working process for the moment, do not working correctly & do not install in production :warning:
## Mastodon c'est quoi ? ## Mastodon c'est quoi ?
@ -19,6 +21,12 @@ Mastodon est un réseau social gratuit et open source. Une alternative décentra
`$ sudo yunohost app upgrade --verbose mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh.git` `$ sudo yunohost app upgrade --verbose mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh.git`
## Recommandations
Vous ne pouvez pas installer Mastodon en subdirectory, vous devez obligatoirement utiliser un domaine ou un sous-domaine pour cette application.
Il semble important de fermer les inscriptions pour votre Mastodon, pour que ça reste une instance privé. Nous vous invitons à bloquer les instances distantes malfaisantes depuis l'interface d'administration. Vous pouvez également ajouter un texte sur votre page d'accueil dans l'administration.
## What is Mastodon? ## What is Mastodon?
Mastodon is a free, open-source social network. A decentralized alternative to commercial platforms, it avoids the risks of a single company monopolizing your communication. Pick a server that you trust — whichever you choose, you can interact with everyone else. Anyone can run their own Mastodon instance and participate in the social network seamlessly. Mastodon is a free, open-source social network. A decentralized alternative to commercial platforms, it avoids the risks of a single company monopolizing your communication. Pick a server that you trust — whichever you choose, you can interact with everyone else. Anyone can run their own Mastodon instance and participate in the social network seamlessly.
@ -32,3 +40,9 @@ Mastodon is a free, open-source social network. A decentralized alternative to c
### Update ### Update
`$ sudo yunohost app upgrade --verbose mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh.git` `$ sudo yunohost app upgrade --verbose mastodon -u https://github.com/YunoHost-Apps/mastodon_ynh.git`
## Recommendation
You can't install Mastodon in subdirectory, you must use a domain or subdomain for this application.
It seems important to close the inscriptions for your Mastodon, so that it remains a private body. We invite you to block remote malicious instances from the administration interface. You can also add text on your home page.

View file

@ -1,4 +1,7 @@
@daily __APP__ cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:media:clear @daily __APP__ cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:media:clear
@daily __APP__ cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:push:refresh @daily __APP__ cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:push:refresh
@daily __APP__ cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:feeds:clear @daily __APP__ cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:feeds:clear
@daily __APP__ cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:users:clear @daily __APP__ cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:users:clear

View file

@ -1,4 +1,4 @@
location __PATH__ { location / {
if ($scheme = http) { if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;

View file

@ -31,16 +31,6 @@
}, },
"example": "domain.org" "example": "domain.org"
}, },
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for Mastodon (don't use subdir ex: /mastodon)",
"fr": "Choisissez un chemin pour Mastodon (ne pas utiliser de répertoire ex: /mastodon)"
},
"example": "/",
"default": "/"
},
{ {
"name": "admin", "name": "admin",
"type": "user", "type": "user",
@ -75,7 +65,7 @@
"fr": "Mastodon est-il public ?" "fr": "Mastodon est-il public ?"
}, },
"choices": ["Yes", "No"], "choices": ["Yes", "No"],
"default": "Yes" "default": "No"
} }
] ]
} }

View file

@ -22,7 +22,7 @@ EXIT_PROPERLY () { # Causes the script to stop in the event of an error. And cle
fi fi
# Compensates the ssowat bug that does not remove the app's input in case of installation error. # Compensates the ssowat bug that does not remove the app's input in case of installation error.
sudo sed -i "\@\"$domain$path/\":@d" /etc/ssowat/conf.json sudo sed -i "\@\"$domain/\":@d" /etc/ssowat/conf.json
if [ "$ynh_version" = "2.2" ]; then if [ "$ynh_version" = "2.2" ]; then
/bin/bash $script_dir/remove /bin/bash $script_dir/remove
@ -54,7 +54,7 @@ CHECK_PATH () { # Checks / at the beginning of the path. And his absence at the
} }
CHECK_DOMAINPATH () { # Checks the availability of the path and domain. CHECK_DOMAINPATH () { # Checks the availability of the path and domain.
sudo yunohost app checkurl $domain$path -a $app sudo yunohost app checkurl $domain -a $app
} }
CHECK_FINALPATH () { # Checks that the destination folder is not already in use. CHECK_FINALPATH () { # Checks that the destination folder is not already in use.
@ -110,7 +110,6 @@ SETUP_SOURCE () { # Download source, decompress and copu into $final_path
fi fi
} }
### REMOVE SCRIPT ### REMOVE SCRIPT
REMOVE_NGINX_CONF () { # Delete nginx configuration REMOVE_NGINX_CONF () { # Delete nginx configuration

View file

@ -14,7 +14,6 @@ CLEAN_SETUP () {
TRAP_ON # Active trap to stop the script if an error is detected. TRAP_ON # Active trap to stop the script if an error is detected.
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH
admin_mastodon=$YNH_APP_ARG_ADMIN admin_mastodon=$YNH_APP_ARG_ADMIN
admin_pass=$YNH_APP_ARG_PASSWD admin_pass=$YNH_APP_ARG_PASSWD
language=$YNH_APP_ARG_LANGUAGE language=$YNH_APP_ARG_LANGUAGE
@ -26,14 +25,11 @@ CHECK_VAR "$app" "app name not set"
CHECK_USER "$admin_mastodon" CHECK_USER "$admin_mastodon"
CHECK_PATH
CHECK_DOMAINPATH CHECK_DOMAINPATH
CHECK_FINALPATH CHECK_FINALPATH
ynh_app_setting_set $app domain $domain 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 admin $admin_mastodon
ynh_app_setting_set $app pass $admin_pass ynh_app_setting_set $app pass $admin_pass
ynh_app_setting_set $app language $language ynh_app_setting_set $app language $language
@ -188,12 +184,12 @@ sudo yunohost service add mastodon-streaming
# Copy nginx config # Copy nginx config
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf 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
sudo sed -i "s@__FINALPATH__@$final_path@g" /etc/nginx/conf.d/$domain.d/$app.conf
# Install crontab # Install crontab
sudo cp ../conf/crontab_mastodon /etc/cron.d/$app sudo cp ../conf/crontab_mastodon /etc/cron.d/$app
sudo sed -i "s@__APP__@$app@g" /etc/cron.d/$app sudo sed -i "s@__APP__@$app@g" /etc/cron.d/$app
# Restart crontab
sudo systemctl restart cron
# Private or not # Private or not
if [ "$is_public" = "Yes" ]; if [ "$is_public" = "Yes" ];