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

Improve config options #1366

Merged
merged 24 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fd71ede
Update and improve some configs
qwerty287 Jun 11, 2022
0281839
Improve some defaults
qwerty287 Jun 11, 2022
55a0977
Merge branch 'master' into rework-configs
qwerty287 Jun 11, 2022
3771d88
Suggest `phpredis` ext
qwerty287 Jun 11, 2022
7cca708
Restore db cache driver
qwerty287 Jun 11, 2022
8c0e4de
Update example env
qwerty287 Jun 11, 2022
8c8b181
Clean up gitignore
qwerty287 Jun 11, 2022
fdd1521
Add DB options back
qwerty287 Jun 12, 2022
b59537f
Remove composer suggestion
qwerty287 Jun 12, 2022
40c1f79
Add debugbar comments back
qwerty287 Jun 12, 2022
00e41d2
Update composer name and add support opts
qwerty287 Jun 12, 2022
07771f8
Use spaces instead of tabs for composer.json
qwerty287 Jun 12, 2022
be71c61
Update keywords
qwerty287 Jun 13, 2022
7bf1ad6
Update copyright year
qwerty287 Jun 13, 2022
c6cec23
Merge remote-tracking branch 'origin/master' into rework-configs
qwerty287 Jun 29, 2022
fd3d053
Set `null` as value
qwerty287 Jul 3, 2022
3c6878b
Merge branch 'master' into rework-configs
qwerty287 Jul 18, 2022
4c82360
Merge remote-tracking branch 'origin/master' into rework-configs
qwerty287 Aug 2, 2022
cca95af
Merge remote-tracking branch 'origin/master' into rework-configs
qwerty287 Aug 25, 2022
cbeeda0
Reset frontend
qwerty287 Aug 25, 2022
5853686
Add opt back that's required for tests
qwerty287 Aug 25, 2022
bd1c7ab
Revert session option
qwerty287 Aug 30, 2022
6b53e91
Merge remote-tracking branch 'origin/master' into rework-configs
qwerty287 Aug 30, 2022
3b26ba0
use `lychee-org`
qwerty287 Sep 8, 2022
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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ trim_trailing_whitespace = false
[*.js]
indent_style = tab
indent_size = 4

[composer.json]
indent_style = space
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 @@ -36,18 +34,14 @@ DB_LOG_SQL=false
# TIMEZONE=Europe/Paris

# 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 @@ -65,14 +59,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
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
public/Lychee-front/node_modules/
public/Lychee-front/package-lock.json

public/Lychee-front/node_modules/
public/Lychee-front/bower_components/
public/Lychee-front/package-lock.json

qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
public/uploads/big/*
public/uploads/import/*
public/uploads/medium/*
Expand Down
19 changes: 14 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
{
"name": "lycheeorg/lychee-laravel",
"name": "lycheeorg/lychee",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just something which came to my mind again. The Github URL is LycheeOrg/Lychee with three capital letters. I don't know if this is relevant for anything at all or in case "something" interprets this entry, that "something" does so in a case-sensitive manner.

Anyway, I just re-remembered that we are astonishingly inconsistent about our capitalization: not only here, but also in the frontend, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we ignore it or should I update it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go for lychee-org/lychee because our other packages on packagist.org are under that common name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fairly common for package names etc to be lower case while the project itself has capitalisation. By no means universal, but common. Especially with package managers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"name": "lycheeorg/lychee",
"name": "lychee-org/lychee",

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @ildyria was. That's another inconsistency we have and when I spotted it, it had been to late.

I guess we all agree that it would be awesome to use the same spelling of "Lychee Org" everywhere, i.e. here on Github and on Packagist. I don't know if it is possible to rename our packages and create some kind of "redirection" on Packagist from the old name to the new name such that we don't break any dependencies.

Copy link
Member

@ildyria ildyria Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    "require": {
        "php": "^8.0",
        "ext-bcmath": "*",
        "ext-ctype": "*",
        "ext-exif": "*",
        "ext-fileinfo": "*",
        "ext-gd": "*",
        "ext-json": "*",
        "ext-mbstring": "*",
        "ext-openssl": "*",
        "ext-pdo": "*",
        "ext-tokenizer": "*",
        "ext-xml": "*",
        "bepsvpt/secure-headers": "^7.1",
        "darkghosthunter/larapass": "dev-LycheeSpecial",
        "doctrine/dbal": "^3.1",
        "fideloper/proxy": "^4.3",
        "geocoder-php/cache-provider": "^4.3",
        "geocoder-php/nominatim-provider": "^5.5",
        "laravel/framework": "^8.83.14",
        "livewire/livewire": "^2.7",
        "lychee-org/nestedset": "^6",
        "lychee-org/php-exif": "^0.7.11",
        "maennchen/zipstream-php": "^2.1",
        "php-ffmpeg/php-ffmpeg": "^1.0",
        "php-http/guzzle7-adapter": "^1.0",
        "php-http/message": "^1.12",
        "spatie/guzzle-rate-limiter-middleware": "^2.0",
        "spatie/laravel-feed": "^4.0",
        "spatie/laravel-image-optimizer": "^1.6.2",
        "symfony/cache": "^v6.0.0",
        "whichbrowser/parser": "^2.0"
    },
    "require-dev": {
        "ext-imagick": "*",
        "ext-posix": "*",
        "ext-zip": "*",
        "barryvdh/laravel-debugbar": "^3.6",
        "barryvdh/laravel-ide-helper": "^2.10",
        "filp/whoops": "^2.5",
        "friendsofphp/php-cs-fixer": "^3.3",
        "itsgoingd/clockwork": "^5.0",
        "laravel/homestead": "^v13.2.1",
        "lychee-org/phpstan-lychee": "dev-master",
        "mockery/mockery": "^1.5",
        "nunomaduro/collision": "^5.0",
        "nunomaduro/larastan": "^1.0",
        "php-parallel-lint/php-parallel-lint": "^1.3",
        "phpunit/phpunit": "^9"
    },

camelCase does not seem standard there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we take example on https://github.com/FriendsOfPHP it should be "lycheeorg"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just curious :). I'm slightly in favour of lycheeorg but it's not a major issue for me.

FWIW, we're lycheeorg on Docker Hub. That one was probably me.

Copy link
Contributor

@d7415 d7415 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found in a SO post: composer/packagist#47

Which raises the question of why it was working in the first place.

Answer: Because the packages we publish are in lychee-org form https://github.com/LycheeOrg/laravel-nestedset/blob/v6/composer.json#L2

So I'd use lychee-org for now until/unless we want to change properly.

"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"
],
qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
"repositories": [{
"type": "vcs",
"url": "https://github.com/LycheeOrg/Larapass"
}],
"repositories": [
{
"type": "vcs",
"url": "https://github.com/LycheeOrg/Larapass"
}
],
"license": "MIT",
"type": "project",
"require": {
Expand Down
2 changes: 0 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@

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

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

qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
/*
|--------------------------------------------------------------------------
| Application Timezone
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'
qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
),
];
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),
qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
'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_'),
qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
],

'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 @@ -57,7 +57,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'),
qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
Expand All @@ -68,8 +68,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' => [
qwerty287 marked this conversation as resolved.
Show resolved Hide resolved
'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 @@ -85,19 +85,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
Loading