1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/writefreely_ynh.git synced 2024-09-03 20:36:02 +02:00

Merge pull request #100 from YunoHost-Apps/testing

Apply last example_ynh
This commit is contained in:
yalh76 2022-01-19 19:53:32 +01:00 committed by GitHub
commit 728daca58e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 55 additions and 91 deletions

View file

@ -15,9 +15,13 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview
For starting a minimalist, federated blog or an entire community.
WriteFreely is a beautifully pared-down blogging platform that's simple on the surface, yet powerful underneath.
**Shipped version:** 0.13.1~ynh1
Can be run as Single User Blog or Multi User Instance.
Each User can be limited from 1 to unlimited blogs.
**Shipped version:** 0.13.1~ynh2
**Demo:** https://write.as/new
@ -28,12 +32,10 @@ For starting a minimalist, federated blog or an entire community.
## Disclaimers / important information
* Any known limitations, constrains or stuff not working, such as (but not limited to):
* **WriteFreely** require a dedicated **root domain**, eg. writefreely.domain.tld
* i386 architectures not supported
* No LDAP and no HTTP auth supported
* Other infos that people should be aware of, such as:
* If User Mode is configured Multiple users, the app be used by multiple users
* Additionals parameters can be configured in Settings / Admin settings.

View file

@ -11,9 +11,13 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
## Vue d'ensemble
Permet de créer un blog fédéré minimaliste ou une communauté entière.
WriteFreely is a beautifully pared-down blogging platform that's simple on the surface, yet powerful underneath.
**Version incluse :** 0.13.1~ynh1
Can be run as Single User Blog or Multi User Instance.
Each User can be limited from 1 to unlimited blogs.
**Version incluse :** 0.13.1~ynh2
**Démo :** https://write.as/new
@ -24,12 +28,10 @@ Permet de créer un blog fédéré minimaliste ou une communauté entière.
## Avertissements / informations importantes
* Any known limitations, constrains or stuff not working, such as (but not limited to):
* **WriteFreely** require a dedicated **root domain**, eg. writefreely.domain.tld
* i386 architectures not supported
* No LDAP and no HTTP auth supported
* Other infos that people should be aware of, such as:
* If User Mode is configured Multiple users, the app be used by multiple users
* Additionals parameters can be configured in Settings / Admin settings.

View file

@ -1,8 +1,8 @@
;; Test complet
; Manifest
domain="domain.tld" (DOMAIN)
admin="john" (USER)
is_public=1 (PUBLIC|public=1|private=0)
domain="domain.tld"
admin="john"
is_public=1
password="pass"
single_user=1
; Checks
@ -27,6 +27,8 @@
upgrade=1 from_commit=b387e4186a02c387d734cf25f4fed9283c01d55f
# 0.13.0~ynh1
upgrade=1 from_commit=06afb5c5a1896185eec6e63ffcb929f0216db2ec
# 0.13.1~ynh1
upgrade=1 from_commit=e30ec378dc703227fcfe542d19f35e2838192094
backup_restore=1
multi_instance=1
port_already_use=0
@ -49,3 +51,5 @@ Notification=all
name=0.12.0~ynh6
; commit=06afb5c5a1896185eec6e63ffcb929f0216db2ec
name=0.13.0~ynh1
; commit=e30ec378dc703227fcfe542d19f35e2838192094
name=0.13.1~ynh1

View file

@ -1,5 +1,3 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location ~ ^/.well-known/(webfinger|nodeinfo|host-meta) {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;

5
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1,5 @@
WriteFreely is a beautifully pared-down blogging platform that's simple on the surface, yet powerful underneath.
Can be run as Single User Blog or Multi User Instance.
Each User can be limited from 1 to unlimited blogs.

View file

@ -1,8 +1,6 @@
* Any known limitations, constrains or stuff not working, such as (but not limited to):
* **WriteFreely** require a dedicated **root domain**, eg. writefreely.domain.tld
* i386 architectures not supported
* No LDAP and no HTTP auth supported
* Other infos that people should be aware of, such as:
* If User Mode is configured Multiple users, the app be used by multiple users
* Additionals parameters can be configured in Settings / Admin settings.

View file

@ -6,7 +6,7 @@
"en": "For starting a minimalist, federated blog or an entire community.",
"fr": "Permet de créer un blog fédéré minimaliste ou une communauté entière."
},
"version": "0.13.1~ynh1",
"version": "0.13.1~ynh2",
"url": "https://writefreely.org",
"upstream": {
"license": "AGPL-3.0-or-later",
@ -20,7 +20,7 @@
"name": "yalh76"
},
"requirements": {
"yunohost": ">= 4.1.3"
"yunohost": ">= 4.3.0"
},
"multi_instance": true,
"services": [
@ -31,13 +31,11 @@
"install": [
{
"name": "domain",
"type": "domain",
"example": "example.com"
"type": "domain"
},
{
"name": "admin",
"type": "user",
"example": "johndoe"
"type": "user"
},
{
"name": "is_public",
@ -46,8 +44,7 @@
},
{
"name": "password",
"type": "password",
"example": "Choose a password"
"type": "password"
},
{
"name": "single_user",

View file

@ -115,11 +115,6 @@ ynh_script_progression --message="Modifying a config file..."
ynh_backup_if_checksum_is_different --file="$final_path/config.ini"
ynh_replace_string --match_string="host =.*" --replace_string="host = https://$new_domain" --target_file="$final_path/config.ini"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
ynh_script_progression --message="Storingthe config file checksum..."
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$final_path/config.ini"

View file

@ -7,7 +7,6 @@
#=================================================
source _common.sh
source ynh_detect_arch__2
source /usr/share/yunohost/helpers
#=================================================
@ -32,7 +31,7 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
password=$YNH_APP_ARG_PASSWORD
single_user=$YNH_APP_ARG_SINGLE_USER
architecture=$(ynh_detect_arch)
architecture=$YNH_ARCH
# Bypass package_checker name not compatible with writefreely
if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
@ -123,7 +122,7 @@ ynh_add_nginx_config
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a config file..."
ynh_script_progression --message="Adding a configuration file..."
ynh_add_config --template="../conf/config.ini" --destination="$final_path/config.ini"
@ -144,9 +143,9 @@ ynh_add_systemd_config
ynh_script_progression --message="Making setup..."
pushd $final_path
sudo -u $app ./writefreely --init-db
sudo -u $app ./writefreely --gen-keys
sudo -u $app ./writefreely --create-admin "$admin":"$password"
ynh_exec_as $app ./writefreely --init-db
ynh_exec_as $app ./writefreely --gen-keys
ynh_exec_as $app ./writefreely --create-admin "$admin":"$password"
popd
#=================================================

View file

@ -67,14 +67,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..."
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..."
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# CLOSE A PORT
#=================================================

View file

@ -38,8 +38,6 @@ db_user=$db_name
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "

View file

@ -7,7 +7,6 @@
#=================================================
source _common.sh
source ynh_detect_arch__2
source /usr/share/yunohost/helpers
#=================================================
@ -27,7 +26,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
port=$(ynh_app_setting_get --app=$app --key=port)
single_user=$(ynh_app_setting_get --app=$app --key=single_user)
architecture=$(ynh_detect_arch)
architecture=$YNH_ARCH
#=================================================
# CHECK VERSION
@ -136,15 +135,15 @@ ynh_script_progression --message="Making the upgrade..."
pushd $final_path
ynh_mysql_execute_as_root --sql="ALTER DATABASE $db_name CHARACTER SET latin1 COLLATE latin1_swedish_ci;" --database=$db_name
sudo -u $app ./writefreely db migrate
sudo -u $app ./writefreely --migrate
sudo -u $app ./writefreely keys generate
ynh_exec_as $app ./writefreely db migrate
ynh_exec_as $app ./writefreely --migrate
ynh_exec_as $app ./writefreely keys generate
popd
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a config file..."
ynh_script_progression --message="Updating a configuration file..."
ynh_add_config --template="../conf/config.ini" --destination="$final_path/config.ini"

View file

@ -1,25 +0,0 @@
#!/bin/bash
# Check the architecture
#
# example: architecture=$(ynh_detect_arch)
#
# usage: ynh_detect_arch
#
# Requires YunoHost version 2.2.4 or higher.
ynh_detect_arch(){
local architecture
if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
architecture="arm64"
elif [ -n "$(uname -m | grep 64)" ]; then
architecture="x86-64"
elif [ -n "$(uname -m | grep 86)" ]; then
architecture="i386"
elif [ -n "$(uname -m | grep arm)" ]; then
architecture="arm"
else
architecture="unknown"
fi
echo $architecture
}