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

Listing of http server directory #283

Closed
linev opened this issue Jan 23, 2024 · 1 comment
Closed

Listing of http server directory #283

linev opened this issue Jan 23, 2024 · 1 comment
Assignees

Comments

@linev
Copy link
Member

linev commented Jan 23, 2024

It is nice to be able list all files on http server and be able open them from JSROOT GUI.

Unfortunately, there is no standard way to list files on http server.
The only one can do - issue request to server directory and try to parse produced HTML file.

Feature is implemented as &dir=<url> parameter, but tested only with Apache http server.
It requires extra settings to work. One need to enable listing and enable CORS for returned HTML file.
Content of .htaccess file is:

# allow indexing of files
Options +Indexes
# Or, compress certain file types by extension:
AddEncoding gzip .gz
<FilesMatch "\.json.gz">
  ForceType application/json
</FilesMatch>
<FilesMatch "\.json">
  ForceType application/json
</FilesMatch>
<FilesMatch "\.xml">
  ForceType text/xml
</FilesMatch>
# Allow access from all domains for web fonts
<IfModule mod_headers.c>
    <FilesMatch "">
       Header set Access-Control-Allow-Origin "*"
       Header set Access-Control-Allow-Headers "range"
       Header set Access-Control-Expose-Headers "content-range,content-length,content-type,accept-ranges"
       Header set Access-Control-Allow-Methods "HEAD,GET"
    </FilesMatch>
</IfModule> 

In such configuration one can do listing like:

https://jsroot.gsi.de/dev/?dir=https://jsroot.gsi.de/files/

Feature will appear in version 7.6

@linev linev self-assigned this Jan 23, 2024
@linev linev changed the title Listing of server directory Listing of http server directory Jan 23, 2024
@linev
Copy link
Member Author

linev commented Feb 23, 2024

@linev linev closed this as completed Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant