Code Monkey home page Code Monkey logo

h5ai's Introduction

h5ai

license web github

A modern HTTP web server index for Apache httpd, lighttpd, and nginx.

Important

  • Do not install any files from the src folder, they need to be preprocessed to work correctly!
  • Find a preprocessed package and detailed install instructions on the project page.
  • For bug reports and feature requests please use issues.

Build

There are installation ready packages for the latest releases and dev builds. But to build h5ai yourself either git clone or download the repository. From within the root folder run the following commands to find a fresh zipball in folder build (tested on linux only, requires node 10.0+ to be installed, might work on other configurations).

> npm install
> npm run build

License

The MIT License (MIT)

Copyright (c) 2020 Lars Jung (https://larsjung.de)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

References

h5ai profits from other projects, all of them licensed under the MIT license too. Exceptions are some Material Design icons (CC BY 4.0).

h5ai's People

Contributors

bskim45 avatar carloshbcabral avatar clementperon avatar cyesu avatar dfransway avatar fx02 avatar jcsrb avatar kleofass avatar kuoruan avatar lclzd avatar lrsjng avatar marekhrabe avatar medicalwei avatar neelfyn avatar orzfly avatar peterdavehello avatar rsertelon avatar salgnt avatar sindresorhus avatar sirgue avatar sushidude avatar thomo avatar tobleminer avatar tomer avatar tvdw avatar unix4you2 avatar whadar avatar woet avatar wstrm avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

h5ai's Issues

[ovh hosting] .php files is interpreted

On webhosting ovh.it the file .php is interpreted. Uncomment one of the /h5ai/.htaccess line not work.
Good handler is:

AddHandler default-handler php phtml php3 php5
RemoveType .php .phtml .php3 .php5

But not work on h5ai + ovh.

PHP does not render

Hi Lars,

H5ai is great! Sadly the PHP version does not work on my setup. It just show the actual php code ( getHtml() etc. )

I'm testing H5ai on my local machine:
Windows
Apache 2.2.1
PHP 5.2.10

Some characters in filenames are not decoded

The new h5ai v0.20 is really nice, many thanks.

A small bug:
There are rawurlencode() in *.php and decodeURI() in scripts.js. These two functions, however, are not exactly corresponding. Some characters (i.e. '#', '=', '+') are encoded by rawurlencode() ('%23', '%3D', '%2B'), but not decoded by decodeURI(), so some filenames and directory names are not displayed correctly.

I think we should just replace decodeURI() with decodeURIComponent().

NGinx version

I'd like have a version over nginx server. It's possible one day ?

Feature request

It's a bit annoying to get error lines in the Apache logs when searching for the non-existent _h5ai.header.php / _h5ai.footer.php files in each folder. I can change the Apache config to hide them, but it would be nice to have an option in config.js to turn off that behavior. I bet most people aren't using the custom files anyway.

Edit: Removed Request 2: The default apache config files already do IndexIgnore ??*, they just need to be imported. My bad.

Thumbs do not appear when the URL contains " ' " character

I'm using h5ai v0.17 (js).

I edit _h5ai/config.js
"showThumbs": true,
to show image thumbnails. That works fine and image thumbnails are displayed correctly.

But I noticed that the thumbs do not appear when the URL contains single-quote character.

I've confirmed that the problem does not occur when I change the 2 places in _h5ai/js/main-js.js
+"?action=thumb&href="+e.absHref+
to
+"?action=thumb&href="+e.absHref.replace(/'/g,"%27")+
.

can not get h5ai create thumbnails

Could you please advise what is the problem? H5AI any does not want to create thumbnails, but the page shows the features that create thumbs and everything else works.
I use Debian, 6 and tried apache2 + mod_php, nginx + php-fcgi - all the same. Maybe some kind of magic in the php.ini option is needed?
Have a look at http://ftp.ocean.ru/ and http://ftp.ocean.ru/_h5ai/
Thanks.

Selecting specific files (on Mac)

It would be great if possible to select multiple specific files. However that's not possible, maybe something like pressing Command or Control button or even checkboxes?

Tree issues

Hey, today I downloaded new version of h5ai and I really like new feature - tree. But I think, that it needs some improvments.

First - I hate when I walk in my folders (using icons, not tree) and on every page tree shows and hides itself. It's little annoying.

And second - maybe consider to use some alternative scrollbar (there are plenty of jQuery plugins to make custom scrollbars), because it looks like this (on Windows) and it's really not as pretty as the rest of h5ai http://sklad.marekhrabe.eu/zobrazit/tree.png

Anyway thanks for your work, this project is awesome. I'd like to see some updates on forrst ;)

100% cpu usage in chrome

loading up h5ai (js variant) in stable or canary chrome and my page freezes with 100% cpu usage.
:/

The "alias" installation is now incompatible with thumbnails

Since h5ai v0.19, The "alias" installation (set an alias /_h5ai/ to the folder h5ai, not copy) and the thumbnail function do not work together. I'm sure that the problem is the absolute path of /_h5ai/cache.The problem won't be solved by the configuration "ROOT_ABS_PATH" in config.php.

For instance:

DocumentRoot  /path-to-docs/
Alias /_h5ai/ /path-to-h5ai/_h5ai/

in case "ROOT_ABS_PATH" => dirname(dirname(__FILE__)) (by default):

  • the thumb-source path = /path-to-h5ai/(...)/filename.jpg incorrect
  • the cache file path = /path-to-h5ai/_h5ai/cache/thumb-(...).jpg correct

in case "ROOT_ABS_PATH" => $_SERVER['DOCUMENT_ROOT']:

  • the thumb-source path = /path-to-docs/(...)/filename.jpg correct
  • the cache file path = /path-to-docs/_h5ai/cache/thumb-(...).jpg incorrect

Then in both cases thumbnails won't be created.

I've made some symbolic links which refer the subfolders of path-to-docs in the folder path-to-h5ai for the present.

h5ai appears empty

Hi everyone,

H5ai looks great so far. I'm using the JavaScript version, but everything appears empty on my setup, meaning no files or folders are showing.

I'm testing H5ai on my local machine:

linux
Apache 2.2.1
MySQL: 5.1.56

Can anyone help me resolve this, I'd appreciate it.

Feature request: option to expand tree for folders with an index

It should be possible to browse all your document root's contents even in folders that have an index file. You probably wouldn't want this setting on a public website, but it's nice for development.

I think this can only work with PHP, unless there's a way for apache to only serve index.html for regular browser requests, and send the directory contents if it's an AJAX request.

Red "(0)" after every folder name

Is there a way to stop h5ai from showing "(0)" after every folder? I didn't have this with version 0.13, but now with 0.15.2. Maybe it has something to do with the installation being password protected using htaccess?

Not working with Apache/1.3.41

Hello,

I am trying to put this working, but I have the following issues (I'm using the JS version of .htaccess):

  1. The content window always shows the message "EMPTY"
  2. I had to comment out some IndexOptions directive. The following will show a configuration error on the browser and write a "Invalid directory indexing option" error in the logs:

IndexOptions Type=text/html;h5ai=0.15.2

IndexOptions Charset=UTF-8

IndexOptions HTMLTable

IndexOptions XHTML

IndexOptions SuppressRules

IndexOptions VersionSort

Can this be made to work?

Thanks!

Bug: Broken localization in footer.

All labels are changed correctly when I use language selector.
But footer text - #folders - #files - is switched back to English, when I navigate to other folder.

Both versions(JS and PHP) are affected.
h5ai ver. 0.19

instructions missing

I think you should add more instructions about the following parts of the installation process.

  • how to compile the less-file
  • how to create the script.js file
  • how to use the build process

What do you think?

Folder appear empty in main view, but are double listed in tree view

Folders with some white space characters (and some other characters) appear empty in the main view, but are double listed in the tree view (left sidebar).

This only happens in some browsers: latest Opera confirmed

This seems to be related to encoding/decoding of URLs between JavaScript and PHP

Updates

It seems you missed another post of mine so i thought I'd open a new issue.

"There is a new version of jQuery 1.7.2 and Modernizr 2.5.3. Not sure if they are worth updating or if you have updated them already in your local repository."

Thanks for your hard work!

Back behavior

It seems that the back action is not like they should be. For example enter a folder and then try to go back by clicking the back button on your browser. You'll need to press it 3 times (in my case) to actually go back to the previous folder.

I'm using v0.18 (JS) and Firefox 12 b4. With IE 9 I have to click 2 times to go back. Forward works as expected (only 1 time).

Not sure if that's a limitation or a bug. But it would make sense if the behavior was the standard one.

Thanks!

non-SSL stylesheet causes browser warning

h5ai uses Google Web Fonts.

header.html:
<link rel=​"stylesheet" href=​"http:​/​/​fonts.googleapis.com/​css?family=Ubuntu:​regular,italic,bold">

It is very nice! But when I use h5ai in my SSL (https://~~~) website, browser warns "mixed content warning".
We should not use any non-ssl contents in ssl websites.

Luckily, Google Web Fonts prepares its SSL version ( https://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold ).
I think it is better to use the SSL web font (always, or switch SSL/non-SSL web font automatically; both OK).

Page title not respected across the pages

Hello. Many thanks for this wonderful script!

I noticed something which I'm not sure if it should be considered a bug or a feature request. Even though I've changed the title in header.html my choice isn't shown across the pages. Instead the domain is shown as the title.

I'm using v0.18 (JS).

Thanks!

set apache for use it on all folder

There is a method for config apache to use h5ai on every folder?
insert the modified htaccess is so boring for the folder that i have on /var/www XD

Sorting question

Should the sorting used be remembered across browsing? At the moment when one browses to another folder the default sorting is used. Maybe it's useful but I'm not sure if everyone prefers it. :)

h5ai 0.17 issue

I just upgraded from 0.16 to 0.17. While 0.16 worked perfectly for me in both js and php modes, the new 0.17 is completely broken. The javascript version sort-of works, but folders are displayed as "unknown". They still work, but the icon is wrong and folders are not shown at the top. The PHP version is completely broken. It won't parse correctly.

I have made sure that my installation is correct by reinstalling from scratch, given that the .htaccess file is now simpler, the config.js file is new, and that the name of the h5ai folder has changed. It's simply not working. BTW: I did download the package from http://larsjung.de/h5ai/ and NOT from github, as usual.

I really like the way the new version is structured, it will be a lot easier/cleaner to setup and configure once it works. Please have a look at the process you use to process the source. I bet it's the culprit.

*.txt preview

It would be nice to add a feature which adds opening *.txt file in a nice designed page. Now when I opening any *.txt file I see poor view of the selected file.

In this small preview feature you can put following options:

  • font-size selection
  • font-family selection
  • encoding selection

(everything connected with cookie or Web Storage based settings save)

Of course if it is possible to override standard Apache behaviour for *.txt file ;)

BTW h5ai is a really nice work - I'm always looking forward for new version with the new nice features :)

Add an option in config for favicon

Another small request. I believe it's one of the most common features so perhaps you could add an option in config.js or php to set up the favicon for all the pages. Currently one has to edit the header.html or use a custom header.html.

Thanks!

Support for mouse scrolling in the language selection popup

Not sure if this is easy to implement but it would be handy if mouse scrolling worked in the language selection popup.

BTW, I believe the languages' names should start with a capital letter, but the current way is probably by design. :)

How to enable zip, tar and more?

Hello,

I've got a VPS with just PHP5-FPM, MySQL 5.5 and NginX installed and h5ai says that it currently doesn't support shell tar, shell zip, pdf thumbs and folder size.

I was wondering how I'd got about enabling them. I've install the Debian 6 versions of php5-ffmpeg and ffmpeg but still lists movie thumbs as unsupported.

A push in the right direction would be greatly appreciated.

Cheers,
Scott

EDIT: I've removed exec_shell from disabled_functions in my php.ini and it seems to added support for all now.

Command-click tab-opening disabled in Safari

On Safari 5.1.2, it seems that h5ai doesn't play well with Safari's normal behaviour of being able to command-click a link, and having that link open in a new tab. Not sure why. Right(or control)-clicking the link, and then selecting Open in New Tab from the contextual menu works however.

Not a massive big deal, just thought I'd let you know!

not working for the root directory?

i installed h5ai (js version) on my localhost and it works fine for all subfolders but for the root directory http://localhost/.
what can i do to add the functionality for my root too?

update: it works great!
sorry, i just had to delete my old index.php in the root dir ;-)

Issue when downloading multiple folders

[06-Apr-2012 13:01:51] PHP Notice: Use of undefined constant code - assumed 'code' in /Users/Nikola/Sites/h5ai.dev/_h5ai/php/inc/ZipIt.php on line 85
[06-Apr-2012 13:01:51] PHP Stack trace:
[06-Apr-2012 13:01:51] PHP 1. {main}() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/api.php:0
[06-Apr-2012 13:01:51] PHP 2. ZipIt->zip() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/api.php:119
[06-Apr-2012 13:01:51] PHP 3. ZipIt->zipDir() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/inc/ZipIt.php:42
[06-Apr-2012 13:01:51] PHP Notice: Use of undefined constant code - assumed 'code' in /Users/Nikola/Sites/h5ai.dev/_h5ai/php/inc/ZipIt.php on line 85
[06-Apr-2012 13:01:51] PHP Stack trace:
[06-Apr-2012 13:01:51] PHP 1. {main}() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/api.php:0
[06-Apr-2012 13:01:51] PHP 2. ZipIt->zip() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/api.php:119
[06-Apr-2012 13:01:51] PHP 3. ZipIt->zipDir() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/inc/ZipIt.php:42
[06-Apr-2012 13:01:51] PHP Notice: Use of undefined constant code - assumed 'code' in /Users/Nikola/Sites/h5ai.dev/_h5ai/php/inc/ZipIt.php on line 85
[06-Apr-2012 13:01:51] PHP Stack trace:
[06-Apr-2012 13:01:51] PHP 1. {main}() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/api.php:0
[06-Apr-2012 13:01:51] PHP 2. ZipIt->zip() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/api.php:119
[06-Apr-2012 13:01:51] PHP 3. ZipIt->zipDir() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/inc/ZipIt.php:42
[06-Apr-2012 13:01:51] PHP Notice: Use of undefined constant code - assumed 'code' in /Users/Nikola/Sites/h5ai.dev/_h5ai/php/inc/ZipIt.php on line 85
[06-Apr-2012 13:01:51] PHP Stack trace:
[06-Apr-2012 13:01:51] PHP 1. {main}() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/api.php:0
[06-Apr-2012 13:01:51] PHP 2. ZipIt->zip() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/api.php:119
[06-Apr-2012 13:01:51] PHP 3. ZipIt->zipDir() /Users/Nikola/Sites/h5ai.dev/_h5ai/php/inc/ZipIt.php:42

OS: Lion 10.7.3
MAMP 2.0.5 — PHP 5.3.6

Fallback when nojs

Hi,

Would it be possible to have a fallback when javascript is unavailable?

We currently have a blank page.

Thanks,

Alex

PHP - strange output on lion apache2

I'm seeing a bunch of "toHtml(); ?>" output on apache2 on lion. I replaced default index.html.en, and placed a5ai.conf (php.htaccess) into /private/etc/apache2/other/. This allows me to retain the default of not allowing .htaccess. I did try allowing .htaccess with identical results. PHP 5.3.6 default for Lion.

need click twice on ipad

I want to open a file or a directory on my ipad's safari,but when i clicked it , it seems that it just selected the file ,i had to click it once more to open it .
This may not happen on version v0.19. I wander why.
Hope you could understand what i mean. :)
Thanks.

PHP Version not working with userdir

Hi I'm using h5ai on an userdir enabled virtualhost.

I copied h5ai dir in the document root of the virtualhost and created .htaccess in directories where needed. It's just work fine with the JS version but not with the PHP's version.

I got these two warnings :

PHP Warning: filemtime(): stat failed for [DocumentRoot]/users in [DocumentRoot]/h5ai/php/extended.php on line 17
PHP Warning: filesize(): stat failed for [DocumentRoot]/users in [DocumentRoot]/h5ai/php/extended.php on line 24

Additionnaly download functionnality isn't working at all in this scenario the problem seems related to PHP file functions again.

PHP Warning: fsockopen(): unable to connect to www.mydomain.com:80 (Connection timed out) in [DocumentRoot]/h5ai/php/h5ai.php on line 243
PHP Warning: fwrite() expects parameter 1 to be resource, boolean given in [DocumentRoot]/h5ai/php/h5ai.php on line 248
PHP Warning: fgets() expects parameter 1 to be resource, boolean given in [DocumentRoot]/h5ai/php/h5ai.php on line 249
PHP Warning: fclose() expects parameter 1 to be resource, boolean given in [DocumentRoot]/h5ai/php/h5ai.php on line 259

My userdirs are available via the tilde notation www.mydomain.com/~login and www.mydomain.com/users/login (using mod_rewrite). This is why we see a /users in log but this directory doesn't exists.
More my document root and my homes dorectories dosn't share the same root my doc root is in /var/www/www.mydomain.com/ whereas my homes are in /home/ (NFS moiunted).

Thanks for taking this case in consideration.

——

Error from my side. No issue.

The CSS corrections to be applied by the main-php.less file are not included in the distributed main.css file, making the PHP version unusable without JS, effectively destroying all degradability.


This is problematic in itself, but also highlights the two main difficulties I see for this project (this is constructive criticism, really :) ):

  1. maintaining two versions (PHP/JS) of what should be a single, progressively degraded web page is too much work for a project with this governance (if both had been fully tested, you would have seen the problem, but full testing is a lot of work);
  2. having a non-standard build process makes it difficult to collaborate :(

This last paragraph is really just notes, I'm still thanking you a lot for sharing your code, and will keep on helping by reporting / correcting when I can.

Modification time question

I wonder should the modification time change if a subdolder is modified?

For example let's say we have the following structure:

folder/subfolder

If the folder "subfolder" is modified shouldn't its parent's folder modification time change too?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.