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

--embed usage example seems incomplete #203

Closed
camhux opened this issue Sep 14, 2024 · 2 comments · Fixed by #204
Closed

--embed usage example seems incomplete #203

camhux opened this issue Sep 14, 2024 · 2 comments · Fixed by #204
Labels
documentation Improvements or additions to documentation

Comments

@camhux
Copy link
Contributor

camhux commented Sep 14, 2024

In the documentation for --embed, the example Caddyfile uses fs embedded directives as though the embedded filesystem is pre-declared.

In my own testing, I found that xcaddy had rather created a submodule of caddy.fs named embedded, which meant I still had to declare a filesystem in the global options block to be able to serve files from the embedded FS, which in the example would look like this:

{
	filesystem embedded embedded
}

foo.localhost {
	root * /foo
	file_server {
		fs embedded
	}
}

bar.localhost {
	root * /bar
	file_server {
		fs embedded
	}
}

Without this instantiation in the global options block, the debug output from the server would warn about attempts to use an undeclared filesystem.

I'm pretty new to Caddy and xcaddy, so I'm curious if there's something I've missed about how this sample usage is supposed to work, or if this is a case where the example should be updated for completeness.

@mohammed90
Copy link
Member

Good catch! The virtual filesystem feature of Caddy changed in v2.8.0, and the documentation here was missed.

@mohammed90 mohammed90 added the documentation Improvements or additions to documentation label Sep 16, 2024
@camhux
Copy link
Contributor Author

camhux commented Sep 16, 2024

Always happy to bring fresh eyes 😃 Updated the example here: #204

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

Successfully merging a pull request may close this issue.

2 participants