Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ENV to allow hiding startup message #6348

Merged

Conversation

peterbaricic
Copy link
Contributor

@peterbaricic peterbaricic commented May 25, 2020

Hi,
our devops team wanted me to disable the startup message, but because there is no way to turn it off, I added an ENV STRAPI_HIDE_STARTUP_MESSAGE to allow user to hide the startup message.

I would also update the docs, but there is no documentation currently mentioning any existing logging ENVs like STRAPI_LOG_LEVEL, STRAPI_LOG_PRETTY_PRINT, STRAPI_LOG_FORCE_COLOR and STRAPI_LOG_TIMESTAMP.

Signed-off-by: Peter Baričič <pbaricic@gmail.com>
@peterbaricic peterbaricic force-pushed the feature/allow-hiding-startup-message branch from c98f580 to 1ea12a3 Compare May 25, 2020 21:49
@derrickmehaffy
Copy link
Member

@alexandrebodin @lauriejim maybe we need to make a place on the documentation to cover any existing environment variables in use? (For example the JWT_SECRET)

Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal env var should start with STRAPI.

@strapi strapi deleted a comment from codecov bot May 26, 2020
@codecov
Copy link

codecov bot commented May 26, 2020

Codecov Report

Merging #6348 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6348      +/-   ##
==========================================
- Coverage   19.99%   19.98%   -0.01%     
==========================================
  Files         858      858              
  Lines       12095    12094       -1     
  Branches     1965     1965              
==========================================
- Hits         2418     2417       -1     
  Misses       8092     8092              
  Partials     1585     1585              
Flag Coverage Δ
#front 14.67% <ø> (ø)
#unit 41.69% <100.00%> (-0.03%) ⬇️
Impacted Files Coverage Δ
packages/strapi-plugin-upload/services/Upload.js 17.03% <100.00%> (-0.62%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94e031e...408eaee. Read the comment docs.

Signed-off-by: Peter Baričič <peter.baricic@naytrolabs.com>
@peterbaricic peterbaricic force-pushed the feature/allow-hiding-startup-message branch from 3aae2f7 to a629e69 Compare May 26, 2020 08:39
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should revert the logic. The message should be displayed by default.

Signed-off-by: Peter Baričič <pbaricic@gmail.com>
@peterbaricic peterbaricic force-pushed the feature/allow-hiding-startup-message branch from 981be8b to ab0b1e1 Compare May 26, 2020 10:12
@alexandrebodin alexandrebodin added this to the 3.1.0 milestone May 26, 2020
@peterbaricic
Copy link
Contributor Author

why is travis always failing on E2E mysql (full pool)?

@derrickmehaffy
Copy link
Member

why is travis always failing on E2E mysql (full pool)?

You can ignore this for now, work is being done to try and solve this not only in tests but user projects as well (some default options I believe are set too low)

@alexandrebodin alexandrebodin modified the milestones: 3.1.0, 3.0.2 Jun 8, 2020
@alexandrebodin alexandrebodin added source: core:strapi Source is core/strapi package issue: enhancement Issue suggesting an enhancement to an existing feature labels Jun 8, 2020
@alexandrebodin
Copy link
Member

Hi @peterbaricic would you mind working on adding this var to the documentation ?

@lauriejim Can you tell us where you would put these docs ?

@peterbaricic
Copy link
Contributor Author

Sure, I can add it, just please point me to the right docs :-)

@alexandrebodin alexandrebodin removed this from the 3.0.2 milestone Jun 15, 2020
@lauriejim
Copy link
Contributor

Hello and sorry for the delay.
Since we haven't specific documentation for global env variable, I think you can add a paragraph on this page:
https://strapi.io/documentation/v3.x/cli/CLI.html#strapi-start

[...]. Certain features are disabled in the `strapi start` mode because they require application restarts.

Allowed environment variables:

| Property | Description | Type | Default |
| --------- | ----------- | ----- | ------- |
| STRAPI_HIDE_STARTUP_MESSAGE | [your description...] values can be `true` or `false` | string | `true` |

Having a table like this could be a good option.

@peterbaricic peterbaricic force-pushed the feature/allow-hiding-startup-message branch from 4ae613c to 408eaee Compare June 28, 2020 11:32
@alexandrebodin alexandrebodin added this to the 3.0.6 milestone Jul 16, 2020
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks for the addon !

Eventually I think we should replace the console logs with strapi logger so you can disable all the logs at once too

@alexandrebodin alexandrebodin merged commit 36ab614 into strapi:master Jul 16, 2020
gilfernandes pushed a commit to onepointconsulting/strapi that referenced this pull request Aug 13, 2020
* Add ENV to allow hiding startup message

Signed-off-by: Peter Baričič <pbaricic@gmail.com>

* Rename ENV

Signed-off-by: Peter Baričič <peter.baricic@naytrolabs.com>

* Revert the logic

Signed-off-by: Peter Baričič <pbaricic@gmail.com>

* Update docs with startup ENVs

Signed-off-by: Peter Baričič <pbaricic@gmail.com>

Co-authored-by: Peter Baričič <peter.baricic@naytrolabs.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
Signed-off-by: Gil Fernandes <gil.fernandes@onepointltd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: enhancement Issue suggesting an enhancement to an existing feature source: core:strapi Source is core/strapi package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants