mirror of
https://github.com/YunoHost-Apps/wallabag2_ynh.git
synced 2024-10-01 13:35:06 +02:00
commit
5c4b874536
11 changed files with 59 additions and 96 deletions
|
@ -7,7 +7,7 @@ This is a Wallabag v2 package for YunoHost.
|
|||
|
||||
**NB: Since @jeromelebleu is no longer maintaining this package, I (@lapineige) take over this repository. But I have limited time and experience, so feel free to help !**
|
||||
|
||||
**Shipped version:** 2.2.3
|
||||
**Shipped version:** 2.3.2
|
||||
|
||||
[Wallabag](https://www.wallabag.org/) is a self hostable Read-It-Later application allowing
|
||||
you to not miss any content anymore. Click, save, read it when you can.
|
||||
|
@ -56,7 +56,7 @@ Paquet Wallabag v2 pour Yunohost.
|
|||
|
||||
**NB: Depuis que @jeromelebleu ne maintiens plus ce paquet, je (@lapineige) reprends la charge de ce dépôt. Mais j'ai un temps et une expérience limitées, donc n'hésitez pas à donner un coup de main :) !**
|
||||
|
||||
**Version actuelle:** 2.2.3
|
||||
**Version actuelle:** 2.3.2
|
||||
|
||||
[Wallabag](https://www.wallabag.org/) est une application de lecture différée : elle permet simplement d’archiver une page web en ne conservant que le contenu. Les éléments superflus (menus, publicités, etc.) sont supprimés.
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
setup_private=0
|
||||
setup_public=0
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=f75d58cb32c51a0981333ea88974dc3199324e65
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
incorrect_path=1
|
||||
|
@ -31,4 +32,8 @@
|
|||
Level 10=0
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=none
|
||||
Notification=none
|
||||
;;; Upgrade options
|
||||
; commit=f75d58cb32c51a0981333ea88974dc3199324e65
|
||||
name= Previous package version
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
SOURCE_URL=https://static.wallabag.org/releases/wallabag-release-2.2.3.tar.gz
|
||||
SOURCE_SUM=13fe5cb7cfc741abee08312f0055e9549e60590daff2fac41be5266f7956d857
|
||||
SOURCE_URL=https://static.wallabag.org/releases/wallabag-release-2.3.2.tar.gz
|
||||
SOURCE_SUM=047a49d48a1199bd1634cab76d4af3dba95096885d4f7814377210fa76fbcc9f
|
||||
SOURCE_FORMAT=tar.gz
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
parameters:
|
||||
database_driver: pdo_mysql
|
||||
database_host: localhost
|
||||
database_port: 3306
|
||||
database_name: {DBNAME}
|
||||
database_user: {DBUSER}
|
||||
database_password: {DBPASS}
|
||||
database_path: null
|
||||
database_table_prefix: null
|
||||
database_socket: null
|
||||
database_charset: utf8mb4
|
||||
|
||||
mailer_transport: smtp
|
||||
mailer_host: localhost
|
||||
mailer_user: null
|
||||
mailer_password: null
|
||||
|
||||
locale: en
|
||||
|
||||
# A secret key that's used to generate certain security-related tokens
|
||||
secret: {DESKEY}
|
||||
|
||||
# two factor stuff
|
||||
twofactor_auth: true
|
||||
twofactor_sender: no-reply@wallabag.org
|
||||
|
||||
# fosuser stuff
|
||||
fosuser_registration: false
|
||||
fosuser_confirmation: true
|
||||
|
||||
from_email: no-reply@wallabag.org
|
||||
|
||||
rss_limit: 50
|
||||
|
||||
# RabbitMQ processing
|
||||
rabbitmq_host: localhost
|
||||
rabbitmq_port: 5672
|
||||
rabbitmq_user: guest
|
||||
rabbitmq_password: guest
|
||||
rabbitmq_prefetch_count: 10
|
||||
|
||||
# Redis processing
|
||||
redis_scheme: tcp
|
||||
redis_host: localhost
|
||||
redis_port: 6379
|
||||
redis_path: null
|
||||
redis_password: null
|
||||
|
||||
# sites credentials
|
||||
sites_credentials: {}
|
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"url": "https://www.wallabag.org",
|
||||
"license": "MIT",
|
||||
"version": "2.2.3",
|
||||
"version": "2.3.2-1",
|
||||
"maintainer": {
|
||||
"name": "lapineige",
|
||||
"email": ""
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
# Package dependencies
|
||||
PKG_DEPENDENCIES="php5-cli php5-mysql php5-json php5-gd php5-tidy php5-curl php-gettext redis-server"
|
||||
PKG_DEPENDENCIES="php5-cli php5-mysql php5-json php5-gd php5-tidy php5-curl php-gettext php5-redis"
|
||||
|
||||
# Execute a command as another user
|
||||
# usage: exec_as USER COMMAND [ARG ...]
|
||||
|
@ -36,12 +36,6 @@ QUIET () { # redirect standard output to /dev/null
|
|||
$@ > /dev/null
|
||||
}
|
||||
|
||||
|
||||
HUMAN_SIZE () { # Transforms a Kb-based size to a human-readable size
|
||||
human=$(numfmt --to=iec --from-unit=1K $1)
|
||||
echo $human
|
||||
}
|
||||
|
||||
CHECK_SIZE () { # Check if enough disk space available on backup storage
|
||||
file_to_analyse=$1
|
||||
backup_size=$(du --summarize "$file_to_analyse" | cut -f1)
|
||||
|
@ -55,15 +49,6 @@ CHECK_SIZE () { # Check if enough disk space available on backup storage
|
|||
fi
|
||||
}
|
||||
|
||||
CHECK_DOMAINPATH () { # Check domain/path availability
|
||||
yunohost app checkurl $domain$path_url -a $app
|
||||
}
|
||||
|
||||
CHECK_FINALPATH () { # Check if destination directory already exists
|
||||
final_path="/var/www/$app"
|
||||
test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||
}
|
||||
|
||||
|
||||
# ============= FUTURE YUNOHOST HELPER =============
|
||||
# Delete a file checksum from the app settings
|
||||
|
|
|
@ -28,6 +28,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
db_name=$(ynh_app_setting_get "$app" db_name)
|
||||
db_pwd=$(ynh_app_setting_get "$app" mysqlpwd)
|
||||
db_user="$db_name"
|
||||
final_path=$(ynh_app_setting_get "$app" final_path)
|
||||
|
||||
#=================================================
|
||||
# CHECK PATHS SYNTAX
|
||||
|
@ -76,7 +77,7 @@ then
|
|||
|
||||
# Move #for-subdir comment at the beginning of the line (line not needed for "/" path)
|
||||
ynh_replace_string "\(.*\) #for-subdir" "#for-subdir \1" "$nginx_conf_path"
|
||||
elif [ "$new_path" != "/" ] && [ "$old_path" = "/" ] ; then
|
||||
elif [ "$new_path" != "/" ] && [ "$old_path" = "/" ] ; then
|
||||
# Move #for-subdir comment at the end of the line (line needed for "/path" path)
|
||||
ynh_replace_string "#for-subdir\(.*\)" "\1 #for-subdir" "$nginx_conf_path"
|
||||
|
||||
|
@ -87,7 +88,7 @@ then
|
|||
ynh_replace_string "rewrite ^ /" "rewrite ^ $new_path/" "$nginx_conf_path"
|
||||
else
|
||||
# Replace locations starting with old_path
|
||||
# Look for every possible patterns for location directive(see https://nginx.org/en/docs/http/ngx_http_core_module.html#location)
|
||||
# Look for every possible patterns for location directive (see https://nginx.org/en/docs/http/ngx_http_core_module.html#location)
|
||||
ynh_replace_string "location\( \(=\|~\|~\*\|\^~\)\)\? \(\^\)\?$old_path" "location\1 \3$new_path" "$nginx_conf_path"
|
||||
# Replace path in "rewrite" directive
|
||||
ynh_replace_string "rewrite ^ $old_path" "rewrite ^ $new_path" "$nginx_conf_path"
|
||||
|
@ -113,6 +114,9 @@ fi
|
|||
# Configure Wallabag instance URL
|
||||
ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_user" <<< "UPDATE craue_config_setting SET value = 'https://$new_domain$new_path' WHERE name = 'wallabag_url'"
|
||||
|
||||
# Change domain name in parameters.yml
|
||||
ynh_replace_string "domain_name: https://$old_domain$old_path" "domain_name: https://$new_domain$new_path" $final_path/app/config/parameters.yml
|
||||
|
||||
# If "Download images locally" option has been enabled in Internal Settings
|
||||
download_images_enabled=$(ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_user" <<< "SELECT value from craue_config_setting WHERE name='download_images_enabled '" | tail -n 1)
|
||||
if [ "$download_images_enabled" = "1" ] ; then
|
||||
|
|
|
@ -31,9 +31,15 @@ admin=$YNH_APP_ARG_ADMIN
|
|||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||
#=================================================
|
||||
|
||||
final_path=/var/www/$app
|
||||
test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||
|
||||
path_url=$(ynh_normalize_url_path $path_url) # Check and normalize path
|
||||
CHECK_DOMAINPATH # Check domain and path availability
|
||||
CHECK_FINALPATH # Check if destination directory is not already in use
|
||||
|
||||
# Check web path availability
|
||||
ynh_webpath_available $domain $path_url
|
||||
# Register (book) web path
|
||||
ynh_webpath_register $app $domain $path_url
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
|
@ -86,11 +92,16 @@ ynh_system_user_create $app # Create a dedicated system user
|
|||
|
||||
# Copy and set Wallabag dist configuration
|
||||
wb_conf="${TMPDIR}/app/config/parameters.yml"
|
||||
cp ../conf/parameters.yml "$wb_conf"
|
||||
ynh_replace_string "{DBNAME}" "${db_name}" "$wb_conf"
|
||||
ynh_replace_string "{DBUSER}" "${db_user}" "$wb_conf"
|
||||
ynh_replace_string "{DBPASS}" "${db_pwd}" "$wb_conf"
|
||||
ynh_replace_string "{DESKEY}" "${deskey}" "$wb_conf"
|
||||
cp ${TMPDIR}/app/config/parameters.yml.dist $wb_conf
|
||||
|
||||
ynh_replace_string "fosuser_registration: true" "fosuser_registration: false" "$wb_conf"
|
||||
ynh_replace_string "database_name: wallabag" "database_name: ${db_name}" "$wb_conf"
|
||||
ynh_replace_string "database_user: root" "database_user: ${db_user}" "$wb_conf"
|
||||
ynh_replace_string "database_password: ~" "database_password: ${db_pwd}" "$wb_conf"
|
||||
ynh_replace_string "database_table_prefix: wallabag_" "database_table_prefix: null" "$wb_conf"
|
||||
ynh_replace_string "secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv" "secret: ${deskey}" "$wb_conf"
|
||||
ynh_replace_string "domain_name: https://your-wallabag-url-instance.com" "domain_name: https://$domain$path_url" "$wb_conf"
|
||||
|
||||
# Restrict rights to Wallabag user only
|
||||
chmod 600 "$wb_conf"
|
||||
|
||||
|
|
|
@ -89,11 +89,15 @@ ynh_system_user_create $app # Create dedicated user if not existing
|
|||
|
||||
# Copy and set Wallabag dist configuration
|
||||
wb_conf="${TMPDIR}/app/config/parameters.yml"
|
||||
cp ../conf/parameters.yml "$wb_conf"
|
||||
ynh_replace_string "{DBNAME}" "${db_name}" "$wb_conf"
|
||||
ynh_replace_string "{DBUSER}" "${db_user}" "$wb_conf"
|
||||
ynh_replace_string "{DBPASS}" "${db_pwd}" "$wb_conf"
|
||||
ynh_replace_string "{DESKEY}" "${deskey}" "$wb_conf"
|
||||
cp ${TMPDIR}/app/config/parameters.yml.dist $wb_conf
|
||||
|
||||
ynh_replace_string "fosuser_registration: true" "fosuser_registration: false" "$wb_conf"
|
||||
ynh_replace_string "database_name: wallabag" "database_name: ${db_name}" "$wb_conf"
|
||||
ynh_replace_string "database_user: root" "database_user: ${db_user}" "$wb_conf"
|
||||
ynh_replace_string "database_password: ~" "database_password: ${db_pwd}" "$wb_conf"
|
||||
ynh_replace_string "database_table_prefix: wallabag_" "database_table_prefix: null" "$wb_conf"
|
||||
ynh_replace_string "secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv" "secret: ${deskey}" "$wb_conf"
|
||||
ynh_replace_string "domain_name: https://your-wallabag-url-instance.com" "domain_name: https://$domain$path_url" "$wb_conf"
|
||||
|
||||
# Replace files and set permissions
|
||||
ynh_secure_remove "${final_path}/var/cache"
|
||||
|
|
|
@ -1,17 +1,20 @@
|
|||
--- a/app/config/services.yml 2016-05-25 18:09:56.374914445 +0200
|
||||
+++ b/app/config/services.yml 2016-05-25 18:07:38.775042951 +0200
|
||||
@@ -36,3 +36,7 @@
|
||||
arguments: ["@session"]
|
||||
@@ -43,6 +43,10 @@
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }
|
||||
+
|
||||
|
||||
+ yunohost.ldap:
|
||||
+ class: Symfony\Component\Ldap\LdapClient
|
||||
+ arguments: ["localhost"]
|
||||
+
|
||||
craue_config_cache_provider:
|
||||
class: Symfony\Component\Cache\Adapter\FilesystemAdapter
|
||||
public: false
|
||||
--- a/app/config/security.yml 2016-05-25 18:09:46.814645164 +0200
|
||||
+++ b/app/config/security.yml 2016-05-25 18:07:38.775042951 +0200
|
||||
@@ -11,6 +11,14 @@
|
||||
entity: { class: WallabagUserBundle:User, property: username }
|
||||
@@ -13,6 +13,14 @@
|
||||
property: username
|
||||
fos_userbundle:
|
||||
id: fos_user.user_provider.username
|
||||
+ yunohost_users:
|
||||
|
@ -22,11 +25,11 @@
|
|||
+ search_password:
|
||||
+ filter: (&(uid={username})(objectClass=posixAccount))
|
||||
+ default_roles: ROLE_USER
|
||||
|
||||
|
||||
# the main part of the security, where you can set up firewalls
|
||||
# for specific sections of your app
|
||||
@@ -36,6 +44,9 @@
|
||||
|
||||
@@ -38,6 +46,9 @@
|
||||
|
||||
secured_area:
|
||||
pattern: ^/
|
||||
+ http_basic_ldap:
|
||||
|
|
|
@ -15,12 +15,13 @@ diff --git a/app/config/services.yml b/app/config/services.yml
|
|||
index 8a09fde..ee63e06 100644
|
||||
--- a/app/config/services.yml
|
||||
+++ b/app/config/services.yml
|
||||
@@ -37,6 +37,9 @@ services:
|
||||
@@ -43,6 +43,10 @@
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }
|
||||
|
||||
|
||||
+ yunohost.logout_success_handler:
|
||||
+ class: Wallabag\YunoHostBundle\Security\LogoutSuccessHandler
|
||||
+
|
||||
+
|
||||
yunohost.ldap:
|
||||
class: Symfony\Component\Ldap\LdapClient
|
||||
|
|
Loading…
Add table
Reference in a new issue