Browse Source

Rename variable

pull/274/head
James Cole 3 years ago
parent
commit
cb17f18c1a
No known key found for this signature in database GPG Key ID: B49A324B7EAD6D80
  1. 2
      .ci/.env.ci
  2. 2
      .env.example
  3. 2
      app/Console/Commands/AutoImport.php
  4. 4
      app/Console/Commands/Import.php
  5. 4
      app/Console/HaveAccess.php
  6. 2
      config/importer.php

2
.ci/.env.ci

@ -108,7 +108,7 @@ CAN_POST_FILES=false
#
# This variable can be set from a file if you append it with _FILE
#
IMPORT_DIR_WHITELIST=
IMPORT_DIR_ALLOWLIST=
#
# When you're running Firefly III under a (self-signed) certificate,

2
.env.example

@ -114,7 +114,7 @@ CAN_POST_FILES=false
#
# This variable can be set from a file if you append it with _FILE
#
IMPORT_DIR_WHITELIST=
IMPORT_DIR_ALLOWLIST=
#
# When you're running Firefly III under a (self-signed) certificate,

2
app/Console/Commands/AutoImport.php

@ -69,7 +69,7 @@ class AutoImport extends Command
$argument = (string)($this->argument('directory') ?? './');
$directory = realpath($argument);
if (!$this->isAllowedPath($directory)) {
$this->error(sprintf('Path "%s" is not in the list of allowed paths (IMPORT_DIR_WHITELIST).', $directory));
$this->error(sprintf('Path "%s" is not in the list of allowed paths (IMPORT_DIR_ALLOWLIST).', $directory));
return 1;
}

4
app/Console/Commands/Import.php

@ -81,7 +81,7 @@ class Import extends Command
if ('' !== $config) {
$directory = dirname($config);
if (!$this->isAllowedPath($directory)) {
$this->error(sprintf('Path "%s" is not in the list of allowed paths (IMPORT_DIR_WHITELIST).', $directory));
$this->error(sprintf('Path "%s" is not in the list of allowed paths (IMPORT_DIR_ALLOWLIST).', $directory));
return 1;
}
@ -89,7 +89,7 @@ class Import extends Command
if ('' !== $file) {
$directory = dirname($file);
if (!$this->isAllowedPath($directory)) {
$this->error(sprintf('Path "%s" is not in the list of allowed paths (IMPORT_DIR_WHITELIST).', $directory));
$this->error(sprintf('Path "%s" is not in the list of allowed paths (IMPORT_DIR_ALLOWLIST).', $directory));
return 1;
}

4
app/Console/HaveAccess.php

@ -70,8 +70,8 @@ trait HaveAccess
*/
private function isAllowedPath(string $path): bool
{
$error = 'No valid paths in IMPORT_DIR_WHITELIST, cannot continue.';
$paths = config('importer.import_dir_whitelist');
$error = 'No valid paths in IMPORT_DIR_ALLOWLIST, cannot continue.';
$paths = config('importer.IMPORT_DIR_ALLOWLIST');
if (null === $paths) {
$this->warn($error);

2
config/importer.php

@ -30,7 +30,7 @@ return [
'nordigen' => 'Nordigen',
'spectre' => 'Spectre',
],
'import_dir_whitelist' => explode(',', env('IMPORT_DIR_WHITELIST', '')),
'import_dir_allowlist' => explode(',', env('IMPORT_DIR_ALLOWLIST', '')),
'auto_import_secret' => env('AUTO_IMPORT_SECRET', ''),
'can_post_autoimport' => env('CAN_POST_AUTOIMPORT', false),
'can_post_files' => env('CAN_POST_FILES', false),

Loading…
Cancel
Save