Add "security" commands to api CLI#9400
Merged
rijkvanzanten merged 16 commits intodirectus:mainfrom Jul 20, 2022
Merged
Conversation
Member
|
We can wait until this change is approved, but we'll need to make sure docs are also added as part of this PR. |
Contributor
Author
Right! I totally forgot the docs, sorry, I'm going to work on it later today |
…directus into feat/cli-security-commands
Contributor
Author
|
A few updates:
Oh, and the HubSpot js code was - for some reason - embedded two times in some page and I had to remove the duplicates because Vue was complaining about multiple root elements |
rijkvanzanten
requested changes
Nov 3, 2021
Contributor
Author
|
Ok, at the end I removed the feature to automatically update the |
rijkvanzanten
requested changes
Jun 30, 2022
…directus into feat/cli-security-commands
rijkvanzanten
approved these changes
Jul 20, 2022
qborisb
pushed a commit
to qdentity/directus
that referenced
this pull request
Jul 22, 2022
* add command to generate app key * add command to generate secret * group security commands under the security group * add new security commands to cli docs * add disclaimer on deploy secret generation * remove duplicate hubspot embed code * remove .env overwrite feature to security commands * update the cli docs for security commands * return key generation directly in output * restore package-lock.json * Write secret directly Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR implements two new CLI commands. I thought they could be useful especially when cloning a project and, of course, you have to setup your own
.envfile or when deploying on production and need to setup the environment variables.Key generation
It generates the
KEYvariable. You can additionally use the--showflag to avoid the.envoverwrite and just display it in the terminal.Secret generation
It generates the
SECRETvariable. You can additionally use the--showflag to avoid the.envoverwrite and just display it in the terminal.Both commands will fail if no
.envfile is found in the cwd and the flag--showis omitted:Notes: I named them like this because I'm used to Laravel
key:generate --showcommand, but let me know if you'd prefer another name or if we should group them under asecuritygroup, like commands under theusersgroup etc.