mirror of
https://github.com/YunoHost-Apps/ghost_ynh.git
synced 2024-09-03 19:16:02 +02:00
Merge pull request #37 from YunoHost-Apps/testing
Updated to version 3.41.8
This commit is contained in:
commit
3168cfbbec
8 changed files with 94 additions and 25 deletions
13
README.md
13
README.md
|
@ -1,15 +1,16 @@
|
|||
# Ghost for YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/ghost)  
|
||||
[](https://dash.yunohost.org/appci/app/ghost)  
|
||||
|
||||
[](https://install-app.yunohost.org/?app=ghost)
|
||||
|
||||
> *This package allows you to install Ghost quickly and simply on a YunoHost server.
|
||||
> *This package allows you to install Ghost quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
|
||||
|
||||
## Overview
|
||||
Ghost is a fully open source, adaptable platform for building and running a modern online publication.
|
||||
|
||||
**Shipped version:** 3.40.5
|
||||
**Shipped version:** 3.41.8
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
@ -17,17 +18,17 @@ Ghost is a fully open source, adaptable platform for building and running a mode
|
|||
|
||||
## Installation
|
||||
|
||||
### Guidelines
|
||||
### Guidelines
|
||||
|
||||
1. No LDAP support.
|
||||
1. You need more then **1GB** of ram. If you don't have it, please create a **swap memory**.
|
||||
|
||||
|
||||
$ dd if=/dev/zero of=/swapfile bs=1024 count=1048576
|
||||
$ mkswap /swapfile
|
||||
$ swapon /swapfile
|
||||
$ echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
|
||||
1. This app is multi-instance (you can have more then one Ghost blogging websites on a single YunoHost server)
|
||||
|
||||
|
||||
### Installing the Ghost app
|
||||
|
||||
1. **App can be installed by YunoHost admin interface or by the following command:**
|
||||
|
|
6
conf/admin.src
Normal file
6
conf/admin.src
Normal file
|
@ -0,0 +1,6 @@
|
|||
SOURCE_URL=https://github.com/TryGhost/Admin/archive/3.41.8.zip
|
||||
SOURCE_SUM=252080e8b4fdc558300b2d33701735a3e2a6d7d82ef66a5eeb9b651a488c67e0
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=false
|
||||
SOURCE_FILENAME=
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/TryGhost/Ghost/releases/download/3.40.5/Ghost-3.40.5.zip
|
||||
SOURCE_SUM=fef81257937b9125dac1618d4a8433a651aa6d32dcfc69da78a4610d7fcbc8ad
|
||||
SOURCE_URL=https://github.com/TryGhost/Ghost/releases/download/3.41.8/Ghost-3.41.8.zip
|
||||
SOURCE_SUM=e650e3d55155c5974a8c3e58bf996c523be51b3a38f9728517b14d9114e0106a
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=false
|
||||
|
|
|
@ -26,4 +26,4 @@
|
|||
},
|
||||
"transports": ["file", "stdout"]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Just a blogging platform",
|
||||
"fr": "Plateforme de blogging"
|
||||
},
|
||||
"version": "3.40.5~ynh1",
|
||||
"version": "3.41.8~ynh1",
|
||||
"url": "https://ghost.org/",
|
||||
"license": "MIT",
|
||||
"maintainer": {
|
||||
|
|
|
@ -20,3 +20,56 @@ NODEJS_VERSION=14
|
|||
#=================================================
|
||||
# FUTURE OFFICIAL HELPERS
|
||||
#=================================================
|
||||
|
||||
# Send an email to inform the administrator
|
||||
#
|
||||
# usage: ynh_send_readme_to_admin app_message [recipients]
|
||||
# | arg: app_message - The message to send to the administrator.
|
||||
# | arg: recipients - The recipients of this email. Use spaces to separate multiples recipients. - default: root
|
||||
# example: "root admin@domain"
|
||||
# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you
|
||||
# example: "root admin@domain user1 user2"
|
||||
ynh_send_readme_to_admin() {
|
||||
local app_message="${1:-...No specific information...}"
|
||||
local recipients="${2:-root}"
|
||||
|
||||
# Retrieve the email of users
|
||||
find_mails () {
|
||||
local list_mails="$1"
|
||||
local mail
|
||||
local recipients=" "
|
||||
# Read each mail in argument
|
||||
for mail in $list_mails
|
||||
do
|
||||
# Keep root or a real email address as it is
|
||||
if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@"
|
||||
then
|
||||
recipients="$recipients $mail"
|
||||
else
|
||||
# But replace an user name without a domain after by its email
|
||||
if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null)
|
||||
then
|
||||
recipients="$recipients $mail"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "$recipients"
|
||||
}
|
||||
recipients=$(find_mails "$recipients")
|
||||
|
||||
local mail_subject="☁️🆈🅽🅷☁️: \`$app\` has important message for you"
|
||||
|
||||
local mail_message="This is an automated message from your beloved YunoHost server. Specific information for $app.
|
||||
$app_message"
|
||||
|
||||
# Define binary to use for mail command
|
||||
if [ -e /usr/bin/bsd-mailx ]
|
||||
then
|
||||
local mail_bin=/usr/bin/bsd-mailx
|
||||
else
|
||||
local mail_bin=/usr/bin/mail.mailutils
|
||||
fi
|
||||
|
||||
# Send the email to the recipients
|
||||
echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients"
|
||||
}
|
|
@ -34,7 +34,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
#=================================================
|
||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating installation parameters..."
|
||||
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
||||
|
||||
final_path=/var/www/$app
|
||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||
|
@ -45,7 +45,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
|||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Storing installation settings..."
|
||||
ynh_script_progression --message="Storing installation settings..." --weight=1
|
||||
|
||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||
|
@ -56,7 +56,7 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public
|
|||
#=================================================
|
||||
# FIND AND OPEN A PORT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Finding an available port..."
|
||||
ynh_script_progression --message="Finding an available port..." --weight=1
|
||||
|
||||
# Find an available port
|
||||
port=$(ynh_find_port --port=4010)
|
||||
|
@ -65,12 +65,12 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
|||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..."
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=1
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
# Install Nodejs
|
||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
||||
ynh_install_nodejs --nodejs_version=$NODEJS_VERSION
|
||||
|
||||
# Install Yarn
|
||||
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
|
||||
|
@ -94,6 +94,9 @@ ynh_script_progression --message="Setting up source files..."
|
|||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
# Download, check integrity, uncompress and patch the source from admin.src
|
||||
mkdir -p $final_path/core/client/Admin
|
||||
ynh_setup_source --dest_dir="$final_path/core/client/Admin" --source_id="admin"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
|
@ -128,10 +131,10 @@ ynh_script_progression --message="Building $app... (this will take some time and
|
|||
pushd "$final_path" || ynh_die
|
||||
|
||||
ynh_use_nodejs
|
||||
yarn install
|
||||
yarn install --non-interactive --silent
|
||||
yarn global add knex-migrator
|
||||
NODE_ENV=production knex-migrator init
|
||||
yarn global add grunt
|
||||
yarn global add grunt-cli ember-cli
|
||||
NODE_ENV=production grunt symlink
|
||||
NODE_ENV=production grunt init --force
|
||||
|
||||
|
@ -180,6 +183,8 @@ then
|
|||
ynh_permission_update --permission="main" --add="visitors"
|
||||
fi
|
||||
|
||||
ynh_permission_create --permission="admin" --url="/ghost" --allowed="visitors" --auth_header="false" --protected="true"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
|
|
@ -87,9 +87,9 @@ then
|
|||
|
||||
# Create a temporary directory
|
||||
tmpdir="$(mktemp -d)"
|
||||
|
||||
# Copy the admin saved settings from tmp directory to final path
|
||||
cp -ar "$final_path/config.production.json" "$tmpdir/config.production.json"
|
||||
|
||||
# Copy the admin saved settings from tmp directory to final path
|
||||
cp -ar "$final_path/config.production.json" "$tmpdir/config.production.json"
|
||||
|
||||
# Backup the content folder to the temp dir
|
||||
cp -ar "$final_path/content" "$tmpdir/content"
|
||||
|
@ -99,9 +99,13 @@ then
|
|||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir=$final_path
|
||||
|
||||
# Copy the admin saved settings from tmp directory to final path
|
||||
cp -ar "$tmpdir/config.production.json" "$final_path/config.production.json"
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from admin.src
|
||||
mkdir -p $final_path/core/client/Admin
|
||||
ynh_setup_source --dest_dir="$final_path/core/client/Admin" --source_id="admin"
|
||||
|
||||
# Copy the admin saved settings from tmp directory to final path
|
||||
cp -ar "$tmpdir/config.production.json" "$final_path/config.production.json"
|
||||
|
||||
# Copy content folder back to the final_path
|
||||
cp -ar "$tmpdir/content" "${final_path}"
|
||||
|
@ -156,13 +160,13 @@ then
|
|||
ynh_script_progression --message="Building $app... (this will take some time and resources!)"
|
||||
|
||||
pushd "$final_path" || ynh_die
|
||||
yarn install
|
||||
yarn install
|
||||
yarn global add knex-migrator
|
||||
NODE_ENV=production knex-migrator init
|
||||
yarn global add grunt
|
||||
NODE_ENV=production grunt symlink
|
||||
NODE_ENV=production grunt init --force
|
||||
|
||||
|
||||
popd || ynh_die
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue