EarthScope / ringserver

Apache License 2.0
30 stars 16 forks source link

separate WebRoot for serving MSeedWrite directory #13

Closed crotwell closed 5 years ago

crotwell commented 6 years ago

Would be nice to have a separate (and standard) URL endpoint for serving miniseed data archive via MSeedWrite to keep the mseed archive directory separate from normal files.

Also, making this a standard, maybe /mseed would make it easier to write clients that can interact with any ringserver with less special configuration.

Perhaps something like:

MSeedWrite /data/archive/%n/%s/%Y/%j/%n.%s.%l.%c.%Y.%j.%H
MSeedWebRoot /data/archive/

which would serve the contents of /data/archive via http as /mseed.

Additional nice thing would be to allow dir listing via http for this so clients can easily tell which mseed files exist, and if they are smart enough at parsing the pattern, could figure out what networks and stations exist and what the time range is for them.

Being able to get the pattern from the server would also be handy, maybe /pattern could return the part of MSeedWrite less that of MSeedWebRoot, so in this case it would return %n/%s/%Y/%j/%n.%s.%l.%c.%Y.%j.%H

chad-earthscope commented 5 years ago

ringserver refuses to serve files outside of the WebRoot for security. This is similar to Apache httpd and probably many other web servers, which require explicit permission to serve files from given locations.

I suggest doing what you want with a full blown web server, e.g. Apache httpd, and adding a few proxies for the endpoints that you want ringserver to serve, e.g. /streams, /seedlink, etc. There is no need to reinvent this wheel in ringserver itself.