Skip to content

Commit

Permalink
wallabag: update wallabag to 2.3.8 and various fixes (#4179)
Browse files Browse the repository at this point in the history
Fixes #3113
Satisfy new password requirements with validation
Fix "invalid" domain_name
Fix wizard and domain_name
  • Loading branch information
publicarray authored Sep 22, 2020
1 parent a0e3d3b commit 272d8b6
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 89 deletions.
15 changes: 9 additions & 6 deletions cross/wallabag/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PKG_NAME = wallabag
PKG_VERS = 2.2.3
PKG_VERS = 2.3.8
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-release-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://static.wallabag.org/releases
PKG_DIR = release-$(PKG_VERS)
PKG_DIR = $(PKG_VERS)

DEPENDS =

Expand All @@ -14,11 +14,14 @@ LICENSE = MIT

CONFIGURE_TARGET = nop
COMPILE_TARGET = nop
INSTALL_TARGET = myInstall
INSTALL_TARGET = wallabag_install

include ../../mk/spksrc.cross-cc.mk

.PHONY: myInstall
myInstall:
mkdir -p $(STAGING_INSTALL_PREFIX)/share/wallabag
# Pure PHP package, make sure ARCH is not defined
override ARCH=

.PHONY: wallabag_install
wallabag_install:
install -m 755 -d $(STAGING_INSTALL_PREFIX)/share/wallabag
tar -cf - -C $(WORK_DIR)/$(PKG_DIR) . | tar -xf - -C $(STAGING_INSTALL_PREFIX)/share/wallabag
6 changes: 3 additions & 3 deletions cross/wallabag/digests
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
wallabag-2.2.3.tar.gz SHA1 496e6c7d980c078e42d3bab7b0e978bd0af02b96
wallabag-2.2.3.tar.gz SHA256 13fe5cb7cfc741abee08312f0055e9549e60590daff2fac41be5266f7956d857
wallabag-2.2.3.tar.gz MD5 63f4cc85397fd6db3e0e3d5f3fa11e02
wallabag-2.3.8.tar.gz SHA1 0a925de3170b8817fb556f82226bd7c7c3c5aabe
wallabag-2.3.8.tar.gz SHA256 58f319ee41828fcc4fd00a14c4ac7c16b2179a47af21e257a15938311d1426eb
wallabag-2.3.8.tar.gz MD5 b5f61f50aad1c60d34ad3a3b8848b29c
12 changes: 5 additions & 7 deletions spk/wallabag/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SPK_NAME = wallabag
SPK_VERS = 2.2.3
SPK_REV = 2
SPK_VERS = 2.3.8
SPK_REV = 3
SPK_ICON = src/wallabag.png
DSM_UI_DIR = app
BETA = 1
Expand All @@ -13,16 +13,14 @@ ADMIN_URL = /wallabag/web/
RELOAD_UI = yes
STARTABLE = no
DISPLAY_NAME = Wallabag
CHANGELOG = "Initial release"
CHANGELOG = "Update to 2.3.8, Update to generic service script"

HOMEPAGE = https://www.wallabag.org/
LICENSE = MIT

WIZARDS_DIR = src/wizard/

INSTALLER_SCRIPT = src/installer.sh
SSS_SCRIPT = src/dsm-control.sh

SERVICE_SETUP = src/service-setup.sh
STARTABLE = no

INSTALL_DEP_SERVICES = apache-web mysql
START_DEP_SERVICES = apache-web mysql
Expand Down
24 changes: 0 additions & 24 deletions spk/wallabag/src/dsm-control.sh

This file was deleted.

42 changes: 36 additions & 6 deletions spk/wallabag/src/parameters.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,64 @@
parameters:
database_driver: pdo_mysql
database_driver_class: ~
database_host: 127.0.0.1
database_port: 3306
database_name: @database_name@
database_user: wallabag
database_password: @database_password@
# For SQLite, database_path should be "%kernel.project_dir%/data/db/wallabag.sqlite"
database_path: null
database_table_prefix: wallabag_
database_socket: null
# with PostgreSQL and SQLite, you must set "utf8"
database_charset: utf8mb4
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null

domain_name: @protocoll_and_domain_name@

mailer_transport: smtp
mailer_user: ~
mailer_password: ~
mailer_host: 127.0.0.1
mailer_port: false
mailer_encryption: ~
mailer_auth_mode: ~

locale: en

# A secret key that's used to generate certain security-related tokens
secret: @wallabag_secret@

locale: en

# two factor stuff
twofactor_auth: false
twofactor_sender: no-reply@wallabag.org
fosuser_registration: true

# fosuser stuff
fosuser_registration: false
fosuser_confirmation: false

# how long the access token should live in seconds for the API
fos_oauth_server_access_token_lifetime: 3600
# how long the refresh token should life in seconds for the API
fos_oauth_server_refresh_token_lifetime: 1209600

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: { }

# sentry logging
sentry_dsn: ~
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh

# Package
PACKAGE="wallabag"
DNAME="Wallabag"
Expand All @@ -11,14 +9,28 @@ WEB_DIR="/var/services/web"
USER="$([ $(/bin/get_key_value /etc.defaults/VERSION buildnumber) -ge 4418 ] && echo -n http || echo -n nobody)"
TMP_DIR="${SYNOPKG_PKGDEST}/../../@tmp"
PHP="$([ $(/bin/get_key_value /etc.defaults/VERSION buildnumber) -ge 7135 ] && echo -n /usr/local/bin/php56 || echo -n /usr/bin/php)"
if command -v /usr/local/bin/php70 &> /dev/null; then
PHP="/usr/local/bin/php70"
fi
if command -v /usr/local/bin/php72 &> /dev/null; then
PHP="/usr/local/bin/php72"
fi
if command -v /usr/local/bin/php73 &> /dev/null; then
PHP="/usr/local/bin/php73"
fi
MYSQL="/usr/bin/mysql"
MYSQLDUMP="/usr/bin/mysqldump"
if command -v /var/packages/MariaDB10/target/usr/local/mariadb10/bin/mysql &> /dev/null; then
MYSQL="/var/packages/MariaDB10/target/usr/local/mariadb10/bin/mysql"
fi
if command -v /var/packages/MariaDB10/target/usr/local/mariadb10/bin/mysqldump &> /dev/null; then
MYSQLDUMP="/var/packages/MariaDB10/target/usr/local/mariadb10/bin/mysqldump"
fi
CFG_FILE="${WEB_DIR}/${PACKAGE}/app/config/parameters.yml"
MYSQL_USER="wallabag"
MYSQL_DATABASE="wallabag"


preinst ()
service_preinst ()
{
# Check database
if [ "${SYNOPKG_PKG_STATUS}" == "INSTALL" ]; then
Expand All @@ -38,7 +50,7 @@ preinst ()
exit 0
}

postinst ()
service_postinst ()
{
# Link
ln -s ${SYNOPKG_PKGDEST} ${INSTALL_DIR}
Expand All @@ -53,6 +65,7 @@ postinst ()
# render properties
sed -i -e "s|@database_password@|${wizard_mysql_database_password}|g" \
-e "s|@database_name@|${MYSQL_DATABASE}|g" \
-e "s|@protocoll_and_domain_name@|${wizard_protocoll_and_domain_name}/wallabag/web|g" \
-e "s|@wallabag_secret@|$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 30 | head -n 1)|g" \
${CFG_FILE}

Expand All @@ -69,7 +82,7 @@ postinst ()
exit 0
}

preuninst ()
service_preuninst ()
{
# Check database
if [ "${SYNOPKG_PKG_STATUS}" == "UNINSTALL" ] && ! ${MYSQL} -u root -p"${wizard_mysql_password_root}" -e quit > /dev/null 2>&1; then
Expand All @@ -88,7 +101,7 @@ preuninst ()
exit 0
}

postuninst ()
service_postuninst ()
{
# Remove link
rm -f ${INSTALL_DIR}
Expand All @@ -108,7 +121,7 @@ postuninst ()
exit 0
}

preupgrade ()
service_preupgrade ()
{
rm -rf ${TMP_DIR}/${PACKAGE}
mkdir -p ${TMP_DIR}/${PACKAGE}
Expand All @@ -117,7 +130,7 @@ preupgrade ()
exit 0
}

postupgrade ()
service_postupgrade ()
{
mv ${TMP_DIR}/${PACKAGE}/parameters.yml ${CFG_FILE}
mv ${TMP_DIR}/${PACKAGE}/db ${WEB_DIR}/${PACKAGE}/data/db
Expand Down
92 changes: 58 additions & 34 deletions spk/wallabag/src/wizard/install_uifile
Original file line number Diff line number Diff line change
@@ -1,38 +1,62 @@
[
{
"step_title":"Wallabag database configuration",
"items":[
{
"type":"password",
"desc":"Enter your MySQL password.",
"subitems":[
{
"key":"wizard_mysql_password_root",
"desc":"Root password",
"validator":{
"allowBlank":false
}
}
]
},
{
"type":"password",
"desc":"A 'wallabag' MySQL user and database will be created. Please enter a password for the 'wallabag' user.",
"subitems":[
{
"key":"wizard_mysql_database_password",
"desc":"User password",
"validator":{
"allowBlank":false
}
}
]
}
]
}, {
{
"step_title": "Wallabag database configuration",
"items": [
{
"type": "password",
"desc": "Enter your MySQL password.",
"subitems": [
{
"key": "wizard_mysql_password_root",
"desc": "Root password",
"validator": {
"allowBlank": false
}
}
]
},
{
"type": "password",
"desc": "A 'wallabag' MySQL user and database will be created. Please enter a password for the 'wallabag' user.",
"subitems": [
{
"key": "wizard_mysql_database_password",
"desc": "User password",
"validator": {
"allowBlank": false,
"regex": {
"expr": "/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[!@#$%^&*?{}()\\[\\]\\-=_+\\;'\":<>/,.])[A-Za-z\\d!@#$%^&*?{}()\\[\\]\\-=_+\\;'\":<>/,.]{10,}$/",
"errorText": "Minimal password length 10, Include mixed case, Include numeric characters, Include special characters, Exclude common password, Exclude name of user from password"
}
}
}
]
}
]
},
{
"step_title": "First login",
"items": [{
"items": [
{
"desc": "The default credentials for the web interface is wallabag:wallabag. Change it on 'User Management' page."
}]
}
},
{
"type": "textfield",
"desc": "Enter your NAS domain name or IP address. e.g https://192.168.0.2",
"subitems": [
{
"key": "wizard_protocoll_and_domain_name",
"desc": "Protocol and Domain Name",
"validator": {
"allowBlank": false,
"regex": {
"expr": "/http(s)?\\:\\/\\/.+\\..+/i",
"errorText": "Must be a valid URL"
}
}
}
]
}
]
}
]

0 comments on commit 272d8b6

Please sign in to comment.