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 (#1516)
Browse files Browse the repository at this point in the history
* Issue Fix #1180 (#1183)

* Issue fix #1191 (#1192)

* Issue fix #1196 (#1197)

* Add 2fa authentication (#1031)

* Parent + Nested validation changes (#1138)

* Add migration schema for 2FA Secret user field

* Add 2fa_secret field to FieldsSeeder

* Create Missing 2FA Password Exception

* Add googleauthenticator dependency

* Add getter for User's 2FA secret

* Check for otp param in login request, and login with it

* Add enforce_2fa parameter to directus_settings

* Create Utils endpoint and service method to generate 2fa secret

* Add enforce_2fa field to roles

* Add enforce_2fa field to FieldsSeeder

* Change Missing2FAPasswordException error code to 111

* Change 2FA Library

* Change 2fa_secret interface in FieldsSeeder

* Created exception for invalid otp

* Changed findUserWithCredentials to through an InvalidOTPException on otp check

* Created new exception if 2fa is enforced but not enabled by user

* Added function to check if 2fa is enforced for a user

* Check in AuthenticationMiddleware whether 2fa is enforced and enabled for user

* Add optional needs2FA field to auth token and on token refresh

* Catch error if enforce_2fa column doesn't exist
Fixes crash when has2FAEnforced is called on a DB that hasn't been migrated

* Use relative positions for target path array to check user edit

* Fix unset on payload_arr instead of payload

* Change 2FA activation on login to use activate2FA endpoint

* Update ItemsService.php

* Issue Fix #1194 (#1195)

* Issue Fix #1194

* Update comment

* Valildation issue of O2M/M2O at insertion (#1198)

* Fox #1201 (#1202)

* Fix #1203 (#1204)

* Update collections() method in types.php (#1184)

There are cases when $type is not a string but an object that inherits from ObjectType.
In that situation array_key_exists failing because it should get only integers or strings 
as a first parameter. So in order to avoid that the 'name' property of the object is used 
as a key.

* Improve YouTube Embed Provider (#1210)

Adds in detection and parsing for youtu.be shorthand URLs.

* Add check for environment on bootstrap (#1215)

* Fix #1186 [Create new error code for invalid login entity] (#1218)

* Fix #1217 (Changing password over the CLI doesn't work) (#1220)

* Feature/audio video upload (#1214)

* added file meta data for audio/video

* updates as per PR feedback

* Fix #1207 [Permission denied issue  when using translation interface] (#1221)

* Fix for smtp send mail issue #1205 (#1223)

* Fix for smtp send mail issue #1205

Missing additional config settings
#1205

* Update Schema.php

* Fix 1232[Auth token is not refreshed] (#1233)

* Change Authencation Error code to 114 from 109 (#1231)

* Fix issue while update item. (#1224)

* #1227 : Ignore all the alias fields except file interface (#1240)

* Fix #1224 [Deletion of m2o/o2m field error for enabled cache] (#1241)

* Fix 845 (#1244)

* Change namespace for PHPUnit.

* Removing old tests.

* Fix #1238 [PDF support for Embedded URL] (#1245)

* Fix #1238[PDF support for Embedded URL]

* Add array support

* Update comment

* Update Files.php

* Fix #1243[Dynamic charset for DB] (#1246)

* Fix #1249[saveData: height is set to width] (#1251)

* Fix #2017[Renaming `Public` role gives `unauthorized` error on API calls] (#1253)

* Revert "Fix #2017[Renaming `Public` role gives `unauthorized` error on API calls] (#1253)" (#1254)

This reverts commit 7fe9056.

* FIX/core/Directus/Files.php: return $height instead of $width (#1250)

* Fix #1255 [Add support of batch Create/Update/Delete for user] (#1257)

* Fix #1255 [Support batch create/update/delete for user]

* Add exception

* Fix directus/app#2017 (#1256)

* Fix #2017[Renaming `Public` role gives `unauthorized` error on API calls]

* src

* Remove unwanted file from use

* Fix #729 [Can't properly query nested fields on Files field] (#1260)

* #1216 : Solved issue in O2M relationship of table itself (#1259)

* Fix #1209 [M2M relation with directus_collections cant be saved] (#1261)

* Fix #1209[M2M relation with directus_collections cant be saved]

* Implement condition on update

* Define variable

* Fix #1209[M2M relation with directus_collections cant be saved]

* 🙆🏻‍♂️

* Fix #1266 (#1267)

* Fix Warning:  Cannot use a scalar value as an array in /src/core/Directus/Config/StatusMapping.php on line 103 (#1268)

* Fix Notice: Undefined variable: filterFields in src/core/Directus/Database/TableGateway/RelationalTableGateway.php on line 2125 (#1270)

* Fix  #1237 (#1265)

* Project name fix (#1272)

* Adds support for environment variables in CLI (#1276)

* Cleans up some unused/deprecated files in the repository (#1277)

* Fix #1248 [API cannot go into deeper on user data] (#1282)

* Add proper exit codes for CLI (#1281)

* Fix cache.enabled not respected in cache service (#1273)

This fixes an issue where cache.enabled is false but caching is still working.

* Add CLI cache:clear (#1274)

* Fix #1284[Broken user related fields] (#1287)

* Fix #1279 [wysiwyg-full - add image - Call to a member function isOneToMany() on null] (#1288)

* fixed bug with incorrect height (#1293)

* Execute migrations automatically (#1296)

* Remove middleware for register webhook and add it before registeration of hooks

* Need to add middleware for directory dependency

* Fix #1302 - Internal server error when selecting/checking a Checkbox Relational field after deleting some of the related items (#1307)

* Fix #1308 - Checkbox-relational field issue when unchecking value (#1309)

* Fix #1308 - Checkbox-relational field issue when unchecking value

* Update RelationalTableGateway.php

* Add Aliyun OSS settings to config schema (#1299)

* Extend config schema to support PDO options. (#1295)

* Extend config schema to support PDO options.

* Make driver_options database config setting optional.

* Replcae  with getQueryParams method of slim (#1313)

* Fix Undefined Variable - /src/core/Directus/Console/Common/Setting.php on line 24 (#1314)

* Replace  with getQueryParams method of slim (#1317)

* Fix response data contains json object instead of array (#1318)

* Fix #1310[Resolve issue with updatingNestd m2o/o2m/m2m] (#1320)

* Fix #1321 [Resolve bug with system date and system user validation] (#1322)

* Resolve Authentication token issue after upgrade to 2.6.0 (#1326)

* Fix #1329 [Add new fields to / endpoint] (#1332)

* Fix #1329

* Fix #1329 [Add new fields to / endpoint]

* fix issue #1330 (#1331)

* Rename color with project_color key (#1334)

* Fix #1333 [Return Unauthorised when public role not have the respected permission] (#1336)

* Fix #1333 [Return Unauthorized when public role not have the respected permission

* Add comment

* Session-based auth flow along with kill functionality (#1280)

* Fix #1263[Rethink Auth Flow]

* Kill User Session

* Add Expiry time

* Expire and cookie

* Auth Flow - Modify code base

* Resolve browser cache remove issue

* Remove PHPSESSIONID reset code

* Cookie name based on projject name, Merge authentication endpoint

* Support of mode in sso

* Add seeder into migrations

* Remove warning of container

* Add required flag for user in fields table from migrations

* Add endpoint to fetch the user's session

* Update user's session to loggedin user session endpoint

* Allow cross origin cookie

* Set credentials response header dynamically

* Fix empty FK - do not continue if FK is empty, otherwise, it will not display the entry as if it was not saved. (#1342)

* Fix #1343 [Update directus_files field type] (#1346)

* fix parsing env variables (#1347)

* Fix CORS issue for system endpoint (#1352)

* Fix #1348 (#1353)

* Fix wrong chache naming. (#1354)

* Fix issue when deleting a file and saving the item (#1360)

* Fix #1359 [Pagination not working] (#1362)

* fix readme ( branch to submit PRs "master" -> "develop") (#1365)

* Ignore ddev config folder

* Fix unaccessible public endpoints (#1367)

* Fix CORS origin * for public preflight endpoints (#1369)

* add gitpod.io support (#1356)

* Add requires2FA flag at / endpoint (#1370)

* Set default value if the value is not set (#1373)

* CORS issue for public endpoint (#1374)

* Fix Warning:  Illegal string offset 'field' in src/endpoints/Settings.php on line 89 when query param contains single=1 (#1375)

* Fix Warning:  Illegal string offset 'field' in src/endpoints/Settings.php on line 89 when query param contains single=1

* Update Settings.php

* Resolve undefined class ArrayUtils error

* Fetch single sign on providers

* style updates (#1382)

* Update withHeaders + add note

* Fix #1384 [Remove entries from directus_relations on delete the collection] (#1386)

* Fix #1381 [Throwing 500 response code on mail sending fail] (#1387)

* Fix #1329 [Update the name of variable from settings table] (#1389)

* Fix #1329 [Update the name of variable from settings table]

* Update comment

* Fix the general settings schema upgrade - consider the new installation as well with already existing fields (#1391)

* New project flow (#1399)

* Replace migrations file from config folder to migrations folder

* Return the project list

* Remove unwanted code

* Projects endpoint

* Remove unwanted code

* Remove unwanted code

* Remove unwanted code

* Remove default _ for secretkey and newtimzone function of datetimeutil

* Check requirement endpoint (#1398)

* Check requirement endpoint

* Add  endpoint

* Update ProjectService.php

* Don't verify super admin with hashing

* Remove warning of non static method 'createJsonFileContent' for project create

* Remove _ as private flas (#1403)

* Remove password_verfiy and add equals operator

* Fix integrity constraint (#1400)

* Update 2FA flow to work with cookies

Squashed commit of the following:

commit a543c44
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Fri Nov 8 16:20:45 2019 -0500

    Use correct response format for 2fa util

commit ab06c55
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Fri Nov 8 15:42:35 2019 -0500

    Rename activate2FA to activate_2fa and allow `me` for user updates

commit 7b429ab
Author: Binal Gajjar <binal.gajjar7@gmail.com>
Date:   Fri Nov 8 22:46:30 2019 +0530

    Set NULL if data array is empty

commit c5c7bf6
Author: Binal Gajjar <binal.gajjar7@gmail.com>
Date:   Fri Nov 8 22:37:17 2019 +0530

    Remove needs2FA param from authtoken

commit 5b4b21a
Author: Binal Gajjar <binal.gajjar7@gmail.com>
Date:   Fri Nov 8 22:35:41 2019 +0530

    Throw error if 2FA is not enabled

* clearer existing install response

* update error message

* Fix #1380 [Set default requires2FA flag] (#1388)

* Redirect the users to /admin in sso (#1407)

* Redirect the users to /admin in sso

*  2FA flow for SSO

* Remove unwanted file from use statement

* Default to UTC timezone on new project installs (when there's no config)

* update sso icon colors

* Update the size of token field

* Update the size of token field

* Update the size of static token

* Resolve redirection to /admin? 

Resolve redirection to `/admin?` instead of `/admin`

* Add missing 2fa secret column in seeds

* Throw exception for SSO (#1411)

* Redirect the users to /admin in sso

*  2FA flow for SSO

* Remove unwanted file from use statement

* Throw the exception when 2FA enforced or enabled

* Fix 2fa column

* Fix 2fa column

* Ignore the files which start with _

* 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.

* Fix #1395[/server/ping should ignore project] (#1416)

* Update error code for unknown project exception

* Update FieldsConfig.php (#1413)

Without this fix the GrapQL query brings values only in case when the M2M field has exactly the same name as the related collection. It can be ok, but for cases when it's required to have mutliple M2M fields pointing to the same collection, (e.g. there 2 collections  - games and tags, and so we need to specify Primary and Secondary tags for each game). So with current implementation we cannot create primaryTags and secondaryTag fields, we should use 'tags' field instead, but its only one, and we need 2. So this fix obtaining fieldName from parameters and using it for relation and not a collection name.

* Remove unwanted files (#1421)

* V8.0.0 (#1414)

* 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

* directus settings seeder updates

* Add support for webhooks

Squashed commit of the following:

commit ce6ffac
Merge: 667d960 e0630e8
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Tue Nov 12 11:51:19 2019 -0500

    Merge branch 'develop' into webhooks

commit 667d960
Merge: be83925 557a83b
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Tue Nov 12 11:17:11 2019 -0500

    Merge branch 'v8.0.0' into webhooks

commit be83925
Merge: f51c51a 41fd0b6
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Tue Nov 12 11:17:07 2019 -0500

    Merge branch 'develop' into webhooks

commit 557a83b
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Tue Nov 12 10:54:13 2019 -0500

    Fix false positive in sso 2fa block

commit 0989b31
Author: Ben Haynes <ben@rngr.org>
Date:   Tue Nov 12 10:49:54 2019 -0500

    relations alpha order

commit 8f15ad6
Author: Ben Haynes <ben@rngr.org>
Date:   Tue Nov 12 10:49:42 2019 -0500

    public role description

commit 555ba2f
Author: Ben Haynes <ben@rngr.org>
Date:   Tue Nov 12 10:46:22 2019 -0500

    update settings seeder to contain all default options

commit 9816a4a
Author: Binal Gajjar <binal.gajjar7@gmail.com>
Date:   Tue Nov 12 20:41:54 2019 +0530

    Add redirect_url param

commit 3ba3708
Merge: 379457d 0629167
Author: Binal Gajjar <binal.gajjar7@gmail.com>
Date:   Tue Nov 12 20:30:11 2019 +0530

    Merge branch 'v8.0.0' of https://github.com/directus/api into v8.0.0

commit 0629167
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Mon Nov 11 18:33:17 2019 -0500

    Add project key to reset password

commit 2bcd474
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Mon Nov 11 18:33:05 2019 -0500

    Add trailing slash to admin redirect

commit 4a0ccf6
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Mon Nov 11 16:13:34 2019 -0500

    Update request / reset password to be all app based

commit e42fbf9
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Mon Nov 11 16:13:05 2019 -0500

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

commit 9f24d50
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Mon Nov 11 15:17:59 2019 -0500

    Redirect to correct endpoint for app

commit f51c51a
Author: Binal Gajjar <binal.gajjar7@gmail.com>
Date:   Fri Nov 8 22:44:15 2019 +0530

    Webhook Implementation (#1304)

    * Webhook implementation

    * Webhook development

    * Fix 29

    * Register the webhook

    * Webhook seed transfer into migrations

    * Update default seeder

    * Update comment

    * Update comment

    * Add Status Field

* directus users seeds

* remove unused seeder data

* missing comma

* Added missing comma

* settings defaults

* setup telemetry and default locale

* Remove directus activity seen table (#1422)

* Remove directus activity seen

* Revert back the activity seen field from upgrades

* webhooks seeds

* webhooks update

* Rename webhook draft->inactive published->active + delete deleted

* update webhooks schema migrations

* webhooks url placeholder

* Use collections interface for collection chooser on webhooks

* webhooks info

* Don't enforce user.locale to be set

* Bump version

* hide dividers on browse

* nice defaults for webhooks layout

* better webhooks layout

* Revert "Fix issue when deleting a file and saving the item (#1360)" (#1423)

This reverts commit 37ef295.

* Revert "Fix the general settings schema upgrade - consider the new installation as well with already existing fields (#1391)" (#1424)

This reverts commit 483e065.

* Update the current migrations for remove unwanted code and update the icons (#1425)

* Fix #1429 [Activity datetime is incorrect] (#1430)

* add directus user theme field

* Update migration files to check if column exist then pnly drop (#1436)

* Add DB condition in migration to check whether column exists.

* Fix Constant Imagick::ALPHACHANNEL_REMOVE is undefined (#1438)

When using Imagick less than version 3.4.4, it will throw error `Constant Imagick::ALPHACHANNEL_REMOVE is undefined`.

The const `ALPHACHANNEL_REMOVE` only exist in 3.4.4 as described [here](Imagick/imagick#281).

* Add Migration for theme (#1444)

* Fix #1442 [Reset password throws email error on inactive user] (#1445)

* Add Migration for theme

* Fix #1442 [Reset password throws email error on inactive user]

* Update syntax for insert

* User role m2m to o2m (#1435)

* Update role to m2o

* Remove debug code

* If exist condition

* Update migrations/db/seeds/RelationsSeeder.php

* Fix #1434 [Clean up /projects /server/projects setup] (#1439)

* Fix #1434

* Remove unwanted code

* Try catch for response

* Remove the superadmin token from payload and place it as a param

* Remove admin condition to delete the project

* Remove whitespace

* Fix #1429 [Convert current timezone to UTC timezone] (#1447)

*  Fix #1450 (#1451)

*  Issue fix 1450

* Remove optional from social_providers as it will add a blank string too.

* Fix #1417 [Resolve edit permission is required to create a file] (#1452)

* Fix #1417 [Resolve edit permission is required to create a file]

* Remove unwanted enter from file

* Remove unwanted files from git commit

* Remove unwanted files from git commit

* Revert " Fix #1450 (#1451)" (#1454)

This reverts commit 68e1717.

* Fix project install

* Stop migrations execution for server endpoints (#1453)

* Stop migrtions execution for server endpoints

* Remove trailing slash from get request

* Fix #1449 [Support _ for projectname] (#1455)

* Support for redis cluster (#1441)

* Add support for redis cluster

* Add cache adapter type for rediscluster

* Use cache/cache for dev-master (which support RedisCluster)
Fix instanciation of RedisCluster

* Bump version

* Use -1 for undefined error code

* Log errors to file on failed sso

* Add migrations for using repeater for collection translations

* Make the api endpoint /server/projects works with docker environments variables (#1470)

* Make the api endpoint /server/projects works with docker environments variables DIRECTUS_USE_ENV=1

* Change default project name to _

* Fix #1450 [Installer creates format issues in config file] (#1472)

* Fix #1450 [Installer creates format issues in config file]

* Add comma after array

* Fix #1427 (#1469)

* Adding command line support for new project flow (#1464)

* Fix commannd line issues

* Add upgrades migrations in cmd installtion

* Rename -N to -k and add it to the list of available options

* Make the use if the telemetry service configurable (#1420)

* Make the telemetry requests configurable

* Add new config setting to the schema

* Remove telemetry from configuration file

* Remove telemetry from configuration file

* Remove telemetry from schema

* Remove extra comma

* Fetch the telemetry from settings table instead of configuration file

* Fixed primary key fields Graphql definition (#1418)

* Fixed primary key fields Graphql definition

The check for primary key fields was wrong so they never are defined as ID. So the Int! definition raises a Graphql validation error on primary key fields:

Interface field Node.id expects type ID but ###.id is type Int!.

* Code style improvements

Used "if" instead ternary operator and removed unnecessary "== true"

* Migration changes (#1466)

* Migrations folder structure

* Change migrations path

* Remove unwanted utilities

* Remove utilities

* Add version in comment section of migrations

* Check if the table exists or not

* Adding if exist condition for update

* Rename the fields migrations

* MIgration changes

* Remove check for libapache2_mod_php (#1479)

The Apache PHP module is needed in order to run PHP from Apache. This information is returned from PHP, so if this module isn't loaded, this whole endpoint wouldn't do anything. If this endpoint works, we already know that libapache2-mod-php is working as expected. (Also, extension_loaded("libapache2-mod-php") never seems to be true.

* Rename page->module (#1485)

* Don't raise the required error if the field has a default value (#1487)

* Replace nav_override with collection / module listing

* Fix #1488 (#1489)

* Fix #1462 [Authentication API return user object] (#1490)

* Fix #1483 [activity_skip doesnt work on delete file] (#1491)

* Fix width on wrong value

* Fix collection listing not using right options

* Update the options based on seeder

* Rework the thumbnailer (#1467)

* Thumbnail whitelist development

* Image and thumbnail URL changes and validations

* Assets endpoints in thumbnail

* Default thumbnail URL changes and other changes

* Removed thumbnail in public

* Requested changes in thumbnailer

* Remove key from folder name

* Provide the support for both keys - system and whitelist

* Return all the thumbnail - including system as well as whitelisted

* Use the shorthand for width, height, quality and fit

* Use the shorthands for params

* Update AssetService.php

* Update the error message

* MIgration changes (#1495)

* MIgration changes

* Update the sorting ordeR

* Render  original path as full_url

* Use color interface for project color

* Update migrations for setings

* Fix thumbnailer enabled check + * generation

* Cleanup settings migrations

* Rename thumbnail_whitelist to asset_whitelist

* Fix non-key whitelisted asset

* Update migrations

* Add contain constraint

* Remove hardcoded settings validation

* Remove default project based empty folders

* Use generated as default thumbnail location

* Config updates (#1484)

* Migrations folder structure

* Change migrations path

* Remove unwanted utilities

* Remove utilities

* Add version in comment section of migrations

* Check if the table exists or not

* Adding if exist condition for update

* Rename the fields migrations

* Rename api-sample.php to _example.php

* Don't return ignored files

* Move env out of app config category

* Remove timezone flag from config

* Move logger config out of settings key

* [WIP] Start on new example config file

* Change order + remove comments from config stub

* Get rid of unused `feedback` config section

* Update example config file

* Added missing comma

* Added missing comma

* Remove migration

* Adding support for _ project

* Add comment for condition

* Update Server.php

* Ignore _ prefixed config files everywhere

* Make durations readonly

* Use tags for ip whitelist

* Clear whitespace + set duration to readonly

* Fix #1497 [V8 fresh install is broken]

* Add migration for migrating advanced wysiwyg to wysiwyg

Fixes directus/directus#2465

* Fix deleting file type fields from collection

Fixes #1503

* Update the thumbnailer (#1506)

* File name changes and thumbnailer changes

* Thumbnail related changes

* name changes

* Fix typo

* Thumbnail changes

* Combine migration files

* Replace the file delete code from basetablegateway to fileservice

* Tweak migrations

* Set uuid to default field format
* Don't change primary key of directus_files

* Fix content-disposition header + last modified for originals and thumbnails

* Don't return thumbnails if the asset type isn't an image

* Set duration to readonly

* Don't try reading non-images files with Intervention

* Prefer application/pdf over application/acrobat

* Update repeater settings for asset whitelist

* Fix renaming files

* Don't return thumbnail info for svgs

* update example config comments

* remove leading slash from example

* Have migrations (#1509)

* Put old migrations back

* Upgrade migrations

* Various tweaks

* Fix private hash requirement flag

The API still throw a required error, even though its a generated field

* Fix settings

* Rework order of migrations

* Beautify directus_files
Beautify directus_files
Beautify directus_files
Beautify directus_files
Beautify directus_files
Beautify directus_files
Beautify directus_files
Beautify directus_files
Beautify directus_files

* Remove nav_blacklist, add enforce_2fa

* Tweak settings of timeline

* Get rid of activity icon

* Use system collections in directus activity main view

* Handle error : Use of undefined constant ERROR_MESSAGE

* Rebuild the 2FA query (#1510)

* Redevelop the 2FA query

* Dynamic name of table

* Fix #1508 [Deleting a file attached to an item deletes the item] (#1512)

* Update type of enforce_2fa from array to boolean

* Update type of enforce_2fa from array to boolean

* Fix #1473 [Remove cookie if token is invalid] (#1513)

* Update README.md

* Update README.md

* Add uploads folder to base structure

* Fix _.php config name + remove duplicate code

* Also migrate wysiwyg_full

* Bump version
  • Loading branch information
rijkvanzanten committed Dec 4, 2019
1 parent 25fa223 commit b08b3a2
Show file tree
Hide file tree
Showing 139 changed files with 7,217 additions and 5,674 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ deploy.*

# Ignore configuration files
/config/*
!/config/api_sample.php
!/config/_example.php

# PHPUnit
/phpunit.xml
Expand Down
178 changes: 16 additions & 162 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,173 +1,27 @@
<p align="center">
<a href="https://directus.io" target="_blank" rel="noopener noreferrer">
<img src="https://user-images.githubusercontent.com/522079/43096167-3a1b1118-8e86-11e8-9fb2-7b4e3b1368bc.png" width="140" alt="Directus Logo"/>
</a>
</p>
<h1>
<img src="https://user-images.githubusercontent.com/522079/43096167-3a1b1118-8e86-11e8-9fb2-7b4e3b1368bc.png" width="40" alt="Directus Logo"/>&nbsp;&nbsp;Directus API</h1>

<p>&nbsp;</p>
> Looking for the full Directus suite? Checkout [the `directus/directus` repo](https://github.com/directus/directus)!
<h1 align="center">
The All-New Directus 7<br>Future-Proof Headless CMS
</h1>
## Description

<h3 align="center">
<a href="https://directus.io">Website</a> •
<a href="https://docs.directus.io">Docs</a> •
<a href="https://docs.directus.io/api/reference.html">API Reference</a> •
<a href="https://docs.directus.io/guides/user-guide.html">User Guide</a> •
<a href="https://directus.app">Demo</a> •
<a href="https://docs.directus.io/getting-started/supporting-directus.html">Contribute</a> •
<a href="https://twitter.com/directus">Twitter</a>
</h3>
The Directus API is a PHP powered REST / GraphQL API that acts as a layer on top of a relational database.

<p>&nbsp;</p>
## Installation / Usage

> _The Directus 7 App has been rebuilt from the ground-up in Vue.js and decoupled from our new "versionless" API. Both can easily be customized and extended to suit your project's needs._
**NOTE**: Unless you're contributing to the project, you shouldn't build the API from source. Use [`directus/directus`](/directus/directus) instead.

<p>&nbsp;</p>
1. Clone the repo
2. Install the depencencies using `composer`: `composer install`
3. Run the application using any local server, like MAMP, DDEV, Docker, or any other (preferably) Apache installation.

## 🐰 Introduction
## Core Team

Directus is an open-source suite of software that provides an instant API wrapper for SQL databases and an intuitive Admin App for non-technical users to manage that content. It's like a safe, friendly, and super-powered "database client" (eg: _PHP-my-Admin_ or _Sequel Pro_). Created in 2004, our premium platform powers hundreds-of-thousands of data-driven applications around the world. With our JSON API, webhooks, and complete control over where and how your content is used — what will you build with Directus?
* [Ben Haynes](https://github.com/benhaynes) _(Project Lead)_
* [Rijk van Zanten](https://github.com/rijkvanzanten) _(Tech Lead)_

* **[Directus API](https://github.com/directus/api)** — Wraps any new or existing SQL database with RESTful JSON endpoints for connecting content anywhere: websites, native apps, wearables, IoT devices, kiosks, or anything else!
* **[Directus Admin App](https://github.com/directus/app)** — A friendly admin interface built with Vue.js that works in conjunction with our API to allow non-technical users to manage database content and digital assets.
* **[Directus Suite](https://github.com/directus/directus)** A package that combines our API, Admin App, and all dependencies for quick and easy installation on most servers.
[Advisors, Sponsors, Partners, and Key Contributors](https://directus.io/organization.html#the-team)

<p>&nbsp;</p>
## License

## ✨ Key Concepts

### Database-First

Directus follows a database-first approach, storing all of your data _unaltered_ in pure SQL databases with that can be completely customized.

#### Access and Optimization

Directus mirrors _your_ actual database so it will automatically stay in sync with any changes made directly to the database! With the full power of SQL unlocked, you can:

1. Architect your actual database with meaningful table and column names
2. Infinitely optimize with indexing, datatypes, lengths, defaults, keys, encoding, etc
3. Update your database schema at any point and Directus will instantly reflect changes
4. Create, update, and delete content directly from the database

#### Direct Access

This database-first approach means that you have the option to completely bypass Directus if needed. Connecting your application _directly_ to the database means Directus is completely bypassed, removing even the slightest possiblility of a bottleneck, and giving you the unbridled power of complex SQL queries.

#### Portability and Transparency

Directus is _not_ a black-box system. There is nothing proprietary or opinionated about how Directus stores your content so you're never locked-in or locked out. Import existing SQL to get started quickly, and rest assured that you can also export your unaltered content as vanilla SQL at any point. You can also self-host the entire suite on your own servers if needed or use our hosted Cloud service.

#### Complex Relationships

Whether you need many-to-one, one-to-many, many-to-many, or something completely different... Directus has you covered. You can interrelate database fields, then fetch deeply nested data using our robust dot-notation parameters.

### Simple, Modular and Extensible

We've intentionally kept our codebase as simple and lightweight as possible. Every aspect of Directus has been modularized, with many options for extending, overriding, or even bypassing the core system. Choose your auth providers, storage adapters, content interfaces, data presentation, and more. We also have webhooks, event hooks, API response filters, custom endpoints, CSS/JS override files, and much more.

Furthermore, because the codebase has been internally decoupled, Directus supports full multitenancy. You can use a single Directus App to manage multiple Directus API instances, and each API instance can manage multiple databases (projects or environments).

### Internationalization and Accessibility

Directus allows you to manage multilingual content in as many languages as your project needs. And no matter what language(s) your organization requires, our Admin App supports a growing number of locales. We've also paid close attention to our Admin App's interface to ensure it is as clear and accessible as possible for all users.

<p>&nbsp;</p>

## 📖 Documentation

* [What is Directus?](https://docs.directus.io/getting-started/introduction.html#what-is-directus)
* [Installing the Directus Suite](https://docs.directus.io/getting-started/installation.html)
* [Extending Directus](https://docs.directus.io/extensions/)
* Directus App
* [App Docs](https://docs.directus.io/advanced/app/standalone.html)
* [User Guide](https://docs.directus.io/guides/user-guide.html)
* [Install the App](https://docs.directus.io/advanced/app/standalone.html#installation)
* Directus API
* [API Docs](https://docs.directus.io/advanced/api/standalone.html)
* [API Reference](https://docs.directus.io/api/reference.html)
* [Install the API](https://docs.directus.io/advanced/api/standalone.html#installation)
* Tutorials
* [Tutorials](https://medium.com/directus)
* [Videos](https://www.youtube.com/playlist?list=PLD--x9rY3ZL31stRPkA4FdGC4idIM-8-d)

<p>&nbsp;</p>

## 🤲 Help & Resources

### Technical Support

* **Community Support** — For help with open-source instances please post questions with the `directus` tag on [Stack Overflow](https://stackoverflow.com/questions/tagged/directus) or chat with members of our online community.
* **Premium Support** — Directus Cloud customers, Patreon Sponsors, and those paying for hourly support all have access to our Live support over our [Live Chat](https://directus.io) or [Email](mailto:support@directus.io).

### Community

* **[Slack](https://directus.chat)** — Come join over a thousand members discussing the future of Directus. Our helpful members are also quick to offer advice for simple questions you may have while getting started.
* **[Twitter](https://twitter.com/directus)** — Follow us on Twitter to be the first to hear about product updates, see sneak peeks of new features, and vote on polls regarding the future of our platform.

### GitHub Tickets

* **Reporting Bugs** — If you believe you've found a bug in the Directus Core codebase, please submit new tickets to either the [App](https://github.com/directus/app/issues/new?template=Bug_report.md) or the [API](https://github.com/directus/api/issues/new?template=Bug_report.md). **For all security related issues, please chat with us directly through [directus.io](https://directus.io/).**
* **Requesting Features** — Feature requests are managed as GitHub issues within the appropriate Directus repository. Before making a new submission, first [browse existing feature requests](https://github.com/directus/app/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3Aenhancement) using the `enhancement` label. If you find a similar request, simply vote for it using the :+1: or :-1: reactions and add any additional context in the comments. If _not_, [add a new feature request](https://github.com/directus/app/issues/new?template=Feature_request.md) by completing the provided template.

### Online Demos

We have two online demos available so you can easily check out Directus in action. These demos are public and is therefore susceptible to trolls who think it's funny to write offensive things or change the master user password. The entire database is reset each hour to mitigate this. The login credentials for both demos: `admin@example.com` and `password`

* **[Stable](https://directus.app)** — This demo showcases the [latest release](https://github.com/directus/directus/releases/latest) of the Directus suite.
* **[Nightly](https://nightly.directus.app)** — This demo uses the [latest commits](https://github.com/directus/directus/commits/master) from the `master` branch.

<p>&nbsp;</p>

## ❤️ Supporting Directus

Directus is a GPLv3-licensed open source project with development made possible by support from our core team, contributors, and sponsors. It's not easy building premium open-source software; if you would like to help ensure Directus stays free, please consider becoming a sponsor.

* [Become a backer or sponsor through Patreon](https://www.patreon.com/directus)
* [One-time donation through PayPal](https://www.paypal.me/supportdirectus)
* [Other ways to help](https://docs.directus.io/getting-started/supporting-directus.html)


### Contributing

We love pull-requests! To work on Directus you'll need to install it locally from source by following the instructions below. Submit all pull-requests to the `develop` branch of our `api` and `app` repositories.

* [Setup API Development Environment](https://docs.directus.io/advanced/source.html#api-source)
* [Setup App Development Environment](https://docs.directus.io/advanced/source.html#application-source)

If you want to dive right into the code and skip the manual setup of your development environment you can also spin up fully functional browser based development environments with a single click:

* [Start API Gitpod Workspace](https://gitpod.io/#https://github.com/directus/api)
* [Start APP Gitpod Workspace](https://gitpod.io/#https://github.com/directus/app)

### Sponsors

[RANGER Studio](http://rangerstudio.com), Bas Jansen

### Core Team

<table>
<tr>
<td>
<a href="https://github.com/benhaynes"><img width="160px" src="https://user-images.githubusercontent.com/522079/42234532-dfa61084-7ec2-11e8-96df-23aa48c6d450.jpg"><br>
Ben Haynes</a><br>
<i>Project Lead</i>
</td>
<td>
<a href="https://github.com/rijkvanzanten"><img width="160px" src="https://github.com/rijkvanzanten.png"><br>
Rijk van Zanten</a><br>
<i>App Lead</i>
</td>
</tr>
</table>

**[Advisors, Sponsors, Partners, and Key Contributors](https://directus.io/organization.html#the-team)**

<p>&nbsp;</p>

----

<p align="center">
Directus is released under the <a href="http://www.gnu.org/copyleft/gpl.html">GPLv3</a> license. <a href="http://rangerstudio.com">RANGER Studio LLC</a> owns all Directus trademarks and logos on behalf of our project's community. Copyright © 2006-2018, <a href="http://rangerstudio.com">RANGER Studio LLC</a>.
</p>
Directus is released under the [GPLv3](http://www.gnu.org/copyleft/gpl.html) license. [RANGER Studio LLC](https://rangerstudio.com) owns all Directus trademarks and logos on behalf of our project's community. Copyright © 2006-2019, [RANGER Studio LLC](https://rangerstudio.com).
170 changes: 170 additions & 0 deletions config/_example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<?php

// Directus Project Config Example

// Directus config files control everything that the API needs to know in order to run a project.
// This includes database credentials, where to save files, and what social providers to allow

return [
'database' => [
'type' => 'mysql', // Only mysql is supported
'host' => 'localhost',
'port' => 3306,
'name' => 'directus',
'username' => 'root',
'password' => 'root',
'engine' => 'InnoDB',
'charset' => 'utf8mb4',
// 'socket' => '', // Path to socket. Remove the `host` key above when using sockets
// 'driver_options' => [ // Other MYSQL_PDO options. Can be used to connect to the database
// // over an encrypted connection. For more information, see
// // https://www.php.net/manual/en/ref.pdo-mysql.php#pdo-mysql.constants
// PDO::MYSQL_ATTR_SSL_CAPATH => '/etc/ssl/certs',
// ]
],

'cors' => [
'enabled' => true, // Enable or disable all CORS headers
'origin' => ['*'], // Access-Control-Allow-Origin
'methods' => [ // Access-Control-Allow-Methods
'GET',
'POST',
'PUT',
'PATCH',
'DELETE',
'HEAD',
],
'headers' => [], // Access-Control-Allow-Headers
'exposed_headers' => [], // Access-Control-Expose-Headers
'max_age' => null, // Access-Control-Allow-Max-Age
'credentials' => false, // Access-Control-Allow-Credentials
],

'rate_limit' => [
'enabled' => false, // Enable or disable all rate limiting
'limit' => 100, // Number of requests allowed...
'interval' => 60, // ...during this interval (in seconds)
'adapter' => 'redis', // Where to save the rate limit tmp data
'host' => '127.0.0.1',
'port' => 6379,
'timeout' => 10 // Timeout from API to rate limit storage adapter
],

'storage' => [
'adapter' => 'local', // What storage adapter to use for files
// Defaults to the local filesystem. Other natively supported
// options include: Amazon S3, Aliyun OSS
// You'll need to require the correct flysystem adapters through Composer
// See https://docs.directus.io/extensions/storage-adapters.html#using-aws-s3

'root' => 'public/uploads/project-name/originals', // Where files are stored on disk
'thumb_root' => 'public/uploads/project-name/thumbnails', // Where thumbnails are stored on disk
'root_url' => '/uploads/project-name/originals', // Where files are accessed over the web

'proxy_downloads' => false, // Use an internal proxy for downloading all files

// S3
////////////////////////////////////////
// 'key' => 's3-key',
// 'secret' => 's3-secret',
// 'region' => 's3-region',
// 'version' => 's3-version',
// 'bucket' => 's3-bucket',
// 'options' => [
// 'ACL' => 'public-read',
// 'Cache-Control' => 'max-age=604800'
// ],
// 'endpoint' => 's3-endpoint',

// Aliyun OSS
////////////////////////////////////////
// 'OSS_ACCESS_ID' => 'aliyun-oss-id',
// 'OSS_ACCESS_KEY' => 'aliyun-oss-key',
// 'OSS_ENDPOINT' => 'aliyun-oss-endpoint',
// 'OSS_BUCKET' => 'aliyun-oss-bucket',
],

'mail' => [
'default' => [
'transport' => 'smtp', // How to send emails. Supports `smtp` and `sendmail`
'from' => 'no-reply@example.com', // The sender of the email

// SMTP
////////////////////////////////////////
'host' => 'smtp.example.com',
'port' => 25,
'username' => 'smtp-user',
'password' => 'd1r3ctu5',
'encryption' => 'tls'
],
],

'cache' => [
'enabled' => false, // Cache all API responses
'response_ttl' => 3600, // Keep the cache for n seconds
'pool' => [
'adapter' => 'apc', // What adapter to use to store the cache in
// Supports: apc, apcu, filesystem, memcached,
// memcache, redis

// Filesystem
////////////////////////////////////////
// 'path' => '../cache/',

// memcached, memcache, redis
////////////////////////////////////////
// 'host' => 'localhost',
// 'port' => 11211,
],
],

'auth' => [
'secret_key' => '1234', // Used in the oAuth flow
'public_key' => '9876',
'social_providers' => [
// 'okta' => [
// 'client_id' => '',
// 'client_secret' => '',
// 'base_url' => 'https://dev-000000.oktapreview.com/oauth2/default'
// ],
// 'github' => [
// 'client_id' => '',
// 'client_secret' => ''
// ],
// 'facebook' => [
// 'client_id' => '',
// 'client_secret' => '',
// 'graph_api_version' => 'v2.8',
// ],
// 'google' => [
// 'client_id' => '',
// 'client_secret' => '',
// 'hosted_domain' => '*',
// 'use_oidc_mode' => true,
// ],
// 'twitter' => [
// 'identifier' => '',
// 'secret' => ''
// ]
]
],

'hooks' => [ // https://docs.directus.io/extensions/hooks.html#creating-hooks
'actions' => [],
'filters' => [],
],

'tableBlacklist' => [], // What tables to globally ignore within Directus

'env' => 'production', // production, development, or staging
// Production silences stack traces and error details in API output

'logger' => [
'path' => '../logs', // Where to save warning and error logs for the API
],

'feedback' => [
'token' => '123', // Not currently used
'login' => true // Not currently used
],
];
Loading

0 comments on commit b08b3a2

Please sign in to comment.