Skip to content

Commit

Permalink
basic migration of old users/zauth/permissions/groups to nucleos
Browse files Browse the repository at this point in the history
  • Loading branch information
Guite committed Mar 4, 2023
1 parent b15a24d commit 935ae5f
Show file tree
Hide file tree
Showing 392 changed files with 746 additions and 18,241 deletions.
13 changes: 6 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ ZIKULA_INSTALLED='0.0.0'
# MAILER_DSN=null://null
###< symfony/mailer ###

###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=doctrine://default
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
###< symfony/messenger ###

###> nucleos/user-bundle ###
MAIL_SENDER=no-reply@localhost
###< nucleos/user-bundle ###

###> symfony/lock ###
# Choose one of the stores below
# postgresql+advisory://db_user:db_password@localhost/db_name
LOCK_DSN=flock
###< symfony/lock ###
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
php bin/console lint:yaml src/Zikula/ --parse-tags
php bin/console lint:twig --show-deprecations src/system/ src/Zikula/
- name: Iache vulnerability database
- name: Cache vulnerability database
uses: actions/cache@v3
id: cache-db
with:
Expand Down
6 changes: 2 additions & 4 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
Zikula\Bundle\CoreBundle\CoreBundle::class => ['all' => true],
Zikula\Bundle\FormExtensionBundle\ZikulaFormExtensionBundle::class => ['all' => true],
Zikula\CategoriesBundle\ZikulaCategoriesBundle::class => ['all' => true],
Zikula\GroupsBundle\ZikulaGroupsBundle::class => ['all' => true],
Zikula\LegalBundle\ZikulaLegalBundle::class => ['all' => true],
Zikula\PermissionsBundle\ZikulaPermissionsBundle::class => ['all' => true],
Zikula\ProfileBundle\ZikulaProfileBundle::class => ['all' => true],
Zikula\StaticContentBundle\ZikulaStaticContentBundle::class => ['all' => true],
Zikula\ThemeBundle\ZikulaThemeBundle::class => ['all' => true],
Zikula\UsersBundle\ZikulaUsersBundle::class => ['all' => true],
Zikula\ZAuthBundle\ZikulaZAuthBundle::class => ['all' => true],
Nucleos\UserBundle\NucleosUserBundle::class => ['all' => true],
Nucleos\ProfileBundle\NucleosProfileBundle::class => ['all' => true],
];
7 changes: 3 additions & 4 deletions config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ doctrine:
utcdatetime:
class: Zikula\Bundle\CoreBundle\Doctrine\DBAL\Type\UTCDateTimeType
orm:
proxy_namespace: DoctrineProxy
proxy_dir: '%kernel.cache_dir%/doctrine/orm/DoctrineProxy'
auto_generate_proxy_classes: false
enable_lazy_ghost_objects: true
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
default_entity_manager: default
auto_generate_proxy_classes: true
#naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
entity_managers:
# the standard distribution overrides this to be true in debug, false otherwise
Expand Down Expand Up @@ -53,7 +53,6 @@ doctrine:
when@prod:
doctrine:
orm:
auto_generate_proxy_classes: false
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
Expand Down
1 change: 1 addition & 0 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ framework:
secret: '%env(APP_SECRET)%'
#csrf_protection: true
http_method_override: false
handle_all_throwables: true

default_locale: en
#enabled_locales: [en, de]
Expand Down
17 changes: 0 additions & 17 deletions config/packages/messenger.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions config/packages/notifier.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions config/packages/nucleos_profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# see https://docs.nucleos.rocks/projects/profile-bundle/en/1.5.x/configuration.html
nucleos_profile:
registration:
confirmation:
enabled: true
from_email: '%env(MAIL_SENDER)%'
12 changes: 12 additions & 0 deletions config/packages/nucleos_user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# see https://docs.nucleos.rocks/projects/user-bundle/en/2.0.x/configuration_reference.html
nucleos_user:
db_driver: orm
user_class: 'Zikula\UsersBundle\Entity\User'
firewall_name: main
from_email: '%env(MAIL_SENDER)%'
deletion:
enabled: true
group:
group_class: 'Zikula\UsersBundle\Entity\Group'
loggedin:
route: 'user_dashboard' # Redirect route after login
4 changes: 0 additions & 4 deletions config/packages/rate_limiter.yaml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
framework:
rate_limiter:
lost_credentials:
policy: 'fixed_window'
limit: 20
interval: '60 minutes'
test_mails:
policy: 'fixed_window'
limit: 5
Expand Down
38 changes: 23 additions & 15 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
security:
enable_authenticator_manager: true
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
password_hashers:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
encoders:
Zikula\ZAuthBundle\Entity\AuthenticationMappingEntity:
algorithm: auto
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider

providers:
users_in_memory: { memory: null }
nucleos_userbundle:
id: nucleos_user.user_provider.username_email

firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
lazy: true
provider: users_in_memory
pattern: ^/
user_checker: Nucleos\UserBundle\Security\UserChecker
form_login:
provider: nucleos_userbundle
enable_csrf: true

# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall
logout: true

# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true

# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
role_hierarchy:
ROLE_EDITOR: ROLE_USER
ROLE_ADMIN: ROLE_EDITOR
ROLE_SUPER_ADMIN: ROLE_ADMIN

access_control:
# - { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
# public access for login form and password reset page
- { path: ^/login, role: PUBLIC_ACCESS }
- { path: ^/resetting, role: PUBLIC_ACCESS }
# login for password change and profile
- { path: ^/change-password, role: IS_AUTHENTICATED_REMEMBERED }
- { path: ^/profile, role: IS_AUTHENTICATED_REMEMBERED }
# admin dashboard - disabled in favor of #[IsGranted] attribute in AdminDashboardController
# - { path: ^/admin, role: ROLE_ADMIN }

when@test:
security:
Expand Down
7 changes: 7 additions & 0 deletions config/routes/nucleos_profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nucleos_profile_profile:
resource: "@NucleosProfileBundle/Resources/config/routing/profile.php"
prefix: /profile

nucleos_profile_registration:
resource: "@NucleosProfileBundle/Resources/config/routing/registration.php"
prefix: /registration
14 changes: 14 additions & 0 deletions config/routes/nucleos_user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
nucleos_user_security:
resource: "@NucleosUserBundle/Resources/config/routing/security.php"

nucleos_user_resetting:
resource: "@NucleosUserBundle/Resources/config/routing/resetting.php"
prefix: /resetting

nucleos_user_change_password:
resource: "@NucleosUserBundle/Resources/config/routing/change_password.php"
prefix: /credentials

nucleos_user_deletion:
resource: "@NucleosUserBundle/Resources/config/routing/deletion.php"
prefix: /deletion
2 changes: 0 additions & 2 deletions config/routes/zikula_groups.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions config/routes/zikula_permissions.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions config/routes/zikula_static_content.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions config/routes/zikula_zauth.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions couscous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,15 @@ menu:
content:
name: Content
items:
content-pages:
text: Static pages
relativeUrl: Content/pages.html
categories:
text: Categories
relativeUrl: Content/Categories/index.html
access-control:
name: Access Control
items:
groups:
text: Groups
relativeUrl: AccessControl/Groups/index.html
users:
text: Users
relativeUrl: AccessControl/Users/index.html
authentication:
text: Authentication
relativeUrl: AccessControl/Authentication/index.html
permissions:
text: Permissions
relativeUrl: AccessControl/Permissions/index.html
layout:
name: Layout & Design
items:
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 935ae5f

Please sign in to comment.