Skip to content

Commit

Permalink
Improve config options (LycheeOrg#1366)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty287 committed Sep 9, 2022
1 parent 60cb9f2 commit 0f1fab9
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 152 deletions.
14 changes: 0 additions & 14 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ APP_URL=http://localhost
# enable or disable debug bar. By default it is disabled.
DEBUGBAR_ENABLED=false

LOG_CHANNEL=stack

##############################################################################
# IMPORTANT: To migrate from Lychee v3 you *MUST* use the same MySQL/MariaDB #
# server as v3. #
Expand Down Expand Up @@ -60,18 +58,14 @@ DB_LOG_SQL=false
# LYCHEE_IMAGE_VISIBILITY=public

# folders in which the files will be stored
# LYCHEE_DIST="/var/www/html/Lychee-Laravel/public/dist/"
# LYCHEE_UPLOADS="/var/www/html/Lychee-Laravel/public/uploads/"

# url to access those files
# LYCHEE_DIST_URL="dist/"
# LYCHEE_UPLOADS_URL="uploads/"

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

SECURITY_HEADER_HSTS_ENABLE=false
SESSION_SECURE_COOKIE=false
Expand All @@ -89,14 +83,6 @@ MAIL_ENCRYPTION=
MAIL_FROM_NAME=
MAIL_FROM_ADDRESS=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

# The trusted proxies if Lychee is behind a reverse proxy
# Accepted values:
# - `null`: no proxy
Expand Down
12 changes: 0 additions & 12 deletions .env.homestead
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ DB_OLD_LYCHEE_PREFIX=
TIMEZONE=UTC

# folders in which the files will be stored
# LYCHEE_DIST="/var/www/html/Lychee-Laravel/public/dist/"
# LYCHEE_UPLOADS="/var/www/html/Lychee-Laravel/public/uploads/"

# url to access those files
# LYCHEE_DIST_URL="dist/"
# LYCHEE_UPLOADS_URL="uploads/"

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

SECURITY_HEADER_HSTS_ENABLE=false

Expand All @@ -47,14 +43,6 @@ MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

# The trusted proxies if Lychee is behind a reverse proxy
# Accepted values:
# - `null`: no proxy
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)

Copyright (c) 2017-2018 Tobias Reich
Copyright (c) 2018-2020 LycheeOrg
Copyright (c) 2018-2022 LycheeOrg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 13 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
{
"name": "lycheeorg/lychee-laravel",
"name": "lychee-org/lychee",
"description": "A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.",
"homepage": "https://lycheeorg.github.io/",
"readme": "readme.md",
"support": {
"source": "https://github.com/LycheeOrg/Lychee",
"issues": "https://github.com/LycheeOrg/Lychee/issues",
"docs": "https://lycheeorg.github.io/docs/",
"chat": "https://gitter.im/LycheeOrg/Lobby"
},
"keywords": [
"framework",
"laravel"
"photos",
"gallery",
"photo management",
"album software",
"image organizer"
],
"repositories": [
{
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

'url' => env('APP_URL', 'http://localhost'),

'asset_url' => env('ASSET_URL'),
'asset_url' => null,

/*
|--------------------------------------------------------------------------
Expand Down
7 changes: 2 additions & 5 deletions config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'connection' => env('DB_CONNECTION'),
],

'file' => [
Expand All @@ -58,9 +58,6 @@
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
Expand Down Expand Up @@ -98,6 +95,6 @@

'prefix' => env(
'CACHE_PREFIX',
Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'
Str::slug(env('APP_NAME', 'Lychee'), '_') . '_cache'
),
];
6 changes: 3 additions & 3 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'foreign_key_constraints' => true,
],

'mysql' => [
Expand Down Expand Up @@ -162,11 +162,11 @@
*/

'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'client' => 'phpredis',

'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'Lychee'), '_') . '_database_'),
],

'default' => [
Expand Down
18 changes: 9 additions & 9 deletions config/debugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,26 +135,26 @@

'options' => [
'auth' => [
'show_name' => true, // Also show the users name/email in the debugbar
'show_name' => true, // Also show the users name/email in the debugbar
],
'db' => [
'with_params' => true, // Render SQL with the parameters substituted
'backtrace' => true, // Use a backtrace to find the origin of the query in your files.
'timeline' => false, // Add the queries to the timeline
'explain' => [ // Show EXPLAIN output on queries
'with_params' => true, // Render SQL with the parameters substituted
'backtrace' => true, // Use a backtrace to find the origin of the query in your files.
'timeline' => false, // Add the queries to the timeline
'explain' => [ // Show EXPLAIN output on queries
'enabled' => false,
'types' => ['SELECT'], // // workaround ['SELECT'] only. https://github.com/barryvdh/laravel-debugbar/issues/888 ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
'types' => ['SELECT'], // workaround ['SELECT'] only. https://github.com/barryvdh/laravel-debugbar/issues/888 ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
],
'hints' => true, // Show hints for common mistakes
'hints' => true, // Show hints for common mistakes
],
'mail' => [
'full_log' => false,
],
'views' => [
'data' => false, //Note: Can slow down the application, because the data can be quite large..
'data' => false, // Note: Can slow down the application, because the data can be quite large..
],
'route' => [
'label' => true, // show complete route on bar
'label' => true, // show complete route on bar
],
'logs' => [
'file' => null,
Expand Down
23 changes: 4 additions & 19 deletions config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
|
*/

'default' => env('FILESYSTEM_DRIVER', 'images'),
'default' => 'images',

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -69,7 +69,7 @@
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
Expand All @@ -80,8 +80,8 @@
// TODO: Maybe we should drop this Flysystem disk, because neither the driver nor the root must be changed and hence the whole point of using the Flysystem abstraction is gone.
'dist' => [
'driver' => 'local',
'root' => env('LYCHEE_DIST', public_path('dist/')),
'url' => env('LYCHEE_DIST_URL', 'dist/'),
'root' => public_path('dist/'),
'url' => 'dist/',
'visibility' => 'public',
],

Expand All @@ -97,19 +97,4 @@
'visibility' => 'public',
],
],

/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/

'links' => [
public_path('storage') => storage_path('app/public'),
],
];
8 changes: 4 additions & 4 deletions config/hashing.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
|
*/

'driver' => 'bcrypt',
'driver' => env('HASHING_ALGORITHM', 'bcrypt'),

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -43,8 +43,8 @@
*/

'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
'memory' => env('ARGON_MEMORY', 1024),
'threads' => env('ARGON_THREADS', 2),
'time' => env('ARGON_TIME', 2),
],
];
69 changes: 2 additions & 67 deletions config/logging.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?php

use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;

return [
/*
|--------------------------------------------------------------------------
Expand All @@ -16,7 +12,7 @@
|
*/

'default' => env('LOG_CHANNEL', 'stack'),
'default' => 'log',

/*
|--------------------------------------------------------------------------
Expand All @@ -34,68 +30,7 @@
*/

'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
],

'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],

'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 14,
],

'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
],

'papertrail' => [
'driver' => 'monolog',
'level' => 'debug',
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
],

'stderr' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
],

'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
],

'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
],

'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],

'emergency' => [
'log' => [
'path' => storage_path('logs/laravel.log'),
],
],
Expand Down
11 changes: 3 additions & 8 deletions config/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'host' => env('MAIL_HOST'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
Expand All @@ -61,11 +61,6 @@
'path' => '/usr/sbin/sendmail -bs',
],

'log' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL'),
],

'array' => [
'transport' => 'array',
],
Expand All @@ -83,8 +78,8 @@
*/

'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
'address' => env('MAIL_FROM_ADDRESS'),
'name' => env('MAIL_FROM_NAME', env('APP_NAME', 'Lychee')),
],

/*
Expand Down
Loading

0 comments on commit 0f1fab9

Please sign in to comment.