Move to Symfony Flex

The structure changed completely.
Bundles are gone. Everything is flatten in the folder `src`.
I separated import & api controllers to avoid _pollution_ in the main controller folder.
This commit is contained in:
Jeremy Benoist
2022-12-20 22:36:02 +01:00
parent 911e0238b7
commit 6b5a518ce2
629 changed files with 7238 additions and 2194 deletions

23
config/bootstrap.php Normal file
View File

@ -0,0 +1,23 @@
<?php
use Symfony\Component\Dotenv\Dotenv;
require dirname(__DIR__) . '/vendor/autoload.php';
if (!class_exists(Dotenv::class)) {
throw new LogicException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
}
// Load cached env vars if the .env.local.php file exists
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
if (is_array($env = @include dirname(__DIR__) . '/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) {
(new Dotenv(false))->populate($env);
} else {
// load all the .env files
(new Dotenv(false))->loadEnv(dirname(__DIR__) . '/.env');
}
$_SERVER += $_ENV;
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], \FILTER_VALIDATE_BOOLEAN) ? '1' : '0';

34
config/bundles.php Normal file
View File

@ -0,0 +1,34 @@
<?php
return [
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Craue\ConfigBundle\CraueConfigBundle::class => ['all' => true],
DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
FOS\JsRoutingBundle\FOSJsRoutingBundle::class => ['all' => true],
FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
FOS\UserBundle\FOSUserBundle::class => ['all' => true],
KPhoen\RulerZBundle\KPhoenRulerZBundle::class => ['all' => true],
Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle::class => ['all' => true],
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
OldSound\RabbitMqBundle\OldSoundRabbitMqBundle::class => ['all' => true],
Http\HttplugBundle\HttplugBundle::class => ['all' => true],
Scheb\TwoFactorBundle\SchebTwoFactorBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
Sentry\SentryBundle\SentryBundle::class => ['prod' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true],
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
];

View File

@ -0,0 +1,4 @@
# For full configuration see https://github.com/willdurand/BazingaHateoasBundle/blob/master/Resources/doc/index.md#reference-configuration
bazinga_hateoas:
twig_extension:
enabled: true

View File

@ -0,0 +1,19 @@
framework:
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null

View File

@ -0,0 +1,3 @@
# define custom entity so we can override length attribute to fix utf8mb4 issue
craue_config:
entity_name: App\Entity\InternalSetting

View File

@ -0,0 +1,9 @@
framework:
router:
strict_requirements: true
profiler:
only_exceptions: false
mailer:
# see https://mailcatcher.me/
dsn: smtp://127.0.0.1:1025

View File

@ -0,0 +1,7 @@
jms_serializer:
visitors:
json_serialization:
options:
- JSON_PRETTY_PRINT
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION

View File

@ -0,0 +1,19 @@
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]

View File

@ -0,0 +1,3 @@
web_profiler:
toolbar: true
intercept_redirects: false

View File

@ -0,0 +1,32 @@
doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
# doctrine:
# dbal:
# url: '%env(resolve:DATABASE_URL)%'
# # IMPORTANT: You MUST configure your server version,
# # either here or in the DATABASE_URL env var (see .env file)
# #server_version: '14'
# orm:
# auto_generate_proxy_classes: true
# naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
# auto_mapping: true
# mappings:
# App:
# is_bundle: false
# dir: '%kernel.project_dir%/src/Entity'
# prefix: 'App\Entity'
# alias: App

View File

@ -0,0 +1,12 @@
doctrine_migrations:
migrations_paths:
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
'DoctrineMigrations': '%kernel.project_dir%/migrations'
enable_profiler: false
storage:
table_storage:
table_name: 'migration_versions'
version_column_name: 'version'
version_column_length: 192
executed_at_column_name: 'executed_at'

View File

@ -0,0 +1,13 @@
fos_js_routing:
routes_to_expose:
- homepage
- starred
- archive
- all
- tag
- config
- import
- developer
- howto
- fos_user_security_logout
- new

View File

@ -0,0 +1,12 @@
# Read the documentation: https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/blob/master/Resources/doc/index.md#step-5-configure-fosoauthserverbundle
fos_oauth_server:
db_driver: orm
client_class: App\Entity\Client
access_token_class: App\Entity\AccessToken
refresh_token_class: App\Entity\RefreshToken
auth_code_class: App\Entity\AuthCode
service:
user_provider: fos_user.user_provider.username_email
options:
refresh_token_lifetime: "%env(FOS_OAUTH_SERVER_REFRESH_TOKEN_LIFETIME)%"
access_token_lifetime: "%env(FOS_OAUTH_SERVER_ACCESS_TOKEN_LIFETIME)%"

View File

@ -0,0 +1,34 @@
fos_rest:
param_fetcher_listener: true
body_listener: true
view:
mime_types:
csv:
- 'text/csv'
- 'text/plain'
pdf:
- 'application/pdf'
epub:
- 'application/epub+zip'
mobi:
- 'application/x-mobipocket-ebook'
view_response_listener: 'force'
formats:
xml: true
json: true
txt: true
csv: true
pdf: true
epub: true
mobi: true
failed_validation: HTTP_BAD_REQUEST
routing_loader: false
format_listener:
enabled: true
rules:
- { path: "^/api/entries/([0-9]+)/export.(.*)", priorities: ['epub', 'mobi', 'pdf', 'txt', 'csv'], fallback_format: json, prefer_extension: false }
- { path: "^/api", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
- { path: "^/annotations", priorities: ['json', 'xml'], fallback_format: json, prefer_extension: false }
# for an unknown reason, EACH REQUEST goes to FOS\RestBundle\EventListener\FormatListener
# so we need to add custom rule for custom api export but also for all other routes of the application...
- { path: '^/', priorities: ['text/html', '*/*'], fallback_format: html, prefer_extension: false }

View File

@ -0,0 +1,12 @@
fos_user:
db_driver: orm
firewall_name: secured_area
user_class: App\Entity\User
registration:
confirmation:
enabled: '%env(bool:FOSUSER_CONFIRMATION)%'
from_email:
address: '%env(FROM_EMAIL)%'
sender_name: wallabag
service:
mailer: App\Mailer\UserMailer

View File

@ -0,0 +1,24 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
translator:
enabled: true
fallback: "%env(LOCALE)%"
default_path: '%kernel.project_dir%/translations'
secret: '%env(APP_SECRET)%'
router:
strict_requirements: ~
form: ~
csrf_protection: ~
validation:
enable_annotations: true
templating:
engines: ['twig']
default_locale: "%env(LOCALE)%"
trusted_hosts: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: session.handler.native_file
save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"
fragments: ~
http_method_override: true
assets: ~

View File

@ -0,0 +1,10 @@
services:
Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory'
Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory'
http_discovery.psr17_factory:
class: Http\Discovery\Psr17Factory

View File

@ -0,0 +1,21 @@
httplug:
clients:
wallabag_core:
factory: App\Helper\HttpClientFactory
config:
defaults:
timeout: 10
plugins: ['httplug.plugin.logger']
wallabag_core.entry.download_images:
factory: 'httplug.factory.auto'
plugins: ['httplug.plugin.logger']
wallabag_import.pocket.client:
factory: 'httplug.factory.auto'
plugins:
- 'httplug.plugin.logger'
- header_defaults:
headers:
'content-type': 'application/json'
'X-Accept': 'application/json'
discovery:
client: false

View File

@ -0,0 +1,9 @@
jms_serializer:
handlers:
# to be removed if we switch to (default) ISO8601 datetime instead of ATOM
# see: https://github.com/schmittjoh/JMSSerializerBundle/pull/494
datetime:
default_format: "Y-m-d\\TH:i:sO" # ATOMjms_serializer:
visitors:
xml_serialization:
format_output: '%kernel.debug%'

View File

@ -0,0 +1,3 @@
kphoen_rulerz:
targets:
doctrine: true

View File

@ -0,0 +1,3 @@
framework:
mailer:
dsn: '%env(MAILER_DSN)%'

View File

@ -0,0 +1,3 @@
monolog:
channels:
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists

View File

@ -0,0 +1,17 @@
nelmio_api_doc:
areas: # to filter documented areas
path_patterns:
- ^/api(?!/doc$) # Accepts routes under /api except /api/doc
documentation:
info:
title: wallabag API documentation
description: This is the API documentation of wallabag
version: 2.x
securityDefinitions:
Bearer:
type: apiKey
description: 'Value: Bearer {jwt}'
name: Authorization
in: header
security:
- Bearer: []

View File

@ -0,0 +1,28 @@
nelmio_cors:
defaults:
allow_credentials: false
allow_origin: []
allow_headers: []
allow_methods: []
expose_headers: []
max_age: 0
hosts: []
#origin_regex: false
paths:
'^/api/':
allow_origin: ['*']
allow_headers: ['Authorization','content-type']
allow_methods: ['POST', 'PUT', 'PATCH','GET', 'DELETE']
max_age: 3600
'^/oauth/':
allow_origin: ['*']
allow_headers: ['Authorization','content-type']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
max_age: 3600
'^/':
#origin_regex: true
allow_origin: ['*']
allow_headers: ['Authorization','content-type']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
max_age: 3600
hosts: ['^api\.']

View File

@ -0,0 +1,148 @@
old_sound_rabbit_mq:
connections:
default:
url: '%env(RABBITMQ_URL)%'
vhost: /
lazy: true
producers:
import_pocket:
connection: default
exchange_options:
name: 'wallabag.import.pocket'
type: topic
import_readability:
connection: default
exchange_options:
name: 'wallabag.import.readability'
type: topic
import_pinboard:
connection: default
exchange_options:
name: 'wallabag.import.pinboard'
type: topic
import_delicious:
connection: default
exchange_options:
name: 'wallabag.import.delicious'
type: topic
import_instapaper:
connection: default
exchange_options:
name: 'wallabag.import.instapaper'
type: topic
import_wallabag_v1:
connection: default
exchange_options:
name: 'wallabag.import.wallabag_v1'
type: topic
import_wallabag_v2:
connection: default
exchange_options:
name: 'wallabag.import.wallabag_v2'
type: topic
import_elcurator:
connection: default
exchange_options:
name: 'wallabag.import.elcurator'
type: topic
import_firefox:
connection: default
exchange_options:
name: 'wallabag.import.firefox'
type: topic
import_chrome:
connection: default
exchange_options:
name: 'wallabag.import.chrome'
type: topic
consumers:
import_pocket:
connection: default
exchange_options:
name: 'wallabag.import.pocket'
type: topic
queue_options:
name: 'wallabag.import.pocket'
callback: wallabag_import.consumer.amqp.pocket
qos_options: {prefetch_count: 10}
import_readability:
connection: default
exchange_options:
name: 'wallabag.import.readability'
type: topic
queue_options:
name: 'wallabag.import.readability'
callback: wallabag_import.consumer.amqp.readability
qos_options: {prefetch_count: 10}
import_instapaper:
connection: default
exchange_options:
name: 'wallabag.import.instapaper'
type: topic
queue_options:
name: 'wallabag.import.instapaper'
callback: wallabag_import.consumer.amqp.instapaper
qos_options: {prefetch_count: 10}
import_pinboard:
connection: default
exchange_options:
name: 'wallabag.import.pinboard'
type: topic
queue_options:
name: 'wallabag.import.pinboard'
callback: wallabag_import.consumer.amqp.pinboard
qos_options: {prefetch_count: 10}
import_delicious:
connection: default
exchange_options:
name: 'wallabag.import.delicious'
type: topic
queue_options:
name: 'wallabag.import.delicious'
callback: wallabag_import.consumer.amqp.delicious
qos_options: {prefetch_count: 10}
import_wallabag_v1:
connection: default
exchange_options:
name: 'wallabag.import.wallabag_v1'
type: topic
queue_options:
name: 'wallabag.import.wallabag_v1'
callback: wallabag_import.consumer.amqp.wallabag_v1
qos_options: {prefetch_count: 10}
import_wallabag_v2:
connection: default
exchange_options:
name: 'wallabag.import.wallabag_v2'
type: topic
queue_options:
name: 'wallabag.import.wallabag_v2'
callback: wallabag_import.consumer.amqp.wallabag_v2
qos_options: {prefetch_count: 10}
import_elcurator:
connection: default
exchange_options:
name: 'wallabag.import.elcurator'
type: topic
queue_options:
name: 'wallabag.import.elcurator'
callback: wallabag_import.consumer.amqp.elcurator
qos_options: {prefetch_count: 10}
import_firefox:
connection: default
exchange_options:
name: 'wallabag.import.firefox'
type: topic
queue_options:
name: 'wallabag.import.firefox'
callback: wallabag_import.consumer.amqp.firefox
qos_options: {prefetch_count: 10}
import_chrome:
connection: default
exchange_options:
name: 'wallabag.import.chrome'
type: topic
queue_options:
name: 'wallabag.import.chrome'
callback: wallabag_import.consumer.amqp.chrome
qos_options: {prefetch_count: 10}

View File

@ -0,0 +1,18 @@
doctrine:
orm:
auto_generate_proxy_classes: false
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
result_cache_driver:
type: pool
pool: doctrine.result_cache_pool
framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system

View File

@ -0,0 +1,6 @@
jms_serializer:
visitors:
json_serialization:
options:
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION

View File

@ -0,0 +1,21 @@
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested:
type: stream
path: php://stderr
level: debug
formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]
deprecation:
type: stream
channels: [deprecation]
path: php://stderr

View File

@ -0,0 +1,3 @@
framework:
router:
strict_requirements: null

View File

@ -0,0 +1,22 @@
sentry:
dsn: '%env(SENTRY_DSN)%'
options:
excluded_exceptions:
- Symfony\Component\HttpKernel\Exception\NotFoundHttpException
- Symfony\Component\Security\Core\Exception\AccessDeniedException
# If you are using Monolog, you also need these additional configuration and services to log the errors correctly:
# https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration
# register_error_listener: false
# monolog:
# handlers:
# sentry:
# type: service
# id: Sentry\Monolog\Handler
# services:
# Sentry\Monolog\Handler:
# arguments:
# $hub: '@Sentry\State\HubInterface'
# $level: !php/const Monolog\Logger::ERROR

View File

@ -0,0 +1,7 @@
framework:
router:
utf8: true
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost

View File

@ -0,0 +1,28 @@
# See the configuration reference at https://symfony.com/bundles/SchebTwoFactorBundle/5.x/configuration.html
scheb_two_factor:
# security_tokens:
# - Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken
# If you're using guard-based authentication, you have to use this one:
# - Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken
# If you're using authenticator-based security (introduced in Symfony 5.1), you have to use this one:
# - Symfony\Component\Security\Http\Authenticator\Token\PostAuthenticationToken
trusted_device:
enabled: true
cookie_name: wllbg_trusted_computer
lifetime: 2592000
backup_codes:
enabled: "%env(TWOFACTOR_AUTH)%"
google:
enabled: "%env(TWOFACTOR_AUTH)%"
issuer: "%env(SERVER_NAME)%"
template: "Authentication/form.html.twig"
email:
enabled: "%env(TWOFACTOR_AUTH)%"
sender_email: "%env(TWOFACTOR_SENDER)%"
digits: 6
template: "Authentication/form.html.twig"
mailer: App\Mailer\AuthCodeMailer

View File

@ -0,0 +1,81 @@
security:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH ]
providers:
administrators:
entity:
class: 'App\Entity\User'
property: username
fos_userbundle:
id: fos_user.user_provider.username_email
# the main part of the security, where you can set up firewalls
# for specific sections of your app
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
oauth_token:
pattern: ^/oauth/v2/token
security: false
api:
pattern: /api/.*
fos_oauth: true
stateless: true
anonymous: true
provider: fos_userbundle
login_firewall:
pattern: ^/login$
anonymous: ~
secured_area:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
anonymous: true
remember_me:
secret: "%env(APP_SECRET)%"
lifetime: 31536000
path: /
domain: ~
logout:
path: /logout
target: /
two_factor:
provider: fos_userbundle
auth_form_path: 2fa_login
check_path: 2fa_login_check
access_control:
- { path: ^/api/(doc|version|info|user), roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
# force role for logout otherwise when 2fa enable, you won't be able to logout
# https://github.com/scheb/two-factor-bundle/issues/168#issuecomment-430822478
- { path: ^/logout, roles: [IS_AUTHENTICATED_ANONYMOUSLY, IS_AUTHENTICATED_2FA_IN_PROGRESS] }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: /(unread|starred|archive|annotated|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/locale, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/feed, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: /(unread|starred|archive|annotated).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } # For backwards compatibility
- { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/settings, roles: ROLE_SUPER_ADMIN }
- { path: ^/annotations, roles: ROLE_USER }
- { path: ^/2fa, role: IS_AUTHENTICATED_2FA_IN_PROGRESS }
- { path: ^/users, roles: ROLE_SUPER_ADMIN }
- { path: ^/ignore-origin-instance-rules, roles: ROLE_SUPER_ADMIN }
- { path: ^/, roles: ROLE_USER }

View File

@ -0,0 +1,4 @@
# see https://github.com/symfony/symfony-standard/pull/1133
sensio_framework_extra:
router:
annotations: false

View File

@ -0,0 +1,9 @@
# Read the documentation: https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html
# See the official DoctrineExtensions documentation for more details: https://github.com/doctrine-extensions/DoctrineExtensions/tree/main/doc
stof_doctrine_extensions:
default_locale: "%env(LOCALE)%"
translation_fallback: true
orm:
default:
tree: true
sluggable: true

View File

@ -0,0 +1,4 @@
dama_doctrine_test:
enable_static_connection: true
enable_static_meta_data_cache: true
enable_static_query_cache: true

View File

@ -0,0 +1,8 @@
doctrine:
orm:
metadata_cache_driver:
type: service
id: filesystem_cache
query_cache_driver:
type: service
id: filesystem_cache

View File

@ -0,0 +1,10 @@
framework:
test: ~
session:
storage_id: session.storage.mock_file
profiler:
collect: false
translator:
enabled: false
mailer:
dsn: 'null://null'

View File

@ -0,0 +1,12 @@
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
channels: ["!event"]
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug

View File

@ -0,0 +1,2 @@
twig:
strict_variables: true

View File

@ -0,0 +1,3 @@
framework:
validation:
not_compromised_password: false

View File

@ -0,0 +1,6 @@
web_profiler:
toolbar: false
intercept_redirects: false
framework:
profiler: { collect: false }

View File

@ -0,0 +1,6 @@
framework:
default_locale: en
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:
- en

14
config/packages/twig.yaml Normal file
View File

@ -0,0 +1,14 @@
# twig:
# default_path: '%kernel.project_dir%/templates'
# debug: '%kernel.debug%'
# strict_variables: '%kernel.debug%'
# exception_controller: null
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
form_themes:
- "@LexikFormFilter/Form/form_div_layout.html.twig"
exception_controller: App\Controller\ExceptionController:showAction
globals:
registration_enabled: '%env(bool:FOSUSER_REGISTRATION)%'

View File

@ -0,0 +1,8 @@
framework:
validation:
email_validation_mode: html5
# Enables validator auto-mapping support.
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
#auto_mapping:
# App\Entity\: []

9
config/preload.php Normal file
View File

@ -0,0 +1,9 @@
<?php
if (file_exists(dirname(__DIR__) . '/var/cache/prod/srcApp_KernelProdContainer.preload.php')) {
require dirname(__DIR__) . '/var/cache/prod/srcApp_KernelProdContainer.preload.php';
}
if (file_exists(dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php';
}

66
config/routes.yaml Normal file
View File

@ -0,0 +1,66 @@
doc-api:
resource: "@NelmioApiDocBundle/Resources/config/routing/swaggerui.xml"
prefix: /api/doc
homepage:
path: "/{page}"
defaults:
_controller: 'App\Controller\EntryController::showUnreadAction'
page : 1
requirements:
page: \d+
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
fos_oauth_server_token:
resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"
craue_config_settings_modify:
path: /settings
defaults:
_controller: 'Craue\ConfigBundle\Controller\SettingsController::modifyAction'
2fa_login:
path: /2fa
defaults:
_controller: "scheb_two_factor.form_controller:form"
2fa_login_check:
path: /2fa_check
# redirect RSS feed to Atom
rss_to_atom_unread:
path: /{username}/{token}/unread.xml
defaults:
_controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction'
route: unread_feed
permanent: true
rss_to_atom_archive:
path: /{username}/{token}/archive.xml
defaults:
_controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction'
route: archive_feed
permanent: true
rss_to_atom_starred:
path: /{username}/{token}/starred.xml
defaults:
_controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction'
route: starred_feed
permanent: true
rss_to_atom_all:
path: /{username}/{token}/all.xml
defaults:
_controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction'
route: all_feed
permanent: true
rss_to_atom_tags:
path: /{username}/{token}/tags/{slug}.xml
defaults:
_controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction'
route: tag_feed
permanent: true

View File

@ -0,0 +1,7 @@
controllers:
resource: ../../src/Controller/
type: annotation
kernel:
resource: ../../src/Kernel.php
type: annotation

View File

@ -0,0 +1,3 @@
_errors:
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
prefix: /_error

View File

@ -0,0 +1,7 @@
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt
web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler

View File

@ -0,0 +1,2 @@
fos_js_routing:
resource: "@FOSJsRoutingBundle/Resources/config/routing/routing-sf4.xml"

View File

@ -0,0 +1,5 @@
fos_oauth_server_token:
resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"
fos_oauth_server_authorize:
resource: "@FOSOAuthServerBundle/Resources/config/routing/authorize.xml"

View File

@ -0,0 +1,12 @@
# Expose your documentation as JSON swagger compliant
app.swagger:
path: /api/doc.json
methods: GET
defaults: { _controller: nelmio_api_doc.controller.swagger }
## Requires the Asset component and the Twig bundle
## $ composer require twig asset
#app.swagger_ui:
# path: /api/doc
# methods: GET
# defaults: { _controller: nelmio_api_doc.controller.swagger_ui }

View File

@ -0,0 +1,7 @@
2fa_login:
path: /2fa
defaults:
_controller: "scheb_two_factor.form_controller::form"
2fa_login_check:
path: /2fa_check

380
config/services.yaml Normal file
View File

@ -0,0 +1,380 @@
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
# parameters:
# services:
# # default configuration for services in *this* file
# _defaults:
# autowire: true # Automatically injects dependencies in your services.
# autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
# # makes classes in src/ available to be used as services
# # this creates a service per class whose id is the fully-qualified class name
# App\:
# resource: '../src/'
# exclude:
# - '../src/DependencyInjection/'
# - '../src/Entity/'
# - '../src/Kernel.php'
# # controllers are imported separately to make sure services can be injected
# # as action arguments even if you don't extend any base controller class
# App\Controller\:
# resource: '../src/Controller/'
# tags: ['controller.service_arguments']
# # add more service definitions when explicit configuration is needed
# # please note that last definitions always *replace* previous ones
imports:
- { resource: services_rabbit.yaml }
- { resource: services_redis.yaml }
parameters:
# Allows to use the live reload feature for changes in assets
use_webpack_dev_server: false
craue_config.cache_adapter.class: Craue\ConfigBundle\CacheAdapter\SymfonyCacheComponentAdapter
lexik_form_filter.get_filter.doctrine_orm.class: App\Event\Subscriber\CustomDoctrineORMSubscriber
addons_url:
firefox: https://addons.mozilla.org/firefox/addon/wallabagger/
chrome: https://chrome.google.com/webstore/detail/wallabagger/gbmgphmejlcoihgedabhgjdkcahacjlj
opera: https://addons.opera.com/en/extensions/details/wallabagger/?display=en
f_droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche
google_play: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche
ios: https://itunes.apple.com/app/wallabag-2/id1170800946?mt=8
windows: https://www.microsoft.com/store/apps/wallabag/9nblggh11646
twofactor_auth: '%env(TWOFACTOR_AUTH)%'
domain_name: '%env(DOMAIN_NAME)%'
database_table_prefix: '%env(DATABASE_TABLE_PREFIX)%'
fosuser_registration: '%env(FOSUSER_REGISTRATION)%'
services:
_defaults:
autowire: true
autoconfigure: true
public: true
bind:
$rootDir: '%kernel.root_dir%'
$debug: '%kernel.debug%'
$defaultLocale: '%kernel.default_locale%'
$wallabagUrl: '%env(DOMAIN_NAME)%'
$tablePrefix: "%env(DATABASE_TABLE_PREFIX)%"
$encryptionKeyPath: "%wallabag.site_credentials.encryption_key_path%"
$fetchingErrorMessageTitle: "%wallabag.fetching_error_message_title%"
$fetchingErrorMessage: '%wallabag.fetching_error_message%'
$languages: '%wallabag.languages%'
$lifeTime: '%wallabag.cache_lifetime%'
$cookieFile: "%kernel.cache_dir%/cookiejar.json"
$logoPath: 'public/img/appicon/apple-touch-icon-152.png'
$registrationEnabled: '%env(bool:FOSUSER_REGISTRATION)%'
$restrictedAccess: '@=service(''craue_config'').get(''restricted_access'')'
$senderEmail: "%scheb_two_factor.email.sender_email%"
$senderName: "%scheb_two_factor.email.sender_name%"
$storeArticleHeaders: '@=service(''craue_config'').get(''store_article_headers'')'
$supportUrl: '@=service(''craue_config'').get(''wallabag_support_url'')'
App\:
resource: '../src/'
exclude:
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/DataFixtures/'
- '../src/Kernel.php'
- '../src/Consumer/'
- '../src/Redis/'
- '../src/Event/*Event.php'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller/'
tags: ['controller.service_arguments']
# inject alias service into controllers
App\Controller\Import\ChromeController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_chrome_producer'
$redisProducer: '@wallabag_import.producer.redis.chrome'
App\Controller\Import\DeliciousController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_delicious_producer'
$redisProducer: '@wallabag_import.producer.redis.delicious'
App\Controller\Import\ElcuratorController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_elcurator_producer'
$redisProducer: '@wallabag_import.producer.redis.elcurator'
App\Controller\Import\FirefoxController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_firefox_producer'
$redisProducer: '@wallabag_import.producer.redis.firefox'
App\Controller\Import\InstapaperController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_instapaper_producer'
$redisProducer: '@wallabag_import.producer.redis.instapaper'
App\Controller\Import\PinboardController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_pinboard_producer'
$redisProducer: '@wallabag_import.producer.redis.pinboard'
App\Controller\Import\PocketController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_pocket_producer'
$redisProducer: '@wallabag_import.producer.redis.pocket'
App\Controller\Import\ReadabilityController:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_readability_producer'
$redisProducer: '@wallabag_import.producer.redis.readability'
App\Controller\Import\WallabagV1Controller:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_wallabag_v1_producer'
$redisProducer: '@wallabag_import.producer.redis.wallabag_v1'
App\Controller\Import\WallabagV2Controller:
arguments:
$rabbitMqProducer: '@old_sound_rabbit_mq.import_wallabag_v2_producer'
$redisProducer: '@wallabag_import.producer.redis.wallabag_v2'
Doctrine\DBAL\Connection:
alias: doctrine.dbal.default_connection
Doctrine\ORM\EntityManagerInterface:
alias: doctrine.orm.entity_manager
Doctrine\Persistence\ManagerRegistry:
alias: doctrine
Craue\ConfigBundle\Util\Config:
alias: craue_config
JMS\Serializer\SerializerInterface:
alias: jms_serializer
Lexik\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface:
alias: lexik_form_filter.query_builder_updater
Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface:
alias: scheb_two_factor.security.google_authenticator
Symfony\Component\HttpFoundation\Session\SessionInterface:
alias: session
Symfony\Component\EventDispatcher\EventDispatcherInterface:
alias: event_dispatcher
Symfony\Component\Form\FormFactoryInterface:
alias: form.factory
Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface:
alias: security.token_storage
Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface:
alias: security.authorization_checker
Symfony\Component\Translation\TranslatorInterface:
alias: translator
Symfony\Component\Validator\Validator\ValidatorInterface:
alias: validator
FOS\UserBundle\Model\UserManagerInterface:
alias: fos_user.user_manager
MatomoTwigExtension\MatomoTwigExtension:
public: false
App\Event\Listener\UserLocaleListener:
tags:
- { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin }
craue_config_cache_provider:
class: Symfony\Component\Cache\Adapter\FilesystemAdapter
public: false
arguments:
$namespace: 'craue_config'
$defaultLifetime: 0
$directory: '%kernel.cache_dir%'
App\ParamConverter\UsernameFeedTokenConverter:
tags:
- { name: request.param_converter, converter: username_feed_token_converter }
App\Event\Subscriber\TablePrefixSubscriber:
tags:
- { name: doctrine.event_subscriber }
Graby\Graby:
arguments:
$config:
error_message: '%wallabag.fetching_error_message%'
error_message_title: '%wallabag.fetching_error_message_title%'
calls:
- [ setLogger, [ "@logger" ] ]
tags:
- { name: monolog.logger, channel: graby }
Graby\SiteConfig\ConfigBuilder:
arguments:
$config: {}
wallabag_core.http_client:
alias: 'httplug.client.wallabag_core'
App\GuzzleSiteAuthenticator\GrabySiteConfigBuilder:
tags:
- { name: monolog.logger, channel: graby }
# service alias override
bd_guzzle_site_authenticator.site_config_builder:
alias: App\GuzzleSiteAuthenticator\GrabySiteConfigBuilder
GuzzleHttp\Cookie\CookieJar:
alias: 'App\Helper\FileCookieJar'
App\Helper\HttpClientFactory:
calls:
- ["addSubscriber", ["@bd_guzzle_site_authenticator.authenticator_subscriber"]]
RulerZ\RulerZ:
alias: rulerz
App\Operator\PHP\Matches:
tags:
- { name: rulerz.operator, target: native, operator: matches }
App\Operator\Doctrine\Matches:
tags:
- { name: rulerz.operator, target: doctrine, operator: matches, inline: true }
App\Operator\PHP\NotMatches:
tags:
- { name: rulerz.operator, target: native, operator: notmatches }
App\Operator\Doctrine\NotMatches:
tags:
- { name: rulerz.operator, target: doctrine, operator: notmatches, inline: true }
App\Operator\PHP\PatternMatches:
tags:
- { name: rulerz.operator, target: native, operator: "~" }
Predis\Client:
arguments:
$parameters:
scheme: '%env(REDIS_SCHEME)%'
host: '%env(REDIS_HOST)%'
port: '%env(REDIS_PORT)%'
path: '%env(REDIS_PATH)%'
password: '%env(REDIS_PASSWORD)%'
App\Event\Subscriber\SQLiteCascadeDeleteSubscriber:
tags:
- { name: doctrine.event_subscriber }
App\Event\Subscriber\DownloadImagesSubscriber:
arguments:
$enabled: '@=service(''craue_config'').get(''download_images_enabled'')'
App\Helper\DownloadImages:
arguments:
$baseFolder: "%kernel.project_dir%/public/assets/images"
App\Command\ExportCommand:
arguments:
$projectDir: '%kernel.project_dir%'
App\Command\InstallCommand:
arguments:
$defaultSettings: '%wallabag.default_internal_settings%'
$defaultIgnoreOriginInstanceRules: '%wallabag.default_ignore_origin_instance_rules%'
wallabag_core.entry.download_images.client:
alias: 'httplug.client.wallabag_core.entry.download_images'
App\Mailer\UserMailer:
arguments:
$parameters:
template:
confirmation: '%fos_user.registration.confirmation.template%'
resetting: '%fos_user.resetting.email.template%'
from_email:
confirmation: '%fos_user.registration.confirmation.from_email%'
resetting: '%fos_user.resetting.email.from_email%'
App\EventListener\CreateConfigListener:
arguments:
$itemsOnPage: "%wallabag.items_on_page%"
$feedLimit: "%wallabag.feed_limit%"
$language: "%wallabag.language%"
$readingSpeed: "%wallabag.reading_speed%"
$actionMarkAsRead: "%wallabag.action_mark_as_read%"
$listMode: "%wallabag.list_mode%"
$displayThumbnails: "%wallabag.display_thumbnails%"
App\EventListener\AuthenticationFailureListener:
tags:
- { name: kernel.event_listener, event: security.authentication.failure, method: onAuthenticationFailure }
wallabag_import.pocket.client:
alias: 'httplug.client.wallabag_import.pocket.client'
App\Import\PocketImport:
calls:
- [ setClient, [ "@wallabag_import.pocket.client" ] ]
tags:
- { name: wallabag_import.import, alias: pocket }
App\Import\WallabagV1Import:
tags:
- { name: wallabag_import.import, alias: wallabag_v1 }
App\Import\WallabagV2Import:
tags:
- { name: wallabag_import.import, alias: wallabag_v2 }
App\Import\ElcuratorImport:
tags:
- { name: wallabag_import.import, alias: elcurator }
App\Import\ReadabilityImport:
tags:
- { name: wallabag_import.import, alias: readability }
App\Import\InstapaperImport:
tags:
- { name: wallabag_import.import, alias: instapaper }
App\Import\PinboardImport:
tags:
- { name: wallabag_import.import, alias: pinboard }
App\Import\DeliciousImport:
tags:
- { name: wallabag_import.import, alias: delicious }
App\Import\FirefoxImport:
tags:
- { name: wallabag_import.import, alias: firefox }
App\Import\ChromeImport:
tags:
- { name: wallabag_import.import, alias: chrome }
# to factorize the proximity and bypass translation for prev & next
pagerfanta.view.default_wallabag:
class: Pagerfanta\View\OptionableView
arguments:
- '@pagerfanta.view.twitter_bootstrap'
- { proximity: 1, prev_message: "<", next_message: ">" }
public: false
tags:
- { name: pagerfanta.view, alias: default_wallabag }

View File

@ -0,0 +1,70 @@
# RabbitMQ stuff
services:
_defaults:
autowire: true
autoconfigure: true
public: true
App\Consumer\RabbitMQConsumerTotalProxy:
lazy: true
arguments:
$pocketConsumer: '@old_sound_rabbit_mq.import_pocket_consumer'
$readabilityConsumer: '@old_sound_rabbit_mq.import_readability_consumer'
$wallabagV1Consumer: '@old_sound_rabbit_mq.import_wallabag_v1_consumer'
$wallabagV2Consumer: '@old_sound_rabbit_mq.import_wallabag_v2_consumer'
$firefoxConsumer: '@old_sound_rabbit_mq.import_firefox_consumer'
$chromeConsumer: '@old_sound_rabbit_mq.import_chrome_consumer'
$instapaperConsumer: '@old_sound_rabbit_mq.import_instapaper_consumer'
$pinboardConsumer: '@old_sound_rabbit_mq.import_pinboard_consumer'
$deliciousConsumer: '@old_sound_rabbit_mq.import_delicious_consumer'
$elcuratorConsumer: '@old_sound_rabbit_mq.import_elcurator_consumer'
wallabag_import.consumer.amqp.pocket:
class: App\Consumer\AMQPEntryConsumer
arguments:
$import: '@App\Import\PocketImport'
wallabag_import.consumer.amqp.readability:
class: App\Consumer\AMQPEntryConsumer
arguments:
$import: '@App\Import\ReadabilityImport'
wallabag_import.consumer.amqp.instapaper:
class: App\Consumer\AMQPEntryConsumer
arguments:
$import: '@App\Import\InstapaperImport'
wallabag_import.consumer.amqp.pinboard:
class: App\Consumer\AMQPEntryConsumer
arguments:
$import: '@App\Import\PinboardImport'
wallabag_import.consumer.amqp.delicious:
class: App\Consumer\AMQPEntryConsumer
arguments:
$import: '@App\Import\DeliciousImport'
wallabag_import.consumer.amqp.wallabag_v1:
class: App\Consumer\AMQPEntryConsumer
arguments:
$import: '@App\Import\WallabagV1Import'
wallabag_import.consumer.amqp.wallabag_v2:
class: App\Consumer\AMQPEntryConsumer
arguments:
$import: '@App\Import\WallabagV2Import'
wallabag_import.consumer.amqp.elcurator:
class: App\Consumer\AMQPEntryConsumer
arguments:
$import: '@App\Import\ElcuratorImport'
wallabag_import.consumer.amqp.firefox:
class: App\Consumer\AMQPEntryConsumer
arguments:
$import: '@App\Import\FirefoxImport'
wallabag_import.consumer.amqp.chrome:
class: App\Consumer\AMQPEntryConsumer
arguments:
$import: '@App\Import\ChromeImport'

166
config/services_redis.yaml Normal file
View File

@ -0,0 +1,166 @@
# Redis stuff
services:
_defaults:
autowire: true
autoconfigure: true
public: true
# readability
wallabag_import.queue.redis.readability:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.readability"
wallabag_import.producer.redis.readability:
class: App\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.readability"
wallabag_import.consumer.redis.readability:
class: App\Consumer\RedisEntryConsumer
arguments:
$import: '@App\Import\ReadabilityImport'
# instapaper
wallabag_import.queue.redis.instapaper:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.instapaper"
wallabag_import.producer.redis.instapaper:
class: App\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.instapaper"
wallabag_import.consumer.redis.instapaper:
class: App\Consumer\RedisEntryConsumer
arguments:
$import: '@App\Import\InstapaperImport'
# pinboard
wallabag_import.queue.redis.pinboard:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.pinboard"
wallabag_import.producer.redis.pinboard:
class: App\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.pinboard"
wallabag_import.consumer.redis.pinboard:
class: App\Consumer\RedisEntryConsumer
arguments:
$import: '@App\Import\PinboardImport'
# delicious
wallabag_import.queue.redis.delicious:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.delicious"
wallabag_import.producer.redis.delicious:
class: App\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.delicious"
wallabag_import.consumer.redis.delicious:
class: App\Consumer\RedisEntryConsumer
arguments:
$import: '@App\Import\DeliciousImport'
# pocket
wallabag_import.queue.redis.pocket:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.pocket"
wallabag_import.producer.redis.pocket:
class: App\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.pocket"
wallabag_import.consumer.redis.pocket:
class: App\Consumer\RedisEntryConsumer
arguments:
$import: '@App\Import\PocketImport'
# wallabag v1
wallabag_import.queue.redis.wallabag_v1:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.wallabag_v1"
wallabag_import.producer.redis.wallabag_v1:
class: App\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.wallabag_v1"
wallabag_import.consumer.redis.wallabag_v1:
class: App\Consumer\RedisEntryConsumer
arguments:
$import: '@App\Import\WallabagV1Import'
# wallabag v2
wallabag_import.queue.redis.wallabag_v2:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.wallabag_v2"
wallabag_import.producer.redis.wallabag_v2:
class: App\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.wallabag_v2"
wallabag_import.consumer.redis.wallabag_v2:
class: App\Consumer\RedisEntryConsumer
arguments:
$import: '@App\Import\WallabagV2Import'
# elcurator
wallabag_import.queue.redis.elcurator:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.elcurator"
wallabag_import.producer.redis.elcurator:
class: App\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.elcurator"
wallabag_import.consumer.redis.elcurator:
class: App\Consumer\RedisEntryConsumer
arguments:
$import: '@App\Import\ElcuratorImport'
# firefox
wallabag_import.queue.redis.firefox:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.firefox"
wallabag_import.producer.redis.firefox:
class: App\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.firefox"
wallabag_import.consumer.redis.firefox:
class: App\Consumer\RedisEntryConsumer
arguments:
$import: '@App\Import\FirefoxImport'
# chrome
wallabag_import.queue.redis.chrome:
class: Simpleue\Queue\RedisQueue
arguments:
$queueName: "wallabag.import.chrome"
wallabag_import.producer.redis.chrome:
class: App\Redis\Producer
arguments:
- "@wallabag_import.queue.redis.chrome"
wallabag_import.consumer.redis.chrome:
class: App\Consumer\RedisEntryConsumer
arguments:
$import: '@App\Import\ChromeImport'

32
config/services_test.yaml Normal file
View File

@ -0,0 +1,32 @@
parameters:
test_database_path: "%env(TEST_DATABASE_PATH)%"
env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite"
services:
# see https://github.com/symfony/symfony/issues/24543
fos_user.user_manager.test:
alias: fos_user.user_manager
public: true
fos_user.security.login_manager.test:
alias: fos_user.security.login_manager
public: true
wallabag_core.entry_repository.test:
alias: App\Repository\EntryRepository
public: true
wallabag_user.user_repository.test:
alias: App\Repository\UserRepository
public: true
filesystem_cache:
class: Doctrine\Common\Cache\FilesystemCache
arguments:
- "%kernel.cache_dir%/doctrine/metadata"
# fixtures
App\DataFixtures\:
resource: '../src/DataFixtures/*'
tags: ['doctrine.fixture.orm']
autowire: true

171
config/wallabag.yaml Normal file
View File

@ -0,0 +1,171 @@
wallabag_core:
version: 2.6.2
paypal_url: "https://liberapay.com/wallabag/donate"
languages:
en: 'English'
fr: 'Français'
de: 'Deutsch'
nl: 'Dutch'
th: 'ไทย'
tr: 'Türkçe'
fa: 'فارسی'
ro: 'Română'
pl: 'Polish'
da: 'Dansk'
es: 'Español'
oc: 'Occitan'
it: 'Italiano'
pt: 'Português'
ru: 'Русский'
ja: '日本語'
zh: '简体中文'
uk: 'Українська'
hr: 'Hrvatski'
cs: 'Čeština'
el: 'Ελληνικά'
items_on_page: 12
language: '%env(LOCALE)%'
rss_limit: 50
reading_speed: 200
cache_lifetime: 10
action_mark_as_read: 1
list_mode: 0
display_thumbnails: 1
fetching_error_message_title: 'No title found'
fetching_error_message: |
wallabag can't retrieve contents for this article. Please <a href="https://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>.
api_limit_mass_actions: 10
encryption_key_path: "%kernel.project_dir%/data/site-credentials-secret-key.txt"
default_internal_settings:
-
name: share_public
value: 1
section: entry
-
name: share_diaspora
value: 1
section: entry
-
name: diaspora_url
value: https://diasporapod.com
section: entry
-
name: share_unmark
value: 1
section: entry
-
name: unmark_url
value: https://unmark.it
section: entry
-
name: share_shaarli
value: 1
section: entry
-
name: shaarli_url
value: https://myshaarli.com
section: entry
-
name: share_mail
value: 1
section: entry
-
name: share_twitter
value: 1
section: entry
-
name: show_printlink
value: 1
section: entry
-
name: restricted_access
value: 0
section: entry
-
name: export_epub
value: 1
section: export
-
name: export_mobi
value: 0
section: export
-
name: export_pdf
value: 1
section: export
-
name: export_csv
value: 1
section: export
-
name: export_json
value: 1
section: export
-
name: export_txt
value: 1
section: export
-
name: export_xml
value: 1
section: export
-
name: import_with_redis
value: 0
section: import
-
name: import_with_rabbitmq
value: 0
section: import
-
name: matomo_enabled
value: 0
section: analytics
-
name: matomo_host
value: matomo.wallabag.org
section: analytics
-
name: matomo_site_id
value: 1
section: analytics
-
name: demo_mode_enabled
value: 0
section: misc
-
name: demo_mode_username
value: wallabag
section: misc
-
name: download_images_enabled
value: 0
section: misc
-
name: wallabag_support_url
value: https://www.wallabag.org/pages/support.html
section: misc
-
name: api_user_registration
value: 0
section: api
-
name: store_article_headers
value: 0
section: entry
-
name: shaarli_share_origin_url
value: 0
section: entry
default_ignore_origin_instance_rules:
-
rule: host = "feedproxy.google.com"
-
rule: host = "feeds.reuters.com"
-
rule: _all ~ "https?://www\.lemonde\.fr/tiny.*"
import:
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv']
resource_dir: "%kernel.project_dir%/web/uploads/import"