Commit Graph

107 Commits

Author SHA1 Message Date
Brainslug
ffdbb04ccb Added session token note to sso docs. (#22431)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>
2024-05-08 12:41:19 +00:00
Daniel Biegler
c893b9fa65 Add public registration (#22125)
* WIP: add new register dummy-route

* fix notice on register route

* WIP register form

* WIP: registering ui and controller for testing

* fix lint ordering problem

* wip: users service

* add migration, initial style for fields in settings

* redo how emails will be filtered

* WIP add filter in the register handler

* conditionally render register link depending on settings

* WIP: add email validation

* wip add email sending

* make clicking the email link work

* rm console log

* update controller

* dont send emails for existing emails

* add translation

* only show register link when unauthenticated

* add different redirects

* only allow selecting non-admin roles

* redirect to users page

* update translation

* move logic from controller to usersservice

* rm remnant of logic from controller

* add stall time to registration

* update translation

* rm comments

* rm unused var

* add changeset

* update translation for success

* remove sso related stuff from registration

* also allow setting first and last name

* update error check

* add @directus/errors to app

* replace error strings with enum

* rename to public_registration

* rename to public_registration_verify_email

* add notes to fields

* add types package to changeset

* dont stall if no work is being done

* allow null-role and resending of reg. email

* add public registration env vars, rm RATE_LIMITER_GLOBAL_STORE

RATE_LIMITER_GLOBAL_STORE wasnt being used. Lets just stick to RATE_LIMITER_STORE for all rate limiters. TODO: also remove from docs!

* use ratelimiter for registration, use stall time env var

* add registration limiter docs, rm global store variable from docs

* update changeset

* add ignore-notice

Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>

* use and document new `EMAIL_VERIFICATION_TOKEN_TTL`, also doc `REGISTER_STALL_TIME`

* change variable name

Co-authored-by: ian <licitdev@gmail.com>

* apply variable rename to usage

* change backticks to single quote

Co-authored-by: ian <licitdev@gmail.com>

* inline variables

* add fields to server info, update types

- The other ratelimiters also expose points and duration, done
- Add `public_registration_verify_email` so that we can render different success messages

* tiny wording tweak of registration mail

* add new user status 'unverified' and check for it

* add unverified status translation

* decouple email verification and validation

* enable register rate limiter by default and up its config

* add autocomplete=new-password on the registration form

* added sdk functions

* add gql query for new fields

* added register api reference

* updated verify sdk function name

* added reference block for email verify endpoint

* updated reference examples

* WIP: add gql resolvers

* add ratelimiter to mutation

* remove ratelimiter registration point+duration info

* rm points and duration from gql

* Update docs/reference/system/users.md

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

---------

Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Brainslug <tim@brainslug.nl>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-05-07 23:20:24 +02:00
Rijk van Zanten
ec2604f913 Don't require KEY or SECRET to be set on startup (#22320)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-05-06 13:00:10 +00:00
Alex van der Valk
57a39d54f1 docs - add cache auto purge to compose (#22305)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-04-24 09:45:23 +00:00
José Varela
bf47a19428 API: Prevent endless loop on get-schema (#22230)
* Prevent endless loop on `get-schema`

* Make magic value configurable

* Fix linter warning

* Add changeset

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2024-04-17 15:50:27 -04:00
Nico
b983d1fcf0 Add env variables to configure PM2 log paths + documentation (#22155)
* Add env variables to configure PM2 log paths + documentation

* Sign Contributor License Agreement

* Run prettier fix

* Add changeset

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2024-04-10 11:01:45 -04:00
daedalus
aa5f13063f docs(email templates): incorrect sample path (#22022) 2024-03-29 22:34:10 +01:00
José Varela
dbf6667850 Docs / SSO: Fix docs about session cookie on Seamless mode (#21983)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-03-26 16:47:34 +00:00
Rijk van Zanten
f0e910ee58 Add LRU cache to GraphQLSchema generation (#21783)
* Install mnemonist

* Add LRU cache for graphql schema

* Add changeset

* Update api/src/services/graphql/index.ts

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Add env var to /env and docs

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-03-11 17:23:34 -04:00
Rijk van Zanten
c24dc0079a Add REDIS_ENABLED env var (#21809)
* Add REDIS_ENABLED env var

* Add changeset

* Remove previous attempt
2024-03-11 17:08:50 -04:00
Pascal Jufer
c9cfda4fdb Update docker guide docs to persist extensions volume (#21725) 2024-03-08 17:51:54 -05:00
Rijk van Zanten
839fdb10bd Add missing var 2024-03-07 17:29:11 -05:00
Rijk van Zanten
3072a1aa57 Document max limit 2024-03-07 14:48:12 -05:00
Rijk van Zanten
bd168545d0 Add support for EMAIL_TEMPLATES_PATH (#21729)
* Load custom templates from templates path

* Fix name

* Add changeset

* Fix missing env vars in tests

* Fix name typo

* Move email templates to self hosted section

* Add breaking change note

* Add redirect for old file
2024-03-06 15:48:21 -05:00
Kevin Lewis
740b7ca48b Docs: Move Migrations out of Extensions (#21719)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-03-06 13:14:40 +00:00
Pascal Jufer
82b23a57d4 Add the Directus Marketplace (#21674)
* Add support for MIGRATIONS_PATH (#20627)

* Deprecate "local" extension types (#20624)

* No longer resolve local non-package extensions

* Remove local extensions from watcher

* Install fs-extra for app dev

* Replace usage of get-extensions

* Rename create functions to match behavior

* Drop extensions prefix from cli create

* Drop name requirement from cli add

* Drop extensions name regex checks

* Don't rely on regex for extension identification

* Add changeset

* Fix build for @directus/extensions

* Don't ensure nested dirs

* Load npm dependency by name prefix

* Throw more helpful error when pkg json is missing

* Fix dependency loading paths

* Only load local extensions if extensions path exists

* Fix merge conflict

* Remove unused fs-extra

* Only sync extensions if location is defined

* `extensions` -> `localExtensions`

* Fix resolving of package extensions

- consistent usage of term "package extensions"
- enhance error messages

* Fix syncing extension from storage

* Revert-revert change from #20627

---------

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Add back `MIGRATIONS_PATH` to `@directus/env` (#21053)

* Setup browse endpoint for browsing Directus extensions (#21033)

* Rename tag directus-custom to directus-extension

* Devil's in the details

* [WIP] Start on search lib

* Setup extensions-registry package

* Update pnpm lock

* Move registry search fn to new package

* Squash bugs

* Remove unused deps

* Remove unused dep in `extensions`

* Add tests for validate-limit

* Finish test coverage

* Remove unused constant

* Add back lodash-es 😇

* Install extensions-registry

* Add default keywords

* Expose registry endpoint in rest api

* Add describe module

* Reinstal pnpm

* Drop reliance on author field

The problem is that there's no requirement for it to be a valid(ated) user. Publisher is the only field we can rely on being an existing NPM user.

* Update convertSearchResult test after author change

* Format

* Allow anything after the route

To support packages with scopes

* Add test for describe

* Add more tests

* Throw unprocessablecontenterror instead of error

* Install errors pkg

* Finish test coverage

* Don't require description

* Don't wrap individual keywords

* Run formatter

* Add changeset

* Update packages/extensions-registry/src/modules/search/utils/validate-text.ts

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Return sandbox information

* Drop support for directus-custom keyword

* Set type to null for multiple tags

* Restart api for new registry

* Add version utility

* Add out-of-date error

* Add assertion for api versions

* Finish new list method

* Add describe

* Use updated registry functions

* Fix controller usage

* Return output in data flag to be consistent

* Add tests for the describe module

* Add tests for list module

* Finish tests for extensions-registry package

* Remove vscode shenanigans

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Project Forum: Browse UX (#21276)

* Render marketplace route in-app

* Update api list integration

* Add support for limit/offset in list

* Boilerplate route for drawer

* Render extension readme in drawer

* Render extension detail as separate page

* Setup markup for extension banner

* Render readme with markdown styling

* Boilerplate metadata block

* Use v-list for extension metadata metrics

* Render compatibility metric

* Show downloads and publish date

* Refactor to individual files

* Fix missing import

* Add size metric

* Show author on metadat

* Show verified badge

* Finish metadata

* Run formatter

* Style forum detail banner (#21290)

* Style banner contents

* Add background art

* Add banner styles to default dark mode theme

* Undo base style change to avoid conflict

* Add beta chip badge to settings nav (#21296)

* Add layout styling for detail page (#21297)

* Render metadata as grid if size allows

* Finish layout for detail page

* Fix alignment of count

* Fix search-input active state

* Finalize forum header

* Add marketplace banner

* Style registry filter

* Change v-list-item height to min-height

Allows rows for forum registry to grow

* Finalize styling for extension list item

* Finalize styling for registry

* Don't rely on format util

* Forum account detail page (#21299)

* Add support for author describe endpoint

* Boilerplate author page

* Add author endpoint

* Update naming to account

* Render github name on registry list

* Render user's name + avatar on detail

* Load account data on account page

* Restructure module

* Render account banner on account page

* Render account metadata

* Finish account detail page

* Run formatter

* Add sidebar info detail sections

* install extensions from registry (#21070)

* added an endpoint to install extensions from registries

* add changeset

* Revert format/lint scripts

* Update pnpm-lock

* Remove unused dependency

* Add download module to extensions-registry abstraction

* Download from extension registry instead of direct npm

* Throw on error

* Install based on version ID rather than name

* Install based on ID in body

Allows us to extend it in the future if need be

* Download to tmp path instead of extensions

* Save to extensions manager flattened

* Use const for package folder name

* Run more in try/catch to avoid server exit

* Remove changeset

* Undo docs updates

We'll do all docs in a single PR :)

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>

* Manage extensions by directus_extensions primary key instead of npm package name (#21300)

* Add marketplace migration

* Include bundle info

* Rename name to folder

* Store name as folder

* [WIP] Change name to ID

* Update API to use UUIDs for extensions

* Update app to use extensions id

* Run formatter

* Add changeset

* Update generate-app-entrypoint to use updated format

* Fix graphql usage

* Format

* Add forum uninstall endpoint (#21301)

* Bootstrap uninstall

* Finish uninstall endpoint

* Use shared extensions store state for managing extensions in settings (#21317)

* Use extensionsstore for extensions management

* Use shared store for extensions state and modification

* Remove unused emit

* Adds install/uninstall GUI elements for project forum (#21319)

* Use warning color for incompatible

* Styling tweaks

* Transition optional background color

* Add keys for installing

* Add install button to extension detail

* Finish install button

* Add uninstall option to extensions item

* Empty local cached extensions on start

* Add (hopefully) temporary hack to await reload

* Add install / uninstall buttons

* Update lockfile

* Fix bundle entries not rendering properly

* Clean up spinner styling

* Properly wait for reload to be done

* Run formatter

* Fix registry name

* Fix local extension loading

* Render location/company in byline

* Rearchitect metadata to unstyled listitems

* Add max-width to page container

* Only allow admins to install/uninstall extensions

* Remove unused link

* Disable eslint for map use

* Run formatter

* Add no-results indicator (#21389)

* Add no-results indicator

* add error state as well

* Standardize trailing slash

* Standardize pk check

* Resolve unnecessary check

* Move all deps to dev deps in app

* Optimize exec order

* Pull data from top level package

* Redesign filter bar

* Reset page count on filter change

* Use default padding on top of page

Feels weird now, but there's a theme-update coming that'll make this make sense :)

* Show first/last in pagination

* Auto-format package name

* Use updated registry api return names

* Add sorting by total downloads

* Add sparkline for downloads

* Add a bit of padding

* Finalize sparkline styling

* Run formatterg

* Add sandbox flag in list call

* Add MARKETPLACE_TRUST env var

* Set sandbox requirement on download

* Render list item badge

* Fix padding

* Show license in gui

* Add support for multiple maintainers

* Add activity tracking for install

* Make incompatibility notice friendlier

* Tweak margin of sparkline

* Update default CSP headers to include github content

* Make extension readme selectable

* Consistent icon, add tooltips

* Reduce size of install button

* Run formatter

* Render readme anchors with target blank

* Add min width to v-select components

* Fix background on search input

* Reduce padding on marketplace pages

* Fix showing no results

* Be consistent

* Render type filter menu in full height

* Clean up compatibility notice

* Hide count result when search count is 0

* Use v-show instead

* Bump no results notice down a bit

* Cleanup size of install buttons

* Use buttons for install / author

* Fix sparkline rendering

* Add better loading state for extension detail page

* Add spinners

* Render proper error message in case readme is missing

* Use heart logo for marketplace

* Add image border shadow

* Add loading banner on account page

* Show reload warning as persistent notification

* Only show one notification

* Update snapshot

* Add padding to verified icon

* Base extensions id on package id, show installed badge

* Sync pagination / search / filter with URL

Special shoutout to Tim

* Next max ext (#21541)

* Add limit exceeded error

* Add limit exceeded translation

* Add extensions_limit env var

* Load extensions limit in app

* Don't allow installing unknown versions

* Don't require installed flag

* Return bundled entries in describe

* Update chip to match style

* Prevent install on limit reached

* Run formatter

* Fix bundle loading

* Resolve npm extensions by package manifest (#21478)

* Merge main into next (#21669)

* Clean-up deps

* Don't export type (as long as not used anywhere)

* Update semver to latest

* Relax compatibility notice

* Use more suitable icon for version

* Re-render download charts on color-scheme change

* Link extensions to marketplace

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Mahendra Kumar <22556323+mahendraHegde@users.noreply.github.com>
2024-03-04 14:34:59 -05:00
Brainslug
37a63bd9ea Added redirect allow list note (#21679)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-03-04 14:34:15 +00:00
Brainslug
0be4703c7f updated SSO docs for the new session token (#21677) 2024-03-04 15:29:40 +01:00
Brainslug
5477d7d61b Fix URL Redirection in OAuth2/OpenID/SAML (#21238)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2024-03-04 04:43:48 +00:00
Brainslug
77d73398f1 Session Based Authentication (#21239)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-03-04 01:59:45 +01:00
Pascal Jufer
9f536270b9 Fix a few inaccuracies in auth provider docs (#21662) 2024-03-03 17:44:20 +01:00
Kevin Lewis
4073324d3b Marketplace Documentation (#21458)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-03-02 14:50:29 +00:00
Pascal Jufer
7811d83884 Clean-up MESSENGER_* config options (#21452) 2024-02-16 12:15:28 +01:00
Pascal Jufer
77346cf639 Clean-up request IP validation (#21370) 2024-02-14 15:37:51 +01:00
Waldi
b1e7bf4f1f Fix boolean error in docker-compose quickstart template (#21336) 2024-02-06 16:01:20 +01:00
Pascal Jufer
8db8241cc4 Update exif-reader to v2 (#20820)
* Update exif-reader to v2

* Add changeset

* Update changeset

* EXIF -> exif

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2024-01-31 15:24:38 -05:00
Kevin Lewis
f1e6301d4b Added missing link in config, typo fix in flows reference (#21131) 2024-01-18 15:46:14 +01:00
Pascal Jufer
a6e2712e09 Use official abbreviation of Exif (#21030) 2024-01-10 14:42:40 +01:00
ian
4a3a65cfde Add support for IP ranges and CIDR notations (#20971)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-01-09 00:44:09 +01:00
Rijk van Zanten
0b0db0f449 Deprecate Messenger in favor of shared Bus (#20862)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2024-01-06 23:49:38 +00:00
Kevin Lewis
fb7765e5e9 Add SQLITE_CANTOPEN and Default Admin Creds to Quickstarts (#20961) 2024-01-04 17:32:28 +01:00
Emmanuel Mahuni
75c1409a7e Update minimum NodeJS version requirement (#20939)
* Update cli.md NodeJS required version because of Sharp.

Update NodeJs minimum requirement to v18.17.0 because of Sharp new version requirements. See issue #20854

* Update contributors.yml

* Update cli.md

More specific as later versions of Node 18 work too

* Added changeset

---------

Co-authored-by: Kevin Lewis <kvn@lws.io>
2024-01-04 14:11:38 +00:00
Rijk van Zanten
c222511f1f Update telemetry (#20825)
* Setup shared redis abstraction

* Install directus/memory

* Add mini useEnv util for test mocking purposes

* Export missing class from directus/memory

* Update readme to include kv

* Uninstall memory

* Setup telemetry lib

* Reduce concurrency

* Finalize reporting

* Add tests for send-report

* Add tests for init

* Add tests for tracker

* Add tests for get-item-count

* Add test for wait time

* Add test for get-user-count

* Add test for get-user-item-count

* Fix type issue

* Throw error on non-ok fetch

* Init telemetry on server startup

* Tweak submission logic

* Fix tests, submit version

* Update config-options reference

* Cool kids don't use + in large numbers

* Add changesets

* Update docs/self-hosted/config-options.md

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Use vi stubGlobal

* Update api/src/env.ts

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Unstub as well

* Mock telemetry start in app test

* Update api/src/telemetry/types/report.ts

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>

* Fix default value in env

* Use toBoolean for env var casting

* Don't rely on knex as

Apparently it doesn't work reliably with count()

* Update api/src/telemetry/lib/init-telemetry.ts

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>

* Use getDatabaseClient for consistent clients

* Rename ingress->url

* Send my apologies to the formatting bot

* Fix version

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2023-12-21 14:08:42 -05:00
Pascal Jufer
dfefb5368a Fix dead links in documentation (#20794) 2023-12-19 18:16:17 +01:00
weberet
b0f43e8658 Document DB_SSL__CA Environment Variable (#20616)
Co-authored-by: Kevin Lewis <kvn@lws.io>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-12-18 17:20:21 +00:00
Gerard Lamusse
f79dbef7c0 Fix example output for array environment syntax prefix (#20771)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-12-17 13:43:54 +00:00
Nick Crews
72a3eb3716 Add .env info to docker-compose guide (#20725)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Brainslug <tim@brainslug.nl>
2023-12-13 17:58:36 +00:00
Brainslug
2f3fdace80 Docs update nodejs version 18 (#20586)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-11-30 13:34:14 +00:00
Pascal Jufer
f4c75ba8a6 Fix SSO SAML examples in docs (#20569) 2023-11-29 11:30:41 +01:00
Pascal Jufer
387cf0cd35 Docs: Config / Data improvements (#20532) 2023-11-27 12:17:43 +01:00
Azri Kahar
a11fb2b59d Allow configuration to prevent server startup when an extension fails to load (#20495)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-11-23 16:37:57 +00:00
daedalus
fdb2e42b29 Add ability to ignore specific paths from the HTTP logger (#20368)
* add changeset

* Add the ability to ignore specific paths from HTTP logger

* fix linting

* Cast env, clean-up, add test

* Use dedicated env config name

* Add docs

* Clean-up

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-11-16 15:31:42 -05:00
Rijk van Zanten
7df84c0a89 Add support for EXTENSIONS_LOCATION setting (#20207)
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-11-16 13:29:03 +00:00
Pascal Jufer
1e2ee8dec8 Use double quotes for compose in docker guide (#20395) 2023-11-11 13:29:20 +01:00
Abdón Rodríguez
2c287d1062 Fix self-hosted quickstart indentation (#20252) 2023-10-30 10:28:32 -04:00
Kevin Lewis
e650df7255 Added extensions volume of self-hosted quickstart (#20246) 2023-10-30 09:41:18 +01:00
cyril
039608b5b1 Fix a 404 on the Self-Hosted CLI doc page (#20234)
Fix  #20233
2023-10-29 03:39:32 +01:00
Azri Kahar
c80f8ee247 Fix caching for Content Versioning (#20153) 2023-10-26 11:25:09 +02:00
Rijk van Zanten
cde4dc6c78 Run Directus in PM2 Cluster mode in Docker Image (#18998)
* Send ready state to pm2

* Run with pm2

* Add ecosystem config

* Fix cjs naming

* Add start command

* Increase kill timeout retry

* Set PM2 config through environment variables

* Add changeset

* Add config options for pm2

* Add additional config options

* Add more wordssssssssss

* Update Dockerfile

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Update ecosystem.config.cjs

Co-authored-by: Wryn (yage) Wagner <yage@yage.io>

* Default to undefined instead of empty string

* Update docs to match safer defaults

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Wryn (yage) Wagner <yage@yage.io>
2023-10-25 15:34:26 -04:00
Stephan Schmitz
6db94a9765 Use double quotes for docker-compose.yml snippets in docs (#20093)
* Update quickstart.md

Depending on the Docker version, single quotes result in an "Top-level object must be a mapping" error. The use of double quotes should be safe for all version.

* Update contributors.yml
2023-10-21 09:18:18 -04:00