Skip to content

Commit

Permalink
Merge pull request #53 from YunoHost-Apps/0.4.0-alpha-4
Browse files Browse the repository at this point in the history
Upgrade to 0.4.0-alpha-4
  • Loading branch information
yalh76 authored Dec 29, 2019
2 parents 8fc3524 + 7580d8a commit f0b1bfe
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 114 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
## Overview
Federated blogging engine, based on ActivityPub. It uses the Rocket framework, and Diesel to interact with the database.

**Shipped version:** 0.3.0-alpha-2
**Shipped version:** 0.4.0-alpha-4

**Warning:** The package can take **15 to 30 minutes** to complete depending on your system configuration. **Don't intrupt the installation process while installing.**

Expand Down
2 changes: 1 addition & 1 deletion check_process
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
setup_private=1
setup_public=1
upgrade=1
upgrade=1 from_commit=4b6b14d8f63874c12507106e08033ec661b25d20
upgrade=1 from_commit=279716dff5fc79cc84ae2d7799c8094017ac028e
backup_restore=1
multi_instance=1
# 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.
Expand Down
48 changes: 35 additions & 13 deletions conf/.env
Original file line number Diff line number Diff line change
@@ -1,25 +1,47 @@
# The address of the database
# (replace USER, PASSWORD, PORT and DATABASE_NAME with your values)
#
# If you are using SQlite, use the path of the database file (`plume.db` for instance)
DATABASE_URL=postgres://__DB_NAME__:__DB_PWD__@localhost:5432/__DB_NAME__
# This file contains your instance configuration
# Some documentation about these variables is available here:
# https://docs.joinplu.me/environment/

## GENERAL SETTINGS ##

# For PostgreSQL: migrations/postgres
# The directory containing database migrations
# For Postgres: migrations/postgres
# For SQlite: migrations/sqlite
MIGRATION_DIRECTORY=migrations/postgres

# The domain on which your instance will be available
BASE_URL=__DOMAIN__
# The URL of your database (or its path for SQlite databases)
DATABASE_URL=postgres://__DB_NAME__:__DB_PWD__@localhost:5432/__DB_NAME__

ROCKET_PORT=__PORT__
ROCKET_ADDRESS=127.0.0.1
# The domain of your instance
BASE_URL=__DOMAIN__

# Secret key used for private cookies and CSRF protection
# The secret key for private cookies and CSRF protection
# You can generate one with `openssl rand -base64 32`
ROCKET_SECRET_KEY=__SECRET_KEY__

# Mail settings
# Port and address which Plume will use
ROCKET_PORT=__PORT__
ROCKET_ADDRESS=127.0.0.1

## MAIL CONFIG ##
MAIL_SERVER=localhost
MAIL_ADDRESS=no-reply@__DOMAIN__
#MAIL_USER=example
#MAIL_PASSWORD=123456
MAIL_HELO_NAME=__DOMAIN__
MAIL_HELO_NAME=no-reply@__DOMAIN__

## ADVANCED OPTIONS ##
#MEDIA_UPLOAD_DIRECTORY=static/media
#SEARCH_INDEX=search_index

# Sample logo configuration
#PLUME_LOGO=icons/trwnh/paragraphs/plumeParagraphs.svg
#PLUME_LOGO_FAVICON=icons/trwnh/paragraphs/plumeParagraphs32.png
#PLUME_LOGO_48=icons/trwnh/paragraphs/plumeParagraphs48.png
#PLUME_LOGO_72=icons/trwnh/paragraphs/plumeParagraphs72.png
#PLUME_LOGO_96=icons/trwnh/paragraphs/plumeParagraphs96.png
#PLUME_LOGO_144=icons/trwnh/paragraphs/plumeParagraphs144.png
#PLUME_LOGO_160=icons/trwnh/paragraphs/plumeParagraphs160.png
#PLUME_LOGO_192=icons/trwnh/paragraphs/plumeParagraphs192.png
#PLUME_LOGO_256=icons/trwnh/paragraphs/plumeParagraphs256.png
#PLUME_LOGO_512=icons/trwnh/paragraphs/plumeParagraphs512.png
81 changes: 0 additions & 81 deletions conf/Cargo.toml

This file was deleted.

4 changes: 2 additions & 2 deletions conf/x86-64.src
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/Plume-org/Plume/releases/download/0.3.0-alpha-2/plume-postgres.tar.gz
SOURCE_SUM=e0c33a38367a5428606ae7bf8524c325edea09fdb4511c80a7aa8f4eb8f30905
SOURCE_URL=https://github.com/Plume-org/Plume/releases/download/0.4.0-alpha-4/plume-postgres.tar.gz
SOURCE_SUM=10b467eb62c862178a8e00e28890b24871ed6d8e77a631eede44bc7c2a1c3bef
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=false
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"en": "Federated blogging application",
"fr": "Une application de blogging fédérée."
},
"version": "0.3.0-alpha-2~ynh1",
"version": "0.4.0-alpha-4~ynh1",
"url": "https://baptiste.gelez.xyz/",
"license": "AGPL-3.0-only",
"maintainer": [
Expand Down
4 changes: 2 additions & 2 deletions scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#=================================================
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 plume"

#=================================================
# BACKUP THE APP MAIN DIR
Expand Down Expand Up @@ -82,7 +82,7 @@ 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 plume"

#=================================================
# END OF SCRIPT
Expand Down
4 changes: 2 additions & 2 deletions scripts/change_url
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fi
#=================================================
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 plume"

#=================================================
# MODIFY URL IN NGINX CONF
Expand Down Expand Up @@ -114,7 +114,7 @@ ynh_store_file_checksum --file="$final_path/$app/.env"
#=================================================
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 plume"

#=================================================
# RELOAD NGINX
Expand Down
7 changes: 2 additions & 5 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,13 @@ ynh_replace_string --match_string="__SECRET_KEY__" --replace_string="$secret_key
# MAKE SETUP
#=================================================

# Fix missing Cargo.toml
cp "../conf/Cargo.toml" "$final_path/$app/Cargo.toml"

# Set right permissions
chown -R "$app":"$app" $final_path

export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"

pushd $final_path/$app
sudo -u "$app" env PATH=$PATH diesel migration run
sudo -u "$app" env PATH=$PATH plm migration run

# Add new instance
if [ $registration -eq 1 ]
Expand Down Expand Up @@ -233,7 +230,7 @@ yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$a
#=================================================
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 plume"

#=================================================
# SETUP SSOWAT
Expand Down
17 changes: 11 additions & 6 deletions scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)

db_name=$(ynh_app_setting_get --app=$app --key=db_name)
admin_email=$(ynh_app_setting_get --app=$app --key=admin_email)
secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
name=$(ynh_app_setting_get --app=$app --key=name)
port=$(ynh_app_setting_get --app=$app --key=port)

architecture=$(ynh_detect_arch)
Expand Down Expand Up @@ -91,6 +88,7 @@ ynh_print_info --message="Backing up the app before upgrading (may take a while)
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
read -p "key"
# restore it if the upgrade fails
ynh_restore_upgradebackup
ynh_clean_check_starting
Expand All @@ -112,7 +110,7 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url)
#=================================================
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 plume"

#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
Expand All @@ -124,6 +122,13 @@ then

# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path/$app" $architecture

# Move binaries
mv $final_path/$app/bin/* $final_path/.cargo/bin/
chmod +x $final_path/.cargo/bin/*

# Remove empty bin directory
ynh_secure_remove --file="$final_path/$app/bin/"
fi

#=================================================
Expand Down Expand Up @@ -170,7 +175,7 @@ chown -R "$app":"$app" $final_path
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"

pushd $final_path/$app
sudo -u "$app" env PATH=$PATH diesel migration run
sudo -u "$app" env PATH=$PATH plm migration run
popd

#=================================================
Expand Down Expand Up @@ -225,7 +230,7 @@ fi
#=================================================
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 plume"

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

0 comments on commit f0b1bfe

Please sign in to comment.