Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
V8.0.0 (#1414)
Browse files Browse the repository at this point in the history
* Redirect to correct endpoint for app

* Redirect to admin based on relative url (works in sub-folder)

* Update request / reset password to be all app based

* Add trailing slash to admin redirect

* Add project key to reset password

* Restrict private and _ project from listing (#1415)

* Restrict private files from listing

* Return the filename instead of projectname from scan funciton

* Add a validation of boolean to private flag.

* Add redirect_url param

* update settings seeder to contain all default options

* public role description

* relations alpha order

* Fix false positive in sso 2fa block

* add enforce_2fa to roles

* activity seeder updates

icons and widths

* seeder for directus files

need to check “description” options array format
  • Loading branch information
rijkvanzanten committed Nov 12, 2019
1 parent bfdfa49 commit e0630e8
Show file tree
Hide file tree
Showing 11 changed files with 160 additions and 126 deletions.
4 changes: 4 additions & 0 deletions migrations/db/schemas/20180220023217_create_roles_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public function change()
'null' => true,
'default' => null
]);
$table->addColumn('enforce_2fa', 'boolean', [
'null' => true,
'default' => false
]);

$table->addIndex('name', [
'unique' => true,
Expand Down
103 changes: 65 additions & 38 deletions migrations/db/seeds/FieldsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,22 @@ public function run()
'field' => 'action',
'type' => \Directus\Database\Schema\DataTypes::TYPE_STRING,
'interface' => 'activity-icon',
'options' => json_encode([
'iconRight' => 'change_history'
]),
'locked' => 1,
'readonly' => 1,
'sort' => 1
'sort' => 1,
'width' => 'full'
],
[
'collection' => 'directus_activity',
'field' => 'collection',
'type' => \Directus\Database\Schema\DataTypes::TYPE_STRING,
'interface' => 'collections',
'options' => json_encode([
'iconRight' => 'list_alt'
]),
'locked' => 1,
'readonly' => 1,
'sort' => 2,
Expand All @@ -52,6 +59,9 @@ public function run()
'field' => 'item',
'type' => \Directus\Database\Schema\DataTypes::TYPE_STRING,
'interface' => 'text-input',
'options' => json_encode([
'iconRight' => 'link'
]),
'locked' => 1,
'readonly' => 1,
'sort' => 3,
Expand All @@ -62,6 +72,9 @@ public function run()
'field' => 'action_by',
'type' => \Directus\Database\Schema\DataTypes::TYPE_INTEGER,
'interface' => 'user',
'options' => json_encode([
'iconRight' => 'account_circle'
]),
'locked' => 1,
'readonly' => 1,
'sort' => 4,
Expand All @@ -73,7 +86,8 @@ public function run()
'type' => \Directus\Database\Schema\DataTypes::TYPE_DATETIME,
'interface' => 'datetime',
'options' => json_encode([
'showRelative' => true
'showRelative' => true,
'iconRight' => 'calendar_today'
]),
'locked' => 1,
'readonly' => 1,
Expand All @@ -86,7 +100,8 @@ public function run()
'type' => \Directus\Database\Schema\DataTypes::TYPE_DATETIME,
'interface' => 'datetime',
'options' => json_encode([
'showRelative' => true
'showRelative' => true,
'iconRight' => 'edit'
]),
'locked' => 1,
'readonly' => 1,
Expand All @@ -99,7 +114,8 @@ public function run()
'type' => \Directus\Database\Schema\DataTypes::TYPE_DATETIME,
'interface' => 'datetime',
'options' => json_encode([
'showRelative' => true
'showRelative' => true,
'iconRight' => 'delete_outline'
]),
'locked' => 1,
'readonly' => 1,
Expand All @@ -111,6 +127,9 @@ public function run()
'field' => 'ip',
'type' => \Directus\Database\Schema\DataTypes::TYPE_STRING,
'interface' => 'text-input',
'options' => json_encode([
'iconRight' => 'my_location'
]),
'locked' => 1,
'readonly' => 1,
'sort' => 8,
Expand All @@ -121,6 +140,9 @@ public function run()
'field' => 'user_agent',
'type' => \Directus\Database\Schema\DataTypes::TYPE_STRING,
'interface' => 'text-input',
'options' => json_encode([
'iconRight' => 'devices_other'
]),
'locked' => 1,
'readonly' => 1,
'sort' => 9,
Expand All @@ -133,7 +155,8 @@ public function run()
'interface' => 'textarea',
'locked' => 1,
'readonly' => 1,
'sort' => 10
'sort' => 10,
'width' => 'full'
],


Expand Down Expand Up @@ -427,8 +450,7 @@ public function run()
'type' => \Directus\Database\Schema\DataTypes::TYPE_ALIAS,
'interface' => 'file',
'locked' => 1,
'hidden_detail' => 1,
'sort' => 0
'hidden_detail' => 1
],
[
'collection' => 'directus_files',
Expand All @@ -437,16 +459,16 @@ public function run()
'interface' => 'primary-key',
'locked' => 1,
'required' => 1,
'hidden_detail' => 1,
'sort' => 1
'hidden_detail' => 1
],
[
'collection' => 'directus_files',
'field' => 'preview',
'type' => \Directus\Database\Schema\DataTypes::TYPE_ALIAS,
'interface' => 'file-preview',
'locked' => 1,
'sort' => 2
'sort' => 1,
'width' => 'full'
],
[
'collection' => 'directus_files',
Expand Down Expand Up @@ -481,6 +503,9 @@ public function run()
'field' => 'tags',
'type' => \Directus\Database\Schema\DataTypes::TYPE_ARRAY,
'interface' => 'tags',
'options' => json_encode([
'placeholder' => 'Enter a keyword then hit enter...'
]),
'sort' => 5,
'width' => 'half'
],
Expand All @@ -502,9 +527,35 @@ public function run()
'type' => \Directus\Database\Schema\DataTypes::TYPE_STRING,
'interface' => 'wysiwyg',
'options' => json_encode([
'placeholder' => 'Enter a caption or description...'
'toolbar' => ['bold','italic','underline','link','code']
]),
'sort' => 7
'sort' => 7,
'width' => 'full'
],
[
'collection' => 'directus_files',
'field' => 'uploaded_on',
'type' => \Directus\Database\Schema\DataTypes::TYPE_DATETIME,
'interface' => 'datetime',
'options' => json_encode([
'iconRight' => 'today'
]),
'locked' => 1,
'readonly' => 1,
'sort' => 8,
'width' => 'half',
'required' => 1
],
[
'collection' => 'directus_files',
'field' => 'uploaded_by',
'type' => \Directus\Database\Schema\DataTypes::TYPE_USER_CREATED,
'interface' => 'user-created',
'locked' => 1,
'readonly' => 1,
'sort' => 9,
'width' => 'half',
'required' => 1
],
[
'collection' => 'directus_files',
Expand Down Expand Up @@ -558,38 +609,14 @@ public function run()
'sort' => 13,
'width' => 'half'
],
[
'collection' => 'directus_files',
'field' => 'uploaded_on',
'type' => \Directus\Database\Schema\DataTypes::TYPE_DATETIME,
'interface' => 'datetime',
'options' => json_encode([
'iconRight' => 'today'
]),
'locked' => 1,
'readonly' => 1,
'sort' => 8,
'width' => 'half',
'required' => 1
],
[
'collection' => 'directus_files',
'field' => 'uploaded_by',
'type' => \Directus\Database\Schema\DataTypes::TYPE_USER_CREATED,
'interface' => 'user-created',
'locked' => 1,
'readonly' => 1,
'sort' => 9,
'width' => 'half',
'required' => 1
],
[
'collection' => 'directus_files',
'field' => 'metadata',
'type' => \Directus\Database\Schema\DataTypes::TYPE_JSON,
'interface' => 'json',
'locked' => 1,
'sort' => 14
'sort' => 14,
'width' => 'full'
],
[
'collection' => 'directus_files',
Expand Down
12 changes: 6 additions & 6 deletions migrations/db/seeds/RelationsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public function run()
'field_many' => 'group',
'collection_one' => 'directus_groups'
],
[
'collection_many' => 'directus_fields',
'field_many' => 'collection',
'collection_one' => 'directus_collections',
'field_one' => 'fields'
],
[
'collection_many' => 'directus_files',
'field_many' => 'uploaded_by',
Expand Down Expand Up @@ -83,12 +89,6 @@ public function run()
'collection_many' => 'directus_users',
'field_many' => 'avatar',
'collection_one' => 'directus_files'
],
[
'collection_many' => 'directus_fields',
'field_many' => 'collection',
'collection_one' => 'directus_collections',
'field_one' => 'fields'
]
];

Expand Down
2 changes: 1 addition & 1 deletion migrations/db/seeds/RolesSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function run()
[
'id' => 2,
'name' => 'Public',
'description' => 'This sets the data that is publicly available through the API without a token'
'description' => 'Controls what API data is publicly available without authenticating'
]
];

Expand Down
46 changes: 37 additions & 9 deletions migrations/db/seeds/SettingsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,25 @@ class SettingsSeeder extends AbstractSeed
public function run()
{
$data = [
[
'key' => 'project_url',
'value' => ''
],
[
'key' => 'project_logo',
'value' => ''
],
[
'key' => 'project_color',
'value' => 'darkest-gray',
'value' => 'blue-grey-900',
],
[
'key' => 'project_foreground',
'value' => '',
],
[
'key' => 'project_background',
'value' => '',
],
[
'key' => 'default_limit',
Expand All @@ -31,18 +43,34 @@ public function run()
'key' => 'sort_null_last',
'value' => '1'
],
[
'key' => 'password_policy',
'value' => ''
],
[
'key' => 'auto_sign_out',
'value' => '60'
'value' => '10080'
],
[
'key' => 'youtube_api_key',
'value' => ''
'key' => 'login_attempts_allowed',
'value' => '10'
],
[
'key' => 'trusted_proxies',
'value' => ''
],
[
'key' => 'file_naming',
'value' => 'uuid'
],
[
'key' => 'file_max_size',
'value' => '100MB'
],
[
'key' => 'file_mimetype_whitelist',
'value' => ''
],
[
'key' => 'thumbnail_dimensions',
'value' => '200x200'
Expand All @@ -55,17 +83,17 @@ public function run()
'key' => 'thumbnail_actions',
'value' => '{"contain":{"options":{"resizeCanvas":false,"position":"center","resizeRelative":false,"canvasBackground":"ccc"}},"crop":{"options":{"position":"center"}}}'
],
[
'key' => 'thumbnail_not_found_location',
'value' => ''
],
[
'key' => 'thumbnail_cache_ttl',
'value' => '86400'
],
[
'key' => 'thumbnail_not_found_location',
'key' => 'youtube_api_key',
'value' => ''
],
[
'key' => 'file_naming',
'value' => 'uuid'
]
];

Expand Down
Loading

0 comments on commit e0630e8

Please sign in to comment.