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

Make "isProduction" default to true unless explicitly in development #657

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

7f8ddd
Copy link

@7f8ddd 7f8ddd commented May 27, 2024

This causes, for example, /bun:info to leak system information, when the NODE_ENV is not explicitly set to production. Some users may use prod, dev, staging, etc., so this fixes that problem.

This is much safer than assuming the user has their environment set to production. This causes, for example, /bun:info to leak information, when the environment isn't explicitly set to production.
@7f8ddd 7f8ddd changed the title Make "isProduction" default to false unless explicitly in development Make "isProduction" default to true unless explicitly in development May 27, 2024
@butcher73
Copy link

Defaulting to production can hide important debugging information, increase the risk of accidental deployments and security issues, and complicate the development process, so it's safer to default to development mode.

@kravetsone
Copy link
Contributor

This causes, for example, /bun:info to leak system information, when the NODE_ENV is not explicitly set to production. Some users may use prod, dev, staging, etc., so this fixes that problem.

bad idea

@7f8ddd
Copy link
Author

7f8ddd commented Jun 29, 2024

Defaulting to production can hide important debugging information, increase the risk of accidental deployments and security issues, and complicate the development process, so it's safer to default to development mode.

Except this only applies to the Bun server internally and has no effect on what environment variable you're using. If you're using this export, you have other problems.

@butcher73
Copy link

I see, I misunderstood you at first. However, I still don't agree with setting it to 'prd' by default. I believe it's better to require the environment variable to be explicitly set before running. This way, the user must intentionally specify the mode, ensuring they have considered whether they want to run in development or production mode.

@7f8ddd
Copy link
Author

7f8ddd commented Jun 30, 2024

I see, I misunderstood you at first. However, I still don't agree with setting it to 'prd' by default. I believe it's better to require the environment variable to be explicitly set before running. This way, the user must intentionally specify the mode, ensuring they have considered whether they want to run in development or production mode.

Why would the user want the internal Bun server in development mode? All it does is leak information. If anything, it should be made a config option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants