From c7eb4ace251956c4ef69a3b4478c8611aab442fc Mon Sep 17 00:00:00 2001 From: nemsia Date: Sun, 21 May 2017 15:23:14 +0200 Subject: Upgrade with latest stable version (#31) * [enh] Upgrade on latest Upgrade with latest mastodon stable version --- scripts/upgrade | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/upgrade') diff --git a/scripts/upgrade b/scripts/upgrade index f070bbd..d217de6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -50,9 +50,11 @@ PULLCOMMANDS # Switch branch to tagged release cd $final_path/live +url=$(curl -s https://api.github.com/repos/tootsuite/mastodon/releases/latest | sort -r | head -1 | cut -d\" -f4) +version=$(echo $url | cut -d/ -f8) sudo su - $app < Date: Sun, 21 May 2017 17:02:13 +0200 Subject: [fix] upgrade ndeojs version --- scripts/upgrade | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts/upgrade') diff --git a/scripts/upgrade b/scripts/upgrade index d217de6..4038fa7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,6 +40,14 @@ sudo systemctl stop mastodon-*.service # Change owner of live folder sudo chown -R $app: $final_path/live +# upgrade Node.js v4 to v6 +node_version=$(nodejs --version) +if [[ $node_version =~ ^v4.*$ ]]; then + pushd /opt + curl -sL https://deb.nodesource.com/setup_6.x | sudo bash - + sudo apt-get -y install nodejs +fi + # Download Mastodon sudo su - $app < Date: Mon, 22 May 2017 00:42:09 +0200 Subject: Fix upgrade 1.4 (#33) * [fix] Upgrade nodejs + conf protobuf Fix mastodon 1.4 upgrade --- conf/nginx.conf | 9 +++++++++ scripts/upgrade | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'scripts/upgrade') diff --git a/conf/nginx.conf b/conf/nginx.conf index 0d48dc5..85f883c 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,6 +1,9 @@ # upload max size client_max_body_size 100M; +# add to v1.4 assets +root /opt/mastodon/live/public; + location / { if ($scheme = http) { @@ -13,6 +16,12 @@ location / { include conf.d/yunohost_panel.conf.inc; } +# add to v1.4 assets +location ~ ^/(assets|system/media_attachments/files|system/accounts/avatars) { + add_header Cache-Control "public, max-age=31536000, immutable"; + try_files $uri @proxy; + } + location @proxy { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/scripts/upgrade b/scripts/upgrade index 4038fa7..2a9b0fe 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,7 +40,7 @@ sudo systemctl stop mastodon-*.service # Change owner of live folder sudo chown -R $app: $final_path/live -# upgrade Node.js v4 to v6 +# upgrade Node.js v4 to v6 node_version=$(nodejs --version) if [[ $node_version =~ ^v4.*$ ]]; then pushd /opt @@ -65,6 +65,17 @@ pushd ~/live git checkout $version SWITCHCOMMANDS +# upgrade Node.js v4 to v6 +node_version=$(nodejs --version) +if [[ $node_version =~ ^v4.*$ ]]; then + pushd /opt + curl -sL https://deb.nodesource.com/setup_6.x | sudo bash - + sudo apt-get -y install nodejs +fi + +# add additional package for release 1.4 +ynh_package_install pkg-config libprotobuf-dev protobuf-compiler + # Apply Mastodon upgrade sudo su - $app <