mirror of
https://github.com/YunoHost-Apps/mastodon_ynh.git
synced 2024-09-03 19:46:02 +02:00
commit
a4fe373844
4 changed files with 21 additions and 20 deletions
|
@ -1,10 +1,10 @@
|
|||
# Mastodon for YunoHost
|
||||
|
||||
[](https://github.com/YunoHost-Apps/mastodon_ynh/releases)
|
||||
[](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)
|
||||
[](https://github.com/YunoHost/yunohost)
|
||||
[](https://github.com/YunoHost/yunohost)
|
||||
[](https://github.com/YunoHost-Apps/mastodon_ynh/issues)
|
||||
|
||||
[](https://install-app.yunohost.org/?app=mastodon)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"en": "Mastodon is a free, open-source social network.",
|
||||
"fr": "Mastodon est un réseau social gratuit et open source."
|
||||
},
|
||||
"version": "1.4.7",
|
||||
"version": "2.2.0",
|
||||
"url": "https://github.com/tootsuite/mastodon",
|
||||
"license": "AGPL v3.0",
|
||||
"maintainer": {
|
||||
|
|
|
@ -47,7 +47,7 @@ ynh_package_install imagemagick libpq-dev libxml2-dev libxslt1-dev file curl apt
|
|||
ynh_package_install redis-server redis-tools
|
||||
|
||||
# Install postgresql
|
||||
ynh_package_install postgresql postgresql-contrib
|
||||
ynh_package_install postgresql postgresql-contrib postgresql-server-dev-9.4
|
||||
|
||||
# Install Ruby
|
||||
ynh_package_install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
|
||||
|
@ -121,17 +121,18 @@ COMMANDS
|
|||
|
||||
# Install ruby-build
|
||||
sudo su - $app <<RCOMMANDS
|
||||
/opt/mastodon/.rbenv/bin/rbenv install 2.4.1
|
||||
/opt/mastodon/.rbenv/versions/2.4.1/bin/ruby -v
|
||||
/opt/mastodon/.rbenv/bin/rbenv install 2.5.0
|
||||
/opt/mastodon/.rbenv/versions/2.5.0/bin/ruby -v
|
||||
RCOMMANDS
|
||||
|
||||
# Create symlink for ruby
|
||||
sudo ln -s /opt/mastodon/.rbenv/versions/2.4.1/bin/ruby /usr/bin/ruby || true
|
||||
sudo rm /usr/bin/ruby || true
|
||||
sudo ln -s /opt/mastodon/.rbenv/versions/2.5.0/bin/ruby /usr/bin/ruby || true
|
||||
|
||||
# Install Mastodon
|
||||
sudo su - $app <<MCOMMANDS
|
||||
pushd ~/live
|
||||
/opt/mastodon/.rbenv/versions/2.4.1/bin/gem install bundler
|
||||
/opt/mastodon/.rbenv/versions/2.5.0/bin/gem install bundler
|
||||
bin/bundle install --deployment --without development test
|
||||
yarn install --production
|
||||
MCOMMANDS
|
||||
|
@ -167,6 +168,7 @@ sudo sed -i "s@#SMTP_OPENSSL_VERIFY_MODE=peer@SMTP_OPENSSL_VERIFY_MODE=none@g" "
|
|||
# Preconfig CSS & JS
|
||||
sudo su - $app <<CCOMMANDS
|
||||
pushd ~/live
|
||||
echo "SAFETY_ASSURED=1">> .env.production
|
||||
RAILS_ENV=production bin/bundle exec rails db:setup
|
||||
RAILS_ENV=production bin/bundle exec rails --trace assets:precompile
|
||||
CCOMMANDS
|
||||
|
|
|
@ -63,24 +63,25 @@ if [[ $node_version =~ ^v4.*$ ]]; then
|
|||
sudo apt-get -y install nodejs
|
||||
fi
|
||||
|
||||
# add additional package for release 1.4
|
||||
ynh_package_install pkg-config libprotobuf-dev protobuf-compiler libicu-dev libidn11-dev
|
||||
# add additional package for upgrade
|
||||
ynh_package_install pkg-config libprotobuf-dev protobuf-compiler libicu-dev libidn11-dev postgresql-server-dev-9.4
|
||||
|
||||
# Install ruby 2.4.2 for release 2.0
|
||||
# Install ruby 2.5.0 for release 2.0
|
||||
sudo su - $app <<RCOMMANDS
|
||||
cd $final_path/.rbenv && git pull && cd -
|
||||
cd $final_path/.rbenv/plugins/ruby-build && git pull && cd -
|
||||
$final_path/.rbenv/bin/rbenv install 2.4.2 || true
|
||||
$final_path/.rbenv/versions/2.4.2/bin/ruby -v
|
||||
$final_path/.rbenv/bin/rbenv install 2.5.0 || true
|
||||
$final_path/.rbenv/versions/2.5.0/bin/ruby -v
|
||||
RCOMMANDS
|
||||
|
||||
# Create symlink for ruby 2.4.2
|
||||
sudo ln -s $final_path/.rbenv/versions/2.4.2/bin/ruby /usr/bin/ruby || true
|
||||
# Create symlink for ruby 2.5.0
|
||||
sudo rm /usr/bin/ruby || true
|
||||
sudo ln -s $final_path/.rbenv/versions/2.5.0/bin/ruby /usr/bin/ruby || true
|
||||
|
||||
# Install Mastodon
|
||||
sudo su - $app <<MCOMMANDS
|
||||
pushd ~/live
|
||||
$final_path/.rbenv/versions/2.4.2/bin/gem install bundler
|
||||
$final_path/.rbenv/versions/2.5.0/bin/gem install bundler
|
||||
bin/bundle install --deployment --without development test
|
||||
yarn install --pure-lockfile
|
||||
MCOMMANDS
|
||||
|
@ -88,13 +89,11 @@ MCOMMANDS
|
|||
# Apply Mastodon upgrade
|
||||
sudo su - $app <<COMMANDS
|
||||
pushd ~/live
|
||||
#bin/bundle install
|
||||
#yarn install --pure-lockfile
|
||||
# For 1.4.1 -> 1.4.2 migration prepare_for_foreign_keys is needed
|
||||
# RAILS_ENV=production bundle exec rails mastodon:maintenance:prepare_for_foreign_keys
|
||||
RAILS_ENV=production bundle exec rails assets:clean
|
||||
RAILS_ENV=production bundle exec rails assets:precompile
|
||||
RAILS_ENV=production bundle exec rails db:migrate
|
||||
# Upgrade to 2.2.0
|
||||
RAILS_ENV=production bundle exec rails mastodon:maintenance:remove_regeneration_markers
|
||||
COMMANDS
|
||||
|
||||
# Restart Mastodon
|
||||
|
|
Loading…
Add table
Reference in a new issue