Giter Site home page Giter Site logo

oupala / apaxy Goto Github PK

View Code? Open in Web Editor NEW
1.9K 62.0 256.0 384 KB

a simple, customisable theme for your apache directory listing

Home Page: https://oupala.github.io/apaxy/

License: GNU General Public License v3.0

CSS 27.92% HTML 13.31% JavaScript 12.94% Dockerfile 11.45% Shell 34.38%
apaxy apaxy-themes css icons mime-types customisable-theme docker

apaxy's Introduction

Apaxy

apaxy is a customisable theme built to enhance the experience of browsing web directories. It uses the mod_autoindex Apache module - and some css - to override the default style of a directory listing.

Table of contents

Features

Apaxy may be basic, but it gives you a great deal of creative freedom when styling your directory.

  • style your directory listing with css
  • make it pop with javascript
  • add welcome messages, download instructions or copyright notices
  • add custom media type icons (requires editing the .htaccess file)
  • use custom error pages

Sadly, visual style is all you can work with. It's not possible to alter the generated table structure of the listing directory with Apaxy.

Installation

apaxy requires an apache (2.2.11+) http server. The configuration of the apache http server have to set an AllowOverride statement for the Apaxy styled folder:

AllowOverride Options Indexes FileInfo

Quick start

If you would like, you can automate the installation of Apaxy with the included apaxy-configure.sh script.

To get started, first open apaxy.config in your favorite editor, then edit the apacheWebRootPath and installWebPath variables to correspond to your server's settings. Save the file and exit.

You can set some parameters of apaxy.config on the command line instead of the config file. You can see the documentation of the cli with the following command: apaxy-configure.sh -h.

Then run the configuration script as a user that can write to the installWebPath directory. With apache under debian, this would be the www-data user:

$ sudo -u www-data ./apaxy-configure.sh

The files will be copied to the web server directory, and modified automatically based on the settings specified.

Manual install

Let's assume you have a folder named share in your server root directory (the path thus being http://mywebsite.com/share) that you'd like to use as your listing directory:

  • download and unzip apaxy
  • copy and paste the contents of the /apaxy folder to your /share folder
  • edit htaccess.txt (now in the /share folder) and update all instances of paths marked with {FOLDERNAME} to point to your site root

So...

AddIconByType (gif,{FOLDERNAME}/theme/icons/gif.png) image/gif

Should be changed to...

AddIconByType (gif,/share/theme/icons/gif.png) image/gif
  • if you want to enable the gallery feature, overwrite the header and footer files:
mv footer-lightgallery.html footer.html
mv header-lightgallery.html header.html
  • edit footer.html, along with all the other html documents (in the /share/theme folder) and update all instances of paths marked with {FOLDERNAME} to point to your site root

So...

<script src={FOLDERNAME}/theme/apaxy.js></script>

Should be changed to...

<script src=/share/theme/apaxy.js></script>
  • once done, rename htaccess.txt to .htaccess in the /share directory
  • treat yo'self, you're done!

Docker image

A local Demo can be started with docker.

docker-compose up

Apaxy themes

If you'd like to alter the default Apaxy theme, look in the /theme folder and you'll find the following files:

  • header.html
  • footer.html
  • style.css

Edit these as you would any other html or css file.

Adding your own icons is a little more involved. You'll need to edit the main Apaxy .htaccess file. Look for the following as an example:

AddIconByType (gif,{FOLDERNAME}/theme/icons/gif.png) image/gif

The above rule will assign an icon named gif.png from the directory {FOLDERNAME}/theme/icons/ to any file whose media type is image/gif.

This url path is relative to your site's root.

Media types

The default apaxy theme /themes/apaxy has icons in place for the following media types:

3dml 3ds 3g2 3gp 7z aac adp ai aif aifc aiff apk appcache asf asm asx atom au avi azw bat bin bmp bpk btif bz bz2 c cab caf cb7 cba cbr cbt cbz cc cgm class cmx com conf cpp css csv curl cxx dcurl deb def deploy dic diff dist distz djv djvu dll dmg dms doc docx dot dra dsc dtd dts dtshd dump dvb dwg dxf ecelp4800 ecelp7470 ecelp9600 elc eol eps epub etx exe f f4v f77 f90 fbs fh fh4 fh5 fh7 fhc flac fli flv flx fly for fpx fst fvt g3 gif gv gz gzip h h261 h263 h264 hh hpp htm html ico ics ief ifb in iso jad jar java jpe jpeg jpg jpgm jpgv jpm js json kar ktx latex list log lrf lvp m1v m2a m2v m3a m3u m3u8 m4a m4u m4v Makefile man mar markdown mcurl md mdb mdi me mid midi mj2 mjp2 mk3d mka mks mkv mmr mng mobi mov movie mp2 mp2a mp3 mp4 mp4a mp4v mpe mpeg mpg mpg4 mpga mpkg ms msi mxu n3 nfo npx odb odc odf odft odg odi odm odp ods odt oga ogg ogv opml otc otf otg oth oti otp ots ott p pas patch pbm pct pcx pdf pgm php phtml pic pkg pls png pnm pot ppm pps ppsx ppt pptx prc ps psd py pya pyv qt ra ram rar ras rb README rgb rip rlc rmi rmp roff rpm rss rtf rtx s s3m sass scss scurl sfv sgi sgm sgml sh sid sil smv snd so spot spx sql sub svg svgz t tar tex text tga tif tiff torrent tr tsv ttc ttf ttl txt udeb uri uris urls uu uva uvg uvh uvi uvm uvp uvs uvu uvv uvva uvvg uvvh uvvi uvvm uvvp uvvs uvvu uvvv vcard vcf vcs viv vob wav wax wbmp wdp weba webm webp wm wma wml wmls wmv wmx woff woff2 wvx xbm xht xhtml xif xla xlc xlm xls xlsx xlt xlw xm xml xpmxwd xsl zip

Gallery

You can enable a gallery feature on apaxy. This feature is based on lightgallery.js.

See installation section for more information.

Troubleshooting

Make sure the options set in .htaccess files of Apaxy can actually be changed. This means that you need to allow to override the used options in your apache configuration of the directory apaxy used with: AllowOverride Indexes.

Find more information in the in the apache documentation.

Credits

apaxy owes its existence to the amazing h5ai by Lars Jung. Had I not seen this, I would never have looked into making my own (probably way less useful) version.

Faenza icons are used in the apaxy theme. Faenza icon theme has been released under GPLv3 licence.

Licence

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

apaxy's People

Contributors

adamwhitcroft avatar bastienwirtz avatar chbrandt avatar derrend avatar drewrockshard avatar erikboesen avatar filipopo avatar guysoft avatar hazcod avatar intigabriel avatar ionmx avatar james2doyle avatar leek avatar madmas avatar oupala avatar peterdavehello avatar sheeit avatar snorpey avatar szepeviktor avatar tjk16384 avatar uksusoff avatar varemenos avatar vivernet avatar waqast 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

apaxy's Issues

style subdirectories

The style is applied in the main directory, but not in subdirectories, as the paths are relative:

If I'm listing /share/**, and the apaxy theme folder is in /share/theme, and there's a subdir /share/asdf, styles are looked up under /share/asdf/theme/**..

Is there a way to fix this? or do I have to write a RewriteRule for */theme/*?

Remove padding from mobile client

Sorry, I can't do pull requests yet. But here's quick workaround to remove padding from mobile screens.

body {
    padding:0;
    -webkit-backface-visibility:hidden;
}

@media (min-width: 768px) {
    body {
        padding:20px;
        -webkit-backface-visibility:hidden;
    }
}

Question/Request for Download Count

I don't know if this is even possible, as this is all new to me. Can the displayed page have a download counter displayed per file? I know I can look up stats through other means, but I would like something displayed for the people visiting and downloading the files.

Thank you for such an amazing little gem. Apaxy is a great tool.

I apologize is this is not where this question belongs.

Use local copy of the Open Sans font

Hi, I've noticed Apaxy requests the Open Sans font from fonts.googleapis.com + fonts.gstatic.com (https://github.com/AdamWhitcroft/Apaxy/blob/master/apaxy/theme/style.css#L8). Would you be OK to include this font in the release archive, and use that copy by default instead?

Some advantages: No cross-site requests, no leaking of HTTP Referers to font provider, works on LAN-only setups, no dependency on an external service, only 1 connection initiated.

The Google Fonts @include can be left commented out for users that want to re-enable it.

The current TTF fonts used by fonts.googleapis.com can be found at https://github.com/google/fonts/tree/master/apache/opensans. I can start working on a patch, including a Makefile to fetch the latest version from there.

Folders created at the root directory of the example folder do not show the theme

I created folders in the root directory where the example files are placed. When I open the folder from the browser, it does not show the theme. It shows missing images on the page. When I copied the theme folder into this new folder, the theme displayed properly.

Is there a straightforward way of solving for this without having to copy the theme folder inside every folder and without symlinks inside each folder?

Entry for .exe files is missing

In htaccess file is no entry for exe files, but the png is still there in icons folder.

AddIcon /{FOLDERNAME}/theme/icons/exe.png .exe

Use protocol agnostic path for font import.

I'm serving this over https and I get a mixed content error due to the following import statement:

@import url('http://fonts.googleapis.com/css?family=Open+Sans');

Changing this to

@import url('//fonts.googleapis.com/css?family=Open+Sans');

should work for both HTTPS and HTTP as the google servers serve up the correct css.
🐱

lightGallery integration for display images in colorobox-like mode

lightGallery very nice work with apaxy.

Just add this in header.html:

<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.3.9/css/lightgallery.min.css" /> 

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.3.9/js/lightgallery.min.js"></script>

<script type="text/javascript">
$(document).ready(function () {
    var imageSelector = [
        '.indexcolname a:contains(".jpg"):not(:contains(".json"))',
        '.indexcolname a:contains(".jpeg"):not(:contains(".json"))',
        '.indexcolname a:contains(".png"):not(:contains(".json"))',
    ].join(', ');

    var $table = $('table'),
        $images = $table.find(imageSelector);

    if ($table.length && $images.length) {
        $table.lightGallery({
            selector: imageSelector,
            mode: 'lg-fade',
            download: true
        });
    }
});
</script>

ASK

Can i use this for lighttpd ?

Header & footer don't work with basic auth + mod_headers

I came across a weird issue that causes the server to stop listing files altogether, here's my setup:

  • Server at http://localhost
  • Directory root at /var/www/html, apaxy setup under that directory (/var/www/html/theme for reference)
<Directory /var/www/html>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>
  • http://localhost/resources <-- directory to list
  • http://localhost/backend <-- reverse proxy to my backend app
<IfModule mod_headers.c>
RequestHeader unset Authorization
</IfModule>
ProxyRequests Off
ProxyPass /backend http://127.0.0.1:3000
ProxyPassReverse /backend http://127.0.0.1:3000
  • I want everything under http://localhost/* to be protected by basic auth, including access to /backend
<Location />
    AuthType Basic
    AuthName "By Invitation Only"
    AuthUserFile /etc/apache2/htpasswd
    Require valid-user
</Location>
  • Authorization header should not pass on to backend, done by RequestHeader unset Authorization (requires mod_headers)
  • I don't have control over the backend app and contents of /resources

With this setup and config pieces, style.css gets applied but there's no content in the table that's supposed to list the directory, neither does header/footer.html show up in response HTML.

This problem goes away if I remove basic auth, or if I disable mod_headers. I can't figure out how those might HeaderName & ReadmeName. Not sure if its an issue with this theme or my config.

sub directory Not listing

Hi it's work great but one problem sub directory listing not working existing styles showing how can i fix this ..

apache 2.4.10

Hi all,
anyone succesfully using apaxy with apache 2.4?
I'm trying it but css is not loaded and standard apache index is proposed
Thanks

add actual demo

It would be nice if we could link to an actual demo of Apaxy instead of showing a screen shot. I think this would make it easier evaluate Apaxy and see how it looks and works on small screen devices.

If an actual demo is not feasible, maybe a we could link to an HTML + CSS dummy?

Breadcrumb

Hello, i add breadcrumb to apaxy, tell me if you want to up or see it.
Thx!

Does this work with lighttpd?

Does this theme work with lighttpd aka. lighty?

It's similar to Apache but more lightweight.
It has the ability to add a custom CSS file so I thought it shouldn't be pretty hard to get it working.

Hide DOT files?

Hello,
in my directory listing .htaccess and some other dot files are showing up, I'de like them to be hidden, is that possible ?

thanks in advance.

Re-directing failure

Hello,

Great theme but it seems to have broken redirects. When I click on a folder it does not redirect to the internal files. (ie. click on folder expecting to load the internal index.html but i get a white screen)

Theme chooser/installer

Hi,

are you interested in a theme chooser/installer.
Currently, the process of installation a little bit manual, I suggest a shell script with user prompt (with some well default values according to the current working directory) to define the htaccess file (and move the .txt to .htaccess (see #9)).

If there are several subfolders in a so called "themes" directory, ask for user to choose the one to be installed.

Litespeed?

Will/should Apaxy work on a Litespeed server? Are there additional configuration considerations... since Litespeed servers handle Apache configs the same?

Server name being stripped from URL for sub directories

Apache2 on Ubuntu 16.04, /var/www/html contains the standard index.html location. I place .htaccess and theme in this folder and I can see the CSS styling works nicely. However there is a subfolder I use also in /var/www/html and when I hover over the subfolder icon 'http://servername/' gets stripped from the URL (http://servername/subfolder) and the URL just becomes 'subfolder' so I can't reach the subfolder. I can access the subfolder fine if I just manually enter 'http://servername/subfolder' myself. Also only happens with Chrome. Works fine with IE

Cannot get Apaxy to work

Hello,

I have a very basic setup. I have Apache installed on Ubuntu and my path is /var/www/html/test. There are a few files in the 'test' folder. I followed the directions to copy the contents from apaxy to the 'test' folder and renamed htaccess.txt to .htaccess in both the test/ folder and theme/folder. However, when I browse to the directory, it shows the default file listing. Is there something else that I need to do?

Instructions seems pretty straightforward. I restarted Apache but that didn't help. Any assistance would be deeply appreciated.

Padding on icons

I think it would look much better if you added some padding-left (10px) to the cell containing the icon.

That would look something like this:

comparison

Cheers,
Henry

Charset

How to set default charset?
File names with ã is showing çÃ

Thanks.

combine with .htpasswd ?

Hi,

I would like to combine apacy with basic authentication.

When I try to add:

AuthName "secure"
AuthUserFile .htpasswd
AuthType Basic
Require valid-user

I get a server error ...

Any idea how to solve this ?

thank you,

Edd--

Missed Type Description

AddIconByType (TXT,/theme/icons/text.png) text/*
AddIconByType (IMG,/theme/icons/image.png) image/*
AddIconByType (SND,/theme/icons/audio.png) audio/*
AddIconByType (VID,/theme/icons/video.png) video/*

Different header and footer for two directories

If I have the following directory structure

share
|_ videos
    |_ theme
|_ software
|_ .htacess

and my .htaccess with the configuration is under share, but I am also able to see software, which I want to share too but with a different HTML header and footer in each directory, how can I do that? is it possible?
Thanks


I found out that putting other theme and a .htaccess that overrides the parent worked.

Installed Apaxy, not working

I use WampServer and I created a folder named "shared" in the same directory that contains the folder that holds my files. Here's a photo:

It still doesn't work and I get this:

Can this be fixed? Thanks!

Keep description cell

I'd like to keep the Description cell in the table. How can I style it? Specifically the width of it?

can not show in each level dir

131 <Directory "/var/www/html">
132     #
133     # Possible values for the Options directive are "None", "All",
134     # or any combination of:
135     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
136     #
137     # Note that "MultiViews" must be named *explicitly* --- "Options All"
138     # doesn't give it to you.
139     #
140     # The Options directive is both complicated and important.  Please see
141     # http://httpd.apache.org/docs/2.4/mod/core.html#options
142     # for more information.
143     #
144     Options All MultiViews
145 
146     #
147     # AllowOverride controls what directives may be placed in .htaccess files.
148     # It can be "All", "None", or any combination of the keywords:
149     #   Options FileInfo AuthConfig Limit
150     #
151     AllowOverride All
152     #
153     # Controls who can get stuff from this server.
154     #
155     Require all granted
156 </Directory>

Then i try to test each level dirs and find only the first dir can have style.
I find a way to slove it is that cp theme dir to each level dir.
Is there any better way to slove it?

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.