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

Handle "include" Directive #16

Closed
mohammed90 opened this issue May 6, 2020 · 1 comment · Fixed by #20
Closed

Handle "include" Directive #16

mohammed90 opened this issue May 6, 2020 · 1 comment · Fixed by #20
Labels
good first issue Good for newcomers

Comments

@mohammed90
Copy link
Member

Currently (commit 00eef4c at the time of this writing), the adapter doesn't completely handle include directive. There's primitive support for the directive, which is why it is not documented as supported. Big part of the reason is due to difficulty in resolution of the absolute path of the file to be included. The resolution problem should be easy to solve now using the https://github.com/hairyhenderson/go-which project and manipulating the PATH env var within the scope of the adapter.

@mohammed90 mohammed90 added the good first issue Good for newcomers label May 6, 2020
@mohammed90
Copy link
Member Author

The adapter could receive the file from various sources, e.g. command line or API. Config received through the command line will receive the file name which was passed to Caddy, which will subsequently pass it to the Adapt method via the options parameter, see:

https://github.com/caddyserver/caddy/blob/9408dacc272e60759aa90ab4766d95bfde3d5fb1/cmd/commandfuncs.go#L470-L475

The base of this initial config should be considered as one of the possible bases.

If the config is received through the API, then the file name isn't available.

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

Successfully merging a pull request may close this issue.

1 participant