Commit Graph

255 Commits (master)

Author SHA1 Message Date
Adrian Perez de Castro cbc0d3fca4 CI: Update mainline and stable Nginx versions for testing 2023-01-20 15:31:11 +02:00
Ryan Schmidt e5f227686a Add tests for case-(in)sensitive sorting 2023-01-20 15:26:16 +02:00
Mamadou Lamine NIANG a634077b5f Add case-insensitive name sorting support
Add the fancyindex_case_sensitive option which considers the case when
sorting by name if it is on (which it is by default to keep current
behavior) and does a case-insensitive name sort if it is off.

Closes #78
Closes #124

Co-authored-by: Ryan Schmidt <git@ryandesign.com>
2023-01-20 15:26:16 +02:00
Adrian Perez de Castro 674e99547d Add missing entry in long weekday names array
The entry for Saturday was missing, as pointed out in the bug report.
While at it, add a test case.

Fixes #157
2023-01-20 15:20:40 +02:00
Adrian Perez de Castro 1494521744 build-and-run: disable HTTP rewrite module
The HTTP rewrite module needs PCRE, which is not available in the GHA
MacOS runners. It is unused by the tests, so it's safe to disable
building it.
2023-01-20 13:59:17 +02:00
Danila Vershinin f50d7b799f Update available distros with module package
Fedora Linux has packages available, removed linking to old NGINX module package version
2022-07-19 15:54:45 +03:00
Ryan Schmidt 860a9cbd5e CI: add macOS test runners 2022-06-05 01:02:12 +03:00
Ryan Schmidt 2346fa9bde CI: Update to latest mainline and stable nginx 2022-06-05 01:02:12 +03:00
Adrian Perez de Castro 823f162085
Use the BSD license consistently
The t/preamble file incorrectly mentioned the MIT license before.
While at it, use SPDX license identification headers.

Closes #149
2022-05-26 00:40:58 +03:00
Ryan Schmidt 98f824ef91 get-pup: Use a fork of pup on recent macOS
Use a fork of pup on macOS 10.13 and higher because the binary provided
by the original project crashes immediately on those OS versions.

See https://github.com/ericchiang/pup/issues/85
2022-05-25 23:58:46 +03:00
Ryan Schmidt 8efe0b01fa Tests: Make test 02 more specific
Test for an opening table tag instead of just the word "table".
2022-05-25 23:53:42 +03:00
Ryan Schmidt e505eb2a13 Tests: Wait for nginx to create pid file
When nginx is started, it returns control before it has created its pid
file. Since this test suite relies on the existence of the pid file,
wait until the pid file exists before returning from nginx_start. Time
out after 2 seconds so that if there is a real problem starting nginx
we don't wait forever.

Fixes #144
2022-05-25 23:52:58 +03:00
Ryan Schmidt 778561eabf README.rst: Note MacPorts can install fancyindex 2022-05-25 23:52:14 +03:00
Ryan Schmidt 83bef5c8a6 Fix 404 not found when indexing filesystem root
Backport of 4c89c09ad8

Fixes #107
2022-05-25 23:51:27 +03:00
Ryan Schmidt b9ecd5bcb4 Tests: Fix typos in descriptions and messages 2022-05-10 22:04:11 +03:00
Ryan Schmidt 698e7ce4b9 get-pup: Verify with openssl instead of sha256sum
Use openssl to verify download because sha256sum does not exist on
macOS.
2022-05-10 21:58:05 +03:00
Ryan Schmidt 7ee6b81661 HACKING.md: Note MacPorts can install gawk too 2022-05-10 21:56:30 +03:00
Ryan Schmidt e8a4a7eced template.awk: Fix name of HACKING file
HACKING was converted from reStructuredText to markdown back in 2014 in
0064164d4e.
2022-05-10 21:55:00 +03:00
Ryan Schmidt 3d47d0d6b1 README.rst: Fix typos and other minor edits 2022-05-10 21:54:12 +03:00
Ryan Schmidt 60e39e0929 .gitignore: Ignore nginx-*
After running t/build-and-run an nginx directory is left in the main
directory. Hide this from git status since we won't want to check it in.
2022-05-10 21:52:26 +03:00
Ryan Schmidt a1890354e5 Tests: Build nginx in parallel on macOS 2022-05-10 19:55:34 +03:00
Ryan Schmidt 20ba8038ac Tests: Use netstat to list occupied ports on macOS
Use netstat instead of ss to list the occupied ports on macOS since
macOS doesn't have ss.

Closes #139
2022-05-10 19:46:26 +03:00
Anthony Ryan 5930c29d6a Remove `fancyindex_name_length` by offloading work to CSS
This is a backwards compatibility break, in that the `fancyindex_name_length` setting will now
prevent nginx from starting until removed. I do think though that most people will find the new
behavior preferable to that setting however.

There's two arguably unrelated CSS changes included in this pull request, so let me know if you
like one but not the other or vice versa I can split them up.

-----

We've introduced `table-layout: fixed;`. This is a performance optimization for browsers rendering
very large file lists.

The default mode (`table-layout: auto`) first needs to load the entire table, then calculates the
optimal column widths based on the contents of all cells in the table start to finish. This can be
a bit slow when directory listings contain tens of thousands of files or folders.

With `table-layout: fixed;` the width is determined based on the first row allowing the browser to
render to begin rendering the table immediately.

Technically, the widths of columns have changed slightly as a result of this, but we no longer need
to specify widths using style attributes, which makes it easier for custom CSS users to change the
widths.

.link was 55% wide, now 50%
.size was 20% wide, now 25%
.date was 25% wide, now 25%

-----

Rather than truncating string names server-side, we instead send the full name and tell the browser
to truncate file names with CSS. This has the advantage of always showing as much of the file name
as it can fit in a line. This has the benefit of avoiding line wraps on smaller screens (like
phones) and allowing people to resize their window larger to see more of the file name.

This reduces the code complexity server side and provides a optimal truncation on every device.
2021-10-28 22:37:48 +03:00
Adrian Perez de Castro 6cdffdb0af
Version 0.5.2 2021-10-28 22:28:07 +03:00
Adrian Perez de Castro b0e1fa83a8 CI: Move over to GitHub Actions 2021-10-26 01:12:26 +03:00
Anthony Ryan 2e9555e759 Always use ngx_escape_html to ensure we aren't rendering file names
as HTML tags.
2021-10-25 16:19:03 +03:00
Adrian Perez de Castro 391d2d5447
CI: Update mainline version to 1.19.3 2021-02-25 19:01:53 +02:00
Tim Gates 566ad22a61 docs: fix simple typo, configration -> configuration
There is a small typo in ngx_http_fancyindex_module.c.

Should read `configuration` rather than `configration`.
2020-12-21 17:20:44 +01:00
Adrian Perez de Castro 5ca7cb32af
Version 0.5.1 2020-10-26 22:45:29 +02:00
Adrian Perez de Castro c33b05af9e Fix check for arguments to fancyindex_{header,footer}
Closes #117
2020-10-26 22:41:38 +02:00
Adrian Perez de Castro 4fc6bb10d7
Version 0.5.0 2020-10-24 19:07:36 +03:00
Adrian Perez de Castro 618e2d154e
Add missing "use pup" command to t/07-directory-first.test 2020-10-24 18:53:53 +03:00
Adrian Perez de Castro f52bacea8f Add unit tests for local headers and footers 2020-10-24 18:52:58 +03:00
Adrian Perez de Castro 527511fbf8 Load local header and footer files when configuring
Make the configuration process load the local files specified with
'fancyindex_{header,footer} "foo" local', instead of loading them
on every request.

Additionally, change the syntax of the configuration directive to accept
an optional parameter indicating whether the header (or footer) is to be
loaded as a subrequest (default, for backwards compatibility) or a local
file (must be specified explicitly). This avoids the footgun of having
a local file which accidentally happens to match the subrequest that one
had the intention to do when configuring.
2020-10-24 18:52:58 +03:00
JoungKyun Kim 5ac161ccc3 fixed #82 fancyindex can't print list with auth-ldap module
- fixed signedness problems
- fixed gabage characters
2020-10-24 18:34:41 +03:00
Adrian Perez de Castro 140dcb7a8f Properly escape square brackets with old Nginx versions 2020-10-24 15:40:07 +03:00
Adrian Perez de Castro 6637a7afab Update to Nginx 0.8 as oldest supported version 2020-10-24 15:40:07 +03:00
Adrian Perez de Castro d3d7adc89d README: Update CI link to use travis-ci.com instead of .org 2020-10-24 14:08:56 +03:00
Adrian Perez de Castro 52a17b7a17 CI: Update Nginx mainline and stable versions 2020-10-24 14:08:56 +03:00
z4yx 63d19686df add a test of ngx_http_fancyindex_cmp_entries_dirs_first 2020-10-24 13:17:10 +03:00
z4yx b3e06fd31b remove ngx_http_fancyindex_cmp_entries_dirs_first 2020-10-24 13:17:10 +03:00
z4yx c0448985b6 ngx_int_t -> int 2020-10-24 13:17:10 +03:00
z4yx a05006e3c4 replace ngx_sort with ngx_qsort 2020-10-24 13:17:10 +03:00
Joshua Shaffer 56934db14c update readme 2020-05-26 16:14:09 +03:00
Joshua Shaffer 42e21c9153 Added test for show_dotfiles 2020-05-26 16:14:09 +03:00
Joshua Shaffer 7444208a36 t/* should be eol=lf so bash can run 2020-05-26 16:14:09 +03:00
Joshua Shaffer 94bb8164b2 Fixes #54. Adds configuration option 'fancyindex_show_dotfiles' to show dotfiles. 2020-05-26 16:14:09 +03:00
Adrian Perez de Castro 11101de198
make-dist: Add script to generate release tarballs
Because the source archives from GitHub tags may not always produce the
same tarball when fetching at different times. Having proper tarballs
for releases also allows signing them i.e. with PGP.
2020-02-19 13:05:55 +02:00
Adrian Perez de Castro 58fecc865d
Version 0.4.4 2020-02-19 12:56:12 +02:00
Anders Trier 21a084d61d Add CRLF after the 'Parent directory' line. This makes the output easier to parse. 2020-02-19 12:44:32 +02:00