Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing #221

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ea8311f
Fix hook (#206)
kay0u Jul 20, 2024
6f02e07
Update manifest.toml (#208)
ericgaspar Jul 20, 2024
be88e12
Update manifest.toml
ericgaspar Jul 20, 2024
a2316d7
Auto-update READMEs
yunohost-bot Jul 20, 2024
686fb36
Add parameters.yml (#209)
ericgaspar Jul 20, 2024
d7c0790
Function (#210)
ericgaspar Jul 20, 2024
cef003b
fix: add time for php script to run a 'long sync' with an application…
Gofannon Aug 28, 2024
a717c55
Auto-update READMEs
yunohost-bot Aug 28, 2024
c5515d9
[autopatch] Automatic patch attempt for helpers 2.1 (#214)
yunohost-bot Sep 1, 2024
781c612
Auto-update READMEs
yunohost-bot Sep 1, 2024
07a3fb4
Merge branch 'master' into testing
ericgaspar Sep 1, 2024
a60a457
Update manifest.toml
ericgaspar Sep 1, 2024
b6891a3
Auto-update READMEs
yunohost-bot Sep 1, 2024
2408697
fix
ericgaspar Sep 10, 2024
a3ea9dc
Auto-update READMEs
yunohost-bot Sep 10, 2024
ac9a715
Update manifest.toml
ericgaspar Sep 10, 2024
a563876
Merge branch 'testing' of https://github.com/YunoHost-Apps/wallabag2_…
ericgaspar Sep 10, 2024
a2d5b3f
Update manifest.toml
ericgaspar Sep 10, 2024
cf0dfcb
Auto-update READMEs
yunohost-bot Sep 10, 2024
16913fb
cleaning
ericgaspar Sep 10, 2024
fc0002b
Merge branch 'testing' of https://github.com/YunoHost-Apps/wallabag2_…
ericgaspar Sep 10, 2024
806054e
Merge branch 'master' into testing
ericgaspar Sep 10, 2024
c238b0e
Merge branch 'master' into testing
ericgaspar Sep 12, 2024
2dd626e
Put back upstream patches to fix auth problems (#218)
JimboJoe Sep 16, 2024
d228d3f
bump version
lapineige Sep 16, 2024
8249e23
Auto-update READMEs
yunohost-bot Sep 16, 2024
43a05dd
cleaning
ericgaspar Sep 28, 2024
47a2967
fix (#220)
ericgaspar Oct 4, 2024
36d9a12
Moved patches around (#223)
orhtej2 Oct 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps
Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html).


**Shipped version:** 2.5.4~ynh6
**Shipped version:** 2.5.4~ynh9

**Demo:** <https://demo.yunohost.org/wallabag/>

Expand Down
2 changes: 1 addition & 1 deletion README_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps
Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html).


**Versión actual:** 2.5.4~ynh6
**Versión actual:** 2.5.4~ynh9

**Demo:** <https://demo.yunohost.org/wallabag/>

Expand Down
2 changes: 1 addition & 1 deletion README_eu.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps
Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html).


**Paketatutako bertsioa:** 2.5.4~ynh6
**Paketatutako bertsioa:** 2.5.4~ynh9

**Demoa:** <https://demo.yunohost.org/wallabag/>

Expand Down
2 changes: 1 addition & 1 deletion README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Sont disponibles une interface web, des add-ons pour navigateurs (Firefox/Chrome
La mise à niveau depuis le paquet YunoHost de [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) demande une opération manuelle, c'est pourquoi un nouveau paquet est fournit. Pour le processus de migration, merci de vous référer à [la documentation officiel de Wallabag](https://doc.wallabag.org/fr/user/import/wallabagv1.html).


**Version incluse :** 2.5.4~ynh6
**Version incluse :** 2.5.4~ynh9

**Démo :** <https://demo.yunohost.org/wallabag/>

Expand Down
2 changes: 1 addition & 1 deletion README_gl.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps
Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html).


**Versión proporcionada:** 2.5.4~ynh6
**Versión proporcionada:** 2.5.4~ynh9

**Demo:** <https://demo.yunohost.org/wallabag/>

Expand Down
2 changes: 1 addition & 1 deletion README_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps
Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html).


**Versi terkirim:** 2.5.4~ynh6
**Versi terkirim:** 2.5.4~ynh9

**Demo:** <https://demo.yunohost.org/wallabag/>

Expand Down
2 changes: 1 addition & 1 deletion README_nl.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps
Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html).


**Geleverde versie:** 2.5.4~ynh6
**Geleverde versie:** 2.5.4~ynh9

**Demo:** <https://demo.yunohost.org/wallabag/>

Expand Down
2 changes: 1 addition & 1 deletion README_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps
Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html).


**Поставляемая версия:** 2.5.4~ynh6
**Поставляемая версия:** 2.5.4~ynh9

**Демо-версия:** <https://demo.yunohost.org/wallabag/>

Expand Down
2 changes: 1 addition & 1 deletion README_zh_Hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps
Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html).


**分发版本:** 2.5.4~ynh6
**分发版本:** 2.5.4~ynh9

**演示:** <https://demo.yunohost.org/wallabag/>

Expand Down
2 changes: 1 addition & 1 deletion manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ id = "wallabag2"
name = "Wallabag"
description.en = "Save and classify articles. Read them later"
description.fr = "Enregistrez et classez les articles. Lisez-les plus tard"
version = "2.5.4~ynh6"
version = "2.5.4~ynh9"

maintainers = ["lapineige"]

Expand Down
4 changes: 0 additions & 4 deletions scripts/backup
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/bash

#=================================================
# IMPORT GENERIC HELPERS
#=================================================

source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers

Expand Down
4 changes: 0 additions & 4 deletions scripts/change_url
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/bash

#=================================================
# IMPORT GENERIC HELPERS
#=================================================

source _common.sh
source /usr/share/yunohost/helpers

Expand Down
7 changes: 2 additions & 5 deletions scripts/install
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/bash

#=================================================
# IMPORT GENERIC HELPERS
#=================================================

source _common.sh
source /usr/share/yunohost/helpers

Expand All @@ -27,6 +23,8 @@ ynh_setup_source --dest_dir="$install_dir"
mkdir -p "$install_dir/var/logs/"
touch "$install_dir/var/logs/prod.log"

chown -R "$app:www-data" "$install_dir"

# Set permissions to app files
# Restrict rights to Wallabag user only
if [ -e "$install_dir/var/cache/prod/appProdProjectContainer.php" ]; then
Expand Down Expand Up @@ -75,7 +73,6 @@ ynh_config_add_phpfpm

ynh_config_add_logrotate "$install_dir/var/logs/prod.log"

# Create a dedicated Fail2Ban config
ynh_config_add_fail2ban --logpath="$install_dir/var/logs/prod.log" --failregex='app.ERROR: Authentication failure for user "([\w]+)?", from IP "<HOST>"'

#=================================================
Expand Down
4 changes: 0 additions & 4 deletions scripts/remove
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/bash

#=================================================
# IMPORT GENERIC HELPERS
#=================================================

source _common.sh
source /usr/share/yunohost/helpers

Expand Down
4 changes: 0 additions & 4 deletions scripts/restore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/bash

#=================================================
# IMPORT GENERIC HELPERS
#=================================================

source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers

Expand Down
6 changes: 2 additions & 4 deletions scripts/upgrade
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/bash

#=================================================
# IMPORT GENERIC HELPERS
#=================================================

source _common.sh
source /usr/share/yunohost/helpers

Expand All @@ -18,6 +14,8 @@ ynh_setup_source --dest_dir="$install_dir" --full_replace --keep="app/config/par
mkdir -p "$install_dir/var/logs/"
touch "$install_dir/var/logs/prod.log"

chown -R "$app:www-data" "$install_dir"

# Set permissions to app files
# Restrict rights to Wallabag user only
if [ -e "$install_dir/var/cache/prod/appProdProjectContainer.php" ]; then
Expand Down
46 changes: 46 additions & 0 deletions sources/patches/main/00-ldap-auth.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/app/config/security.yml b/app/config/security.yml
index 02afc9ea..5a3f7a34 100644
--- a/app/config/security.yml
+++ b/app/config/security.yml
@@ -13,6 +13,14 @@ security:
property: username
fos_userbundle:
id: fos_user.user_provider.username_email
+ yunohost_users:
+ ldap:
+ service: yunohost.ldap
+ base_dn: ou=users,dc=yunohost,dc=org
+ search_dn:
+ 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
@@ -38,6 +46,9 @@ security:

secured_area:
pattern: ^/
+ http_basic_ldap:
+ service: yunohost.ldap
+ dn_string: "uid={username},ou=users,dc=yunohost,dc=org"
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
diff --git a/app/config/services.yml b/app/config/services.yml
index 7b85d846..f23961c5 100644
--- a/app/config/services.yml
+++ b/app/config/services.yml
@@ -43,6 +43,10 @@ services:
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
--
2.17.1
63 changes: 63 additions & 0 deletions sources/patches/main/01-logout-success-handler.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
diff --git a/app/config/security.yml b/app/config/security.yml
index 5a3f7a34..1720e741 100644
--- a/app/config/security.yml
+++ b/app/config/security.yml
@@ -62,7 +62,7 @@ security:

logout:
path: /logout
- target: /
+ success_handler: yunohost.logout_success_handler

access_control:
- { path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY }
diff --git a/app/config/services.yml b/app/config/services.yml
index f23961c5..f266e6d1 100644
--- a/app/config/services.yml
+++ b/app/config/services.yml
@@ -43,6 +43,10 @@ services:
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
arguments: ["localhost"]
diff --git a/src/Wallabag/YunoHostBundle/Security/LogoutSuccessHandler.php b/src/Wallabag/YunoHostBundle/Security/LogoutSuccessHandler.php
new file mode 100644
index 00000000..b3268243
--- /dev/null
+++ b/src/Wallabag/YunoHostBundle/Security/LogoutSuccessHandler.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Wallabag\YunoHostBundle\Security;
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RedirectResponse;
+use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface;
+
+/**
+ * Redirects to the SSO logout URL in case of a successful logout.
+ *
+ * @see http://api.symfony.com/3.1/Symfony/Component/Security/Http/Logout/LogoutSuccessHandlerInterface.html
+ */
+class LogoutSuccessHandler implements LogoutSuccessHandlerInterface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function onLogoutSuccess(Request $request)
+ {
+ // Retrieve the current SSO logout URL
+ $main_domain = exec('cat /etc/yunohost/current_host');
+ $url = 'https://' . $main_domain . '/yunohost/sso/?action=logout';
+
+ return new RedirectResponse($url);
+ }
+}
--
2.17.1
11 changes: 11 additions & 0 deletions sources/patches/main/02-oauth-workaround.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/vendor/friendsofsymfony/oauth-server-bundle/Storage/OAuthStorage.php 2016-02-22 13:57:55.000000000 +0000
+++ b/vendor/friendsofsymfony/oauth-server-bundle/Storage/OAuthStorage.php 2017-04-13 17:16:06.298501506 +0000
@@ -170,7 +170,7 @@
if (null !== $user) {
$encoder = $this->encoderFactory->getEncoder($user);

- if ($encoder->isPasswordValid($user->getPassword(), $password, $user->getSalt())) {
+ if (true) {
return array(
'data' => $user,
);