Skip to content

Commit

Permalink
Migrate dev-specific configuration to env vars via .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Oct 16, 2024
1 parent aef04af commit bf836ff
Show file tree
Hide file tree
Showing 101 changed files with 475 additions and 543 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ docker-compose.override.yml
.phpunit.result.cache
docs/swagger/swagger-inlined.json
phpcov*
shlink-dev.local.env
20 changes: 0 additions & 20 deletions config/autoload/delete_short_urls.global.php

This file was deleted.

46 changes: 0 additions & 46 deletions config/autoload/entity-manager.local.php.dist

This file was deleted.

16 changes: 0 additions & 16 deletions config/autoload/matomo.global.php

This file was deleted.

26 changes: 0 additions & 26 deletions config/autoload/matomo.local.php.dist

This file was deleted.

47 changes: 22 additions & 25 deletions config/autoload/mercure.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,31 @@
use Symfony\Component\Mercure\Hub;
use Symfony\Component\Mercure\HubInterface;

return (static function (): array {
$publicUrl = EnvVars::MERCURE_PUBLIC_HUB_URL->loadFromEnv();
return [

return [
// This config is used by shlink-common. Do not delete
'mercure' => [
'public_hub_url' => EnvVars::MERCURE_PUBLIC_HUB_URL->loadFromEnv(),
'internal_hub_url' => EnvVars::MERCURE_INTERNAL_HUB_URL->loadFromEnv(),
'jwt_secret' => EnvVars::MERCURE_JWT_SECRET->loadFromEnv(),
'jwt_issuer' => 'Shlink',
],

'mercure' => [
'public_hub_url' => $publicUrl,
'internal_hub_url' => EnvVars::MERCURE_INTERNAL_HUB_URL->loadFromEnv(),
'jwt_secret' => EnvVars::MERCURE_JWT_SECRET->loadFromEnv(),
'jwt_issuer' => 'Shlink',
],

'dependencies' => [
'delegators' => [
LcobucciJwtProvider::class => [
LazyServiceFactory::class,
],
Hub::class => [
LazyServiceFactory::class,
],
'dependencies' => [
'delegators' => [
LcobucciJwtProvider::class => [
LazyServiceFactory::class,
],
'lazy_services' => [
'class_map' => [
LcobucciJwtProvider::class => LcobucciJwtProvider::class,
Hub::class => HubInterface::class,
],
Hub::class => [
LazyServiceFactory::class,
],
],
'lazy_services' => [
'class_map' => [
LcobucciJwtProvider::class => LcobucciJwtProvider::class,
Hub::class => HubInterface::class,
],
],
],

];
})();
];
13 changes: 0 additions & 13 deletions config/autoload/mercure.local.php.dist

This file was deleted.

21 changes: 0 additions & 21 deletions config/autoload/qr-codes.global.php

This file was deleted.

1 change: 1 addition & 0 deletions config/autoload/rabbit.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

return [

// This config is used by shlink-common. Do not delete
'rabbitmq' => [
'enabled' => (bool) EnvVars::RABBITMQ_ENABLED->loadFromEnv(),
'host' => EnvVars::RABBITMQ_HOST->loadFromEnv(),
Expand Down
15 changes: 0 additions & 15 deletions config/autoload/rabbit.local.php.dist

This file was deleted.

20 changes: 0 additions & 20 deletions config/autoload/redirects.global.php

This file was deleted.

26 changes: 0 additions & 26 deletions config/autoload/redis.local.php.local

This file was deleted.

14 changes: 0 additions & 14 deletions config/autoload/robots.global.php

This file was deleted.

1 change: 0 additions & 1 deletion config/autoload/router.local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use Mezzio\Router\FastRouteRouter;
return [

'router' => [
// 'base_path' => '',
'fastroute' => [
FastRouteRouter::CONFIG_CACHE_ENABLED => false,
],
Expand Down
38 changes: 0 additions & 38 deletions config/autoload/tracking.global.php

This file was deleted.

21 changes: 0 additions & 21 deletions config/autoload/url-shortener.local.php.dist

This file was deleted.

12 changes: 10 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ services:
- shlink_rabbitmq
- shlink_matomo
environment:
LC_ALL: C
DEFAULT_DOMAIN: localhost:8000
env_file:
- path: shlink-dev.env
- path: shlink-dev.local.env
required: false
extra_hosts:
- 'host.docker.internal:host-gateway'

Expand All @@ -59,7 +63,11 @@ services:
- shlink_rabbitmq
- shlink_matomo
environment:
LC_ALL: C
DEFAULT_DOMAIN: localhost:8800
env_file:
- path: shlink-dev.env
- path: shlink-dev.local.env
required: false
extra_hosts:
- 'host.docker.internal:host-gateway'

Expand Down
Loading

0 comments on commit bf836ff

Please sign in to comment.