-
Notifications
You must be signed in to change notification settings - Fork 38
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
Ambiguous .meta handling #271
Comments
It is also not great, that a And because it is called "Meta-Presets", according to the docs, it shouldn't have any impact on the status of a reply. So another file like If I sound overly negative, I'm happy to report that I like Agate a lot. |
Sorry, I found this a bit hard to follow, so let me summarize your points to make sure we are on the same page:
Assuming I understood you correctly, I'll try to answer these concerns:
|
Citing from the docs to clarify:
I'm not a Rust expert, btw. Re: same page:
An example of what's not working. My only
First try, accessing root first before requesting allowed secret: (I added
Second try, directly requesting allowed secret:
Re: concerns:
|
It is confusing to talk about different things in one issue. I made a separate issue #272 for (2). The other issues with not using central config mode arise because of how
The documentation for this needs to be improved: If you are not using central configuration mode, the |
Yes, I understand. Unfortunately, the docs also have globs like
as an example to set the I think that #272 could solve many of these problems. |
The globs work properly in central configuration mode. I also have to take back what I said previously, the documentation already explicitly mentions this: Line 98 in 8f346d7
|
Agate uses
.meta
files to configure behavior for content files. It also has the ability to have a central version of this file by using--central-conf
or-C
as a start parameter.This is ambiguous, because while a central conf works for a single virtual host, it doesn't work as well for a properly configured single virtual host.
If only one hostname is used, then the server answers for any hostname, which is resolved by DNS to this server's IP. This is bad. You only want to answer for
example.com
, if you use--hostname example.com
, and notfoo.example.com
. Those subdomains might exists for other protocols, e.g. for rewritingwww.example.com
toexample.com
for HTTPS or vice-versa.This could somewhat be mitigated by using two hostnames
example.com
andexample.net
when starting Agate, where the latter domain doesn't have any DNS entries. Then the content has to live in/content/example.com
, if--content /content
is used, which is fine.But then the central conf has to live at
/content/.meta
having all entries to be prefixed withexample.com/
to honor the subdirectory. This can be quite a lot, if you want to host many virtual hosts.It would be much better, if the central conf for multiple vhosts would be located in the respective
/content/<vhost>
directories. This is currently not supported.Unfortunately, this works half-way, because there is a side-effect when having a single
.meta
in/content/example.com
without having--central-conf
configured.Given a file
/content/example.com/subdir/foo.txt
, ifgemini://example.com/subdir/foo.txt
is requested, it will be served correctly. But if the semi-central.meta
at/content/example.com/.meta
hassubdir/foo: ;charset=iso-8859-1
configured, it won't be used by accessinggemini://example.com/subdir/foo.txt
after restarting Agate, because the.meta
is expected at/content/example.com/subdir/.meta
, which is correct.But if
gemini://example.com/
is requested first, the.meta
at/content/example.com/.meta
will be loaded, which is also correct, but also applied for subsequent requests togemini://example.com/subdir/foo.txt
, which then would reply with20 text/plain;charset=iso-8859-1
.Regardless of the outcome of this issue, I consider this side-effect to be a bug.
Now, a single conf one for the whole server can get quite large for many vhosts, for example with many redirects after capsule reorganizations. And I also don't want to have one
.meta
in each directory, because after a capsule reorganization the appropriate directories to put the.meta
in might not exist anymore, and I don't want to keep those directories around just to have a.meta
in it. A central conf for each vhost would solve this dilemma.How is the feeling about this?
The text was updated successfully, but these errors were encountered: