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

Security Enhancement #956

Closed
wants to merge 3 commits into from
Closed

Security Enhancement #956

wants to merge 3 commits into from

Conversation

binaryYuki
Copy link
Contributor

reference: #947
This pull request introduces several changes to enhance the functionality and security of the application, including rate limiting, environment configuration updates, and UI improvements for server settings.

Security and Performance Enhancements:

  • apps/api/src/index.ts: Added rate limiting middleware to limit each IP to 100 requests per 15 minutes, enhancing security against potential abuse.

Environment Configuration:

  • apps/api/src/index.ts: Modified the server to bind to all network interfaces if EXPOSE_ALL_INTERFACES is set to true, otherwise binds to localhost.
  • apps/dokploy/.env.example: Added EXPOSE_ALL_INTERFACES environment variable to the example environment configuration file.

UI and State Management:

Server Configuration:

  • apps/dokploy/server/server.ts: Updated the server to use the EXPOSE_ALL_INTERFACES environment variable to determine the host binding, ensuring consistency with the new configuration setting. [1] [2]

Enhance server security by defaulting to 127.0.0.1:3000 and adding rate-limiting.

* Change the default host to `127.0.0.1` in `apps/api/src/index.ts` and `apps/dokploy/server/server.ts`.
* Add a rate-limiting middleware to the `app` instance in `apps/api/src/index.ts`.
* Introduce an environment variable `EXPOSE_ALL_INTERFACES` to toggle exposing `0.0.0.0` in `apps/dokploy/server/server.ts` and `apps/dokploy/.env.example`.
* Add a toggle for `EXPOSE_ALL_INTERFACES` in the `WebServer` component in `apps/dokploy/components/dashboard/settings/web-server.tsx` with a warning about the associated risks.
Enhance security by changing default host and adding rate-limiting
@binaryYuki binaryYuki marked this pull request as draft December 21, 2024 13:04
@binaryYuki
Copy link
Contributor Author

I think i mess up something. Will re-open if needed.

@binaryYuki binaryYuki closed this Dec 21, 2024
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.

1 participant