刘凡 9ff4d1d109 add S3,archive,truncate 2 年之前
..
.gitignore 9ff4d1d109 add S3,archive,truncate 2 年之前
LICENSE 9ff4d1d109 add S3,archive,truncate 2 年之前
README.md 9ff4d1d109 add S3,archive,truncate 2 年之前
pre2table.py 9ff4d1d109 add S3,archive,truncate 2 年之前
requirements.txt 9ff4d1d109 add S3,archive,truncate 2 年之前

README.md

About

Convert NGINX standard file listing in pre tag to table with full hrefs and no text truncation

Usage

  1. Setup virtual environment and install required libraries

    sudo apt install python3.9-venv
    python3.9 -m venv venv
    source venv/bin/activate
    pip install --upgrade pip setuptools
    pip install -r requirements.txt
    
  2. Pass URL (served using standard NGINX file listing module ngx_http_autoindex_module) to script:

    python http:/your.path
    

    URL will be parsed and saved to html file where:

  3. href relative values will be converted to absolute ones.

  4. a tag text will not be truncated (stupid default limitation https://github.com/nginx/nginx/blob/master/src/http/modules/ngx_http_autoindex_module.c#L53)

  5. a tags in pre tag will be reformated to table for more conveninent browsing