mirror of
https://github.com/YunoHost-Apps/mastodon_ynh.git
synced 2024-09-03 19:46:02 +02:00
Merge remote-tracking branch 'refs/remotes/YunoHost-Apps/master'
# Conflicts: # README.md # manifest.json # scripts/install
This commit is contained in:
commit
382de20310
6 changed files with 88 additions and 34 deletions
50
README.md
50
README.md
|
@ -1,9 +1,15 @@
|
||||||
# Mastodon for YunoHost
|
# Mastodon for YunoHost
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
[](https://github.com/magikcypress/mastodon_ynh/milestones)
|
[](https://github.com/magikcypress/mastodon_ynh/milestones)
|
||||||
|
=======
|
||||||
|
[](https://github.com/YunoHost-Apps/mastodon_ynh/releases)
|
||||||
|
[](https://github.com/YunoHost-Apps/mastodon_ynh/milestones)
|
||||||
|
[](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies)
|
||||||
|
[](https://raw.githubusercontent.com/YunoHost-Apps/mastodon_ynh/master/LICENSE)
|
||||||
|
>>>>>>> refs/remotes/YunoHost-Apps/master
|
||||||
[](https://github.com/YunoHost/yunohost)
|
[](https://github.com/YunoHost/yunohost)
|
||||||
|
[](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 ?
|
||||||
|
|
||||||
|
@ -15,10 +21,30 @@ Mastodon est un réseau social gratuit et open source. Une alternative décentra
|
||||||
|
|
||||||
`$ sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh.git`
|
`$ sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh.git`
|
||||||
|
|
||||||
|
Une fois l'installation effectuée, vous pouvez créer un compte manuellement sur Mastodon depuis votre navigateur. Lorsque vous avez crée le premier utilisateur vous pouvez créer l'administrateur de votre Mastodon. Pour celà, il faut impérativement passer par une interface en ligne de commande et taper les commandes suivantes :
|
||||||
|
|
||||||
|
**se connecter en sudo sur l'utilisateur**
|
||||||
|
|
||||||
|
`$ sudo su mastodon`
|
||||||
|
|
||||||
|
**se placer dans le répertoire où est installé Mastodon**
|
||||||
|
|
||||||
|
`$ cd /opt/mastodon/live`
|
||||||
|
|
||||||
|
**lancer la commande de création de l'administrateur**
|
||||||
|
|
||||||
|
`$ RAILS_ENV=production bin/bundle exec rails mastodon:make_admin USERNAME=*Nom de votre utilisateur*`
|
||||||
|
|
||||||
### Mise à jour
|
### Mise à jour
|
||||||
|
|
||||||
`$ 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.
|
||||||
|
@ -29,6 +55,26 @@ Mastodon is a free, open-source social network. A decentralized alternative to c
|
||||||
|
|
||||||
`$ sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh.git`
|
`$ sudo yunohost app install https://github.com/YunoHost-Apps/mastodon_ynh.git`
|
||||||
|
|
||||||
|
After installation, you can create an account manually on Mastodon from your browser. When you have created the first user you can create the administrator of your Mastodon. For this, it is imperative to go through a command line and type the following commands:
|
||||||
|
|
||||||
|
**sudo to the user**
|
||||||
|
|
||||||
|
`$ sudo su mastodon`
|
||||||
|
|
||||||
|
**change directory where Mastodon is installed**
|
||||||
|
|
||||||
|
`$ cd /opt/mastodon/live`
|
||||||
|
|
||||||
|
**launch the command to create the administrator**
|
||||||
|
|
||||||
|
`$ RAILS_ENV=production bin/bundle exec rails mastodon:make_admin USERNAME=*username*`
|
||||||
|
|
||||||
### 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.
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
@hourly 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
|
||||||
@hourly cd /opt/__APP__/live && RAILS_ENV=production /opt/__APP__/.rbenv/shims/bundle exec rake mastodon:push:refresh
|
|
||||||
@hourly 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: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:users:clear
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
location __PATH__ {
|
location / {
|
||||||
# alias __FINALPATH__/live/public;
|
|
||||||
|
|
||||||
if ($scheme = http) {
|
if ($scheme = http) {
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
"en": "Mastodon is a free, open-source social network.",
|
"en": "Mastodon is a free, open-source social network.",
|
||||||
"fr": "Mastodon est un réseau social gratuit et open source."
|
"fr": "Mastodon est un réseau social gratuit et open source."
|
||||||
},
|
},
|
||||||
"version": "0.6 dev",
|
"version": "1.1.1",
|
||||||
"url": "https://github.com/tootsuite/mastodon",
|
"url": "https://github.com/tootsuite/mastodon",
|
||||||
"license": "AGPL",
|
"license": "AGPL v3.0",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "cyp",
|
"name": "cyp, nemsia",
|
||||||
"email": "cyp@rouquin.me"
|
"email": "cyp@rouquin.me, nemsia@nemsia.org"
|
||||||
},
|
},
|
||||||
"multi_instance": false,
|
"multi_instance": false,
|
||||||
"services": [
|
"services": [
|
||||||
|
@ -32,6 +32,7 @@
|
||||||
"example": "domain.org"
|
"example": "domain.org"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
"name": "path",
|
"name": "path",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"ask": {
|
"ask": {
|
||||||
|
@ -42,6 +43,8 @@
|
||||||
"default": "/"
|
"default": "/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
=======
|
||||||
|
>>>>>>> refs/remotes/YunoHost-Apps/master
|
||||||
"name": "admin",
|
"name": "admin",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"ask": {
|
"ask": {
|
||||||
|
@ -59,6 +62,15 @@
|
||||||
},
|
},
|
||||||
"example": "adminpassword"
|
"example": "adminpassword"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "language",
|
||||||
|
"ask": {
|
||||||
|
"en": "Choose the application language",
|
||||||
|
"fr": "Choisissez la langue de l'application"
|
||||||
|
},
|
||||||
|
"choices": ["en_EN", "fr_FR"],
|
||||||
|
"default": "fr_FR"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"ask": {
|
"ask": {
|
||||||
|
@ -66,7 +78,7 @@
|
||||||
"fr": "Mastodon est-il public ?"
|
"fr": "Mastodon est-il public ?"
|
||||||
},
|
},
|
||||||
"choices": ["Yes", "No"],
|
"choices": ["Yes", "No"],
|
||||||
"default": "Yes"
|
"default": "No"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -14,9 +14,9 @@ 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
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
@ -25,16 +25,14 @@ 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 is_public $is_public
|
ynh_app_setting_set $app is_public $is_public
|
||||||
|
|
||||||
# Create user unix
|
# Create user unix
|
||||||
|
@ -136,9 +134,18 @@ sudo sed -i "s@DB_USER=postgres@DB_USER=${app}@g" "${final_path}/live/.env.produ
|
||||||
sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live/.env.production"
|
sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live/.env.production"
|
||||||
sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production"
|
sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production"
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
|
sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
|
||||||
sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
|
sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
|
||||||
sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
|
sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
|
||||||
|
=======
|
||||||
|
language="$(echo $language | head -c 2)"
|
||||||
|
sudo sed -i "s@# DEFAULT_LOCALE=de@DEFAULT_LOCALE=${language}@g" "${final_path}/live/.env.production"
|
||||||
|
|
||||||
|
sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
|
||||||
|
sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
|
||||||
|
sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production"
|
||||||
|
>>>>>>> refs/remotes/YunoHost-Apps/master
|
||||||
|
|
||||||
sudo sed -i 's,SMTP_LOGIN=,SMTP_LOGIN='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production"
|
sudo sed -i 's,SMTP_LOGIN=,SMTP_LOGIN='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production"
|
||||||
sudo sed -i "s@SMTP_PASSWORD=@SMTP_PASSWORD=${admin_pass}@g" "${final_path}/live/.env.production"
|
sudo sed -i "s@SMTP_PASSWORD=@SMTP_PASSWORD=${admin_pass}@g" "${final_path}/live/.env.production"
|
||||||
|
@ -154,25 +161,12 @@ RAILS_ENV=production bin/bundle exec rails db:setup
|
||||||
RAILS_ENV=production bin/bundle exec rails --trace assets:precompile
|
RAILS_ENV=production bin/bundle exec rails --trace assets:precompile
|
||||||
CCOMMANDS
|
CCOMMANDS
|
||||||
|
|
||||||
# TODO: Doesn't work for the moment,
|
|
||||||
# Mastodon need a user for creating an administator account
|
|
||||||
# Create admin user
|
|
||||||
# Create confirm email
|
|
||||||
sudo su - $app <<ACOMMANDS
|
|
||||||
pushd ~/live
|
|
||||||
# RAILS_ENV=production bin/bundle exec rails mastodon:make_admin USERNAME=$admin_mastodon
|
|
||||||
# RAILS_ENV=production bin/bundle exec rails mastodon:confirm_email USER_EMAIL=$admin_mastodon@$domain
|
|
||||||
ACOMMANDS
|
|
||||||
|
|
||||||
# init rbenv & create bundle
|
# init rbenv & create bundle
|
||||||
# Tips: rbenv init bash (see: https://github.com/rbenv/rbenv/issues/925)
|
|
||||||
sudo su - $app <<BCOMMANDS
|
sudo su - $app <<BCOMMANDS
|
||||||
. ~/.profile
|
. ~/.profile
|
||||||
type rbenv
|
type rbenv
|
||||||
ls -alh /opt/mastodon/.rbenv/shims/bundle || true
|
|
||||||
BCOMMANDS
|
BCOMMANDS
|
||||||
|
|
||||||
|
|
||||||
# Add Services
|
# Add Services
|
||||||
pushd $(popd)
|
pushd $(popd)
|
||||||
|
|
||||||
|
@ -196,12 +190,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" ];
|
||||||
|
|
Loading…
Add table
Reference in a new issue