Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to 1.1.7 #95

Merged
merged 27 commits into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post
- Tootdon (Android + iOS)
- Tootle (iOS)

**Shipped version:** 0.9.99999
**Shipped version:** 1.1.7

## Important points to read before installing

Expand Down Expand Up @@ -85,7 +85,6 @@ The app can be used by multiple users.

* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/pleroma%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/pleroma/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/pleroma%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/pleroma/)
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/pleroma%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/pleroma/)

## Limitations

Expand All @@ -103,7 +102,6 @@ The app can be used by multiple users.
Developers info
----------------

**Only if you want to use a testing branch for coding, instead of merging directly into master.**
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/pleroma_ynh/tree/testing).

To try the testing branch, please proceed like that.
Expand Down
6 changes: 3 additions & 3 deletions check_process
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
admin="john" (USER)
is_public=1 (PUBLIC|public=1|private=0)
password="pass"
name="My Pleroma"
name="My_Pleroma"
registration=0 (BOOLEAN)
cache=1 (BOOLEAN)
size="5g"
Expand All @@ -21,9 +21,9 @@
setup_private=1
setup_public=1
upgrade=1
upgrade=1 from_commit=14d3be2f782048e64696cef85f4fb7dff1ab6181
upgrade=1 from_commit=edf199768f57000f4df6e2c704483e1036a78203
backup_restore=1
multi_instance=1
multi_instance=0
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
# incorrect_path=1
port_already_use=0
Expand Down
6 changes: 0 additions & 6 deletions conf/app.src

This file was deleted.

6 changes: 6 additions & 0 deletions conf/arm.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/84826/artifacts/download
SOURCE_SUM=aeb527340dbecc5056cd3aca459ed0a0f3b41808afc492e61f998032e5c3d874
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=pleroma-v1.1.7-arm.zip
6 changes: 6 additions & 0 deletions conf/arm64.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/84828/artifacts/download
SOURCE_SUM=74032e08b6f89321eb5545ff77fb0b1f142cba49c691d69316963d296d16b727
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=pleroma-v1.1.7-arm64.zip
73 changes: 0 additions & 73 deletions conf/generated_config.exs

This file was deleted.

16 changes: 6 additions & 10 deletions conf/systemd.service
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
[Unit]
Description=__APP__ social network
After=network.target postgresql.service
Description=__APP__ social network
After=network.target postgresql.service nginx.service

[Service]
ExecReload=/bin/kill $MAINPID
KillMode=process
Restart=on-failure

; Name of the user that runs the Pleroma service.
User=__APP__
Group=__APP__
; Declares that Pleroma runs in production mode.
Environment="MIX_ENV=prod"

; Make sure that all paths fit your installation.
; Path to the home directory of the user running the Pleroma service.
Environment="HOME=__FINALPATH__"
Environment="HOME=__FINALPATH__/__APP__"
; Path to the folder containing the Pleroma installation.
WorkingDirectory=__FINALPATH__/__APP__
; Path to the Mix binary.
ExecStart=/usr/bin/mix phx.server
StandardOutput=syslog
StandardError=syslog
; Path to the Pleroma binary.
ExecStart=__FINALPATH__/__APP__/bin/pleroma start
ExecStop=__FINALPATH__/__APP__/bin/pleroma stop

; Some security directives.
; Use private /tmp and /var/tmp folders inside a new file system namespace, which are discarded after the process stops.
Expand Down
6 changes: 6 additions & 0 deletions conf/x86-64.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/84824/artifacts/download
SOURCE_SUM=6cd69e80894af966bb88505dae572e197c96da02ba980357a606bcc948a78e36
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=pleroma-v1.1.7-x86-64.zip
8 changes: 4 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"en": "Pleroma is an OStatus-compatible social networking server written in Elixir, compatible with GNU Social and Mastodon",
"fr": "Pleroma est un réseau social écrit en Elixir, compatible avec OStatus, GNU Social et Mastodon"
},
"version": "0.9.99999~ynh1",
"version": "1.1.7~ynh1",
"url": "https://git.pleroma.social/pleroma/pleroma",
"license": "AGPL-3.0-only",
"maintainer": [
Expand All @@ -20,7 +20,7 @@
"requirements": {
"yunohost": ">= 3.5"
},
"multi_instance": true,
"multi_instance": false,
"services": [
"nginx"
],
Expand Down Expand Up @@ -69,8 +69,8 @@
"en": "Choose a name for your Pleroma instance",
"fr": "Choisissez un nom pour votre instance Pleroma"
},
"example": "My Pleroma",
"default": "My Pleroma"
"example": "My_Pleroma",
"default": "My_Pleroma"
},
{
"name": "registration",
Expand Down
3 changes: 1 addition & 2 deletions scripts/_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#=================================================

# dependencies used by the app
pkg_dependencies="git build-essential postgresql postgresql-contrib openssl ssh sudo"
extra_pkg_dependencies="elixir erlang-dev erlang-tools erlang-parsetools erlang-eldap erlang-xmerl"
pkg_dependencies="curl unzip libncurses5 postgresql postgresql-contrib"

#=================================================
# PERSONAL HELPERS
Expand Down
16 changes: 11 additions & 5 deletions scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
# IMPORT GENERIC HELPERS
#=================================================

#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers

#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_print_info --message="Managing script failure..."

ynh_clean_setup () {
ynh_clean_check_starting
Expand All @@ -29,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)

cache=$(ynh_app_setting_get --app=$app --key=cache)

#=================================================
Expand All @@ -38,7 +41,7 @@ cache=$(ynh_app_setting_get --app=$app --key=cache)
#=================================================
ynh_print_info --message="Stopping a systemd service..."

ynh_systemd_action --service_name=$app --action="stop"
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped $app"

#=================================================
# BACKUP THE APP MAIN DIR
Expand Down Expand Up @@ -69,11 +72,11 @@ ynh_psql_dump_db --database="$db_name" > db.sql
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP LOGROTATE
# BACKUP CONFIG FILE
#=================================================
ynh_print_info --message="Backing up logrotate configuration..."
ynh_print_info --message="Backing up configuration file..."

ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/etc/$app/config.exs"

#=================================================
# BACKUP SYSTEMD
Expand All @@ -87,7 +90,10 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
ynh_print_info --message="Starting a systemd service..."

ynh_systemd_action --service_name=$app --action="start"
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Started $app"
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
sleep 60
fi

#=================================================
# END OF SCRIPT
Expand Down
26 changes: 23 additions & 3 deletions scripts/change_url
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#db_user=$db_name
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)

#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_print_info --message="Backing up the app before changing its url (may take a while)..."

# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"

# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors

#=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED
#=================================================
Expand All @@ -53,11 +70,11 @@ fi
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SERVICE
# STOP SYSTEMD SERVICE
#=================================================
ynh_print_info --message="Stopping a systemd service..."

ynh_systemd_action --service_name=$app --action="stop"
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped $app"

#=================================================
# MODIFY URL IN NGINX CONF
Expand Down Expand Up @@ -111,7 +128,10 @@ ynh_store_file_checksum --file="$final_path/$app/config/prod.secret.exs"
#=================================================
ynh_print_info --message="Starting a systemd service..."

ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Running Pleroma.Web.Endpoint"
ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Started $app"
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
sleep 60
fi

#=================================================
# RELOAD NGINX
Expand Down
Loading