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

Expose the service path prefix in a system environment variable #2267

Open
jvstme opened this issue Feb 5, 2025 · 0 comments
Open

Expose the service path prefix in a system environment variable #2267

jvstme opened this issue Feb 5, 2025 · 0 comments
Labels
enhancement A non-feature improvement

Comments

@jvstme
Copy link
Collaborator

jvstme commented Feb 5, 2025

Problem

Some web apps require additional configuration to work with a path prefix.

Currently, it's not possible to write a single type: service configuration for such apps that would work in all environments:

  • When a service is run without a gateway, its path prefix contains the project name, so it needs to be hardcoded in the configuration.
  • When a service is run with a gateway, the path prefix isn't there, so it needs to be omitted from the configuration.

Solution

Add a new system environment variable that would contain the path prefix, e.g. DSTACK_SERVICE_PATH_PREFIX. When running with a gateway, the variable can contain /.

Workaround

Hardcode the path prefix depending on the project and the gateway.

Would you like to help us implement this feature by sending a PR?

Yes

@jvstme jvstme added the enhancement A non-feature improvement label Feb 5, 2025
@jvstme jvstme changed the title [Feature]: Expose the service path prefix in a system environment variable Expose the service path prefix in a system environment variable Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A non-feature improvement
Projects
None yet
Development

No branches or pull requests

1 participant