mirror of
https://github.com/YunoHost-Apps/plume_ynh.git
synced 2024-09-03 20:15:54 +02:00
Merge pull request #53 from YunoHost-Apps/0.4.0-alpha-4
Upgrade to 0.4.0-alpha-4
This commit is contained in:
commit
f0b1bfe76f
10 changed files with 57 additions and 114 deletions
|
@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
|
||||||
## Overview
|
## Overview
|
||||||
Federated blogging engine, based on ActivityPub. It uses the Rocket framework, and Diesel to interact with the database.
|
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.**
|
**Warning:** The package can take **15 to 30 minutes** to complete depending on your system configuration. **Don't intrupt the installation process while installing.**
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
setup_private=1
|
setup_private=1
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
upgrade=1 from_commit=4b6b14d8f63874c12507106e08033ec661b25d20
|
upgrade=1 from_commit=279716dff5fc79cc84ae2d7799c8094017ac028e
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=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.
|
# 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.
|
||||||
|
|
48
conf/.env
48
conf/.env
|
@ -1,25 +1,47 @@
|
||||||
# The address of the database
|
# This file contains your instance configuration
|
||||||
# (replace USER, PASSWORD, PORT and DATABASE_NAME with your values)
|
# Some documentation about these variables is available here:
|
||||||
#
|
# https://docs.joinplu.me/environment/
|
||||||
# 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__
|
|
||||||
|
|
||||||
# For PostgreSQL: migrations/postgres
|
## GENERAL SETTINGS ##
|
||||||
|
|
||||||
|
# The directory containing database migrations
|
||||||
|
# For Postgres: migrations/postgres
|
||||||
# For SQlite: migrations/sqlite
|
# For SQlite: migrations/sqlite
|
||||||
MIGRATION_DIRECTORY=migrations/postgres
|
MIGRATION_DIRECTORY=migrations/postgres
|
||||||
|
|
||||||
# The domain on which your instance will be available
|
# The URL of your database (or its path for SQlite databases)
|
||||||
|
DATABASE_URL=postgres://__DB_NAME__:__DB_PWD__@localhost:5432/__DB_NAME__
|
||||||
|
|
||||||
|
# The domain of your instance
|
||||||
BASE_URL=__DOMAIN__
|
BASE_URL=__DOMAIN__
|
||||||
|
|
||||||
ROCKET_PORT=__PORT__
|
# The secret key for private cookies and CSRF protection
|
||||||
ROCKET_ADDRESS=127.0.0.1
|
|
||||||
|
|
||||||
# Secret key used for private cookies and CSRF protection
|
|
||||||
# You can generate one with `openssl rand -base64 32`
|
# You can generate one with `openssl rand -base64 32`
|
||||||
ROCKET_SECRET_KEY=__SECRET_KEY__
|
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_SERVER=localhost
|
||||||
|
MAIL_ADDRESS=no-reply@__DOMAIN__
|
||||||
#MAIL_USER=example
|
#MAIL_USER=example
|
||||||
#MAIL_PASSWORD=123456
|
#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
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
[package]
|
|
||||||
authors = ["Plume contributors"]
|
|
||||||
name = "plume"
|
|
||||||
version = "0.3.0"
|
|
||||||
repository = "https://github.com/Plume-org/Plume"
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
activitypub = "0.1.3"
|
|
||||||
askama_escape = "0.1"
|
|
||||||
atom_syndication = "0.6"
|
|
||||||
canapi = "0.2"
|
|
||||||
colored = "1.7"
|
|
||||||
dotenv = "0.13"
|
|
||||||
gettext = { git = "https://github.com/Plume-org/gettext/", rev = "294c54d74c699fbc66502b480a37cc66c1daa7f3" }
|
|
||||||
gettext-macros = { git = "https://github.com/Plume-org/gettext-macros/", rev = "a7c605f7edd6bfbfbfe7778026bfefd88d82db10" }
|
|
||||||
gettext-utils = { git = "https://github.com/Plume-org/gettext-macros/", rev = "a7c605f7edd6bfbfbfe7778026bfefd88d82db10" }
|
|
||||||
guid-create = "0.1"
|
|
||||||
heck = "0.3.0"
|
|
||||||
lettre = { git = "https://github.com/lettre/lettre", rev = "c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49" }
|
|
||||||
lettre_email = { git = "https://github.com/lettre/lettre", rev = "c988b1760ad8179d9e7f3fb8594d2b86cf2a0a49" }
|
|
||||||
num_cpus = "1.0"
|
|
||||||
rocket = "0.4.0"
|
|
||||||
rocket_contrib = { version = "0.4.0", features = ["json"] }
|
|
||||||
rocket_i18n = { git = "https://github.com/Plume-org/rocket_i18n", rev = "e922afa7c366038b3433278c03b1456b346074f2" }
|
|
||||||
rpassword = "2.0"
|
|
||||||
runtime-fmt = "0.3.0"
|
|
||||||
scheduled-thread-pool = "0.2.0"
|
|
||||||
serde = "1.0"
|
|
||||||
serde_json = "1.0"
|
|
||||||
serde_qs = "0.4"
|
|
||||||
validator = "0.8"
|
|
||||||
validator_derive = "0.8"
|
|
||||||
webfinger = "0.3.1"
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name = "plume"
|
|
||||||
path = "src/main.rs"
|
|
||||||
|
|
||||||
[dependencies.chrono]
|
|
||||||
features = ["serde"]
|
|
||||||
version = "0.4"
|
|
||||||
|
|
||||||
[dependencies.ctrlc]
|
|
||||||
features = ["termination"]
|
|
||||||
version = "3.1.1"
|
|
||||||
|
|
||||||
[dependencies.diesel]
|
|
||||||
features = ["r2d2", "chrono"]
|
|
||||||
version = "*"
|
|
||||||
|
|
||||||
[dependencies.multipart]
|
|
||||||
default-features = false
|
|
||||||
features = ["server"]
|
|
||||||
version = "0.16"
|
|
||||||
|
|
||||||
[dependencies.plume-api]
|
|
||||||
path = "plume-api"
|
|
||||||
|
|
||||||
[dependencies.plume-common]
|
|
||||||
path = "plume-common"
|
|
||||||
|
|
||||||
[dependencies.plume-models]
|
|
||||||
path = "plume-models"
|
|
||||||
|
|
||||||
[dependencies.rocket_csrf]
|
|
||||||
git = "https://github.com/fdb-hiroshima/rocket_csrf"
|
|
||||||
rev = "4a72ea2ec716cb0b26188fb00bccf2ef7d1e031c"
|
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
ructe = "0.5.6"
|
|
||||||
rsass = "0.9"
|
|
||||||
|
|
||||||
[features]
|
|
||||||
default = ["postgres"]
|
|
||||||
postgres = ["plume-models/postgres", "diesel/postgres"]
|
|
||||||
sqlite = ["plume-models/sqlite", "diesel/sqlite"]
|
|
||||||
debug-mailer = []
|
|
||||||
test = []
|
|
||||||
|
|
||||||
[workspace]
|
|
||||||
members = ["plume-api", "plume-cli", "plume-models", "plume-common", "plume-front"]
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://github.com/Plume-org/Plume/releases/download/0.3.0-alpha-2/plume-postgres.tar.gz
|
SOURCE_URL=https://github.com/Plume-org/Plume/releases/download/0.4.0-alpha-4/plume-postgres.tar.gz
|
||||||
SOURCE_SUM=e0c33a38367a5428606ae7bf8524c325edea09fdb4511c80a7aa8f4eb8f30905
|
SOURCE_SUM=10b467eb62c862178a8e00e28890b24871ed6d8e77a631eede44bc7c2a1c3bef
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=false
|
SOURCE_IN_SUBDIR=false
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"en": "Federated blogging application",
|
"en": "Federated blogging application",
|
||||||
"fr": "Une application de blogging fédérée."
|
"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/",
|
"url": "https://baptiste.gelez.xyz/",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"maintainer": [
|
"maintainer": [
|
||||||
|
|
|
@ -38,7 +38,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a 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 plume"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
|
@ -82,7 +82,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd 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
|
# END OF SCRIPT
|
||||||
|
|
|
@ -58,7 +58,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a 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 plume"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
|
@ -114,7 +114,7 @@ ynh_store_file_checksum --file="$final_path/$app/.env"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd 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"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
|
@ -164,16 +164,13 @@ ynh_replace_string --match_string="__SECRET_KEY__" --replace_string="$secret_key
|
||||||
# MAKE SETUP
|
# MAKE SETUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Fix missing Cargo.toml
|
|
||||||
cp "../conf/Cargo.toml" "$final_path/$app/Cargo.toml"
|
|
||||||
|
|
||||||
# Set right permissions
|
# Set right permissions
|
||||||
chown -R "$app":"$app" $final_path
|
chown -R "$app":"$app" $final_path
|
||||||
|
|
||||||
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
|
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
|
||||||
|
|
||||||
pushd $final_path/$app
|
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
|
# Add new instance
|
||||||
if [ $registration -eq 1 ]
|
if [ $registration -eq 1 ]
|
||||||
|
@ -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_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
|
# SETUP SSOWAT
|
||||||
|
|
|
@ -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)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
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)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
|
|
||||||
architecture=$(ynh_detect_arch)
|
architecture=$(ynh_detect_arch)
|
||||||
|
@ -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
|
# Backup the current version of the app
|
||||||
ynh_backup_before_upgrade
|
ynh_backup_before_upgrade
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
|
read -p "key"
|
||||||
# restore it if the upgrade fails
|
# restore it if the upgrade fails
|
||||||
ynh_restore_upgradebackup
|
ynh_restore_upgradebackup
|
||||||
ynh_clean_check_starting
|
ynh_clean_check_starting
|
||||||
|
@ -112,7 +110,7 @@ path_url=$(ynh_normalize_url_path --path_url=$path_url)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a 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 plume"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -124,6 +122,13 @@ then
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source "$final_path/$app" $architecture
|
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
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -170,7 +175,7 @@ chown -R "$app":"$app" $final_path
|
||||||
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
|
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
|
||||||
|
|
||||||
pushd $final_path/$app
|
pushd $final_path/$app
|
||||||
sudo -u "$app" env PATH=$PATH diesel migration run
|
sudo -u "$app" env PATH=$PATH plm migration run
|
||||||
popd
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -225,7 +230,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd 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"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
Loading…
Add table
Reference in a new issue