{"id":20269026,"url":"https://github.com/patatetom/fancypy","last_synced_at":"2026-04-18T17:32:46.741Z","repository":{"id":256781104,"uuid":"63057420","full_name":"patatetom/fancypy","owner":"patatetom","description":"Fancy directory listing with Flask for web servers","archived":false,"fork":false,"pushed_at":"2016-08-02T20:49:01.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-10T23:11:14.598Z","etag":null,"topics":["flask","html","http-server","nginx"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patatetom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-11T10:03:54.000Z","updated_at":"2017-02-16T10:41:53.000Z","dependencies_parsed_at":"2024-11-12T07:35:03.525Z","dependency_job_id":null,"html_url":"https://github.com/patatetom/fancypy","commit_stats":null,"previous_names":["patatetom/fancypy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patatetom/fancypy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Ffancypy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Ffancypy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Ffancypy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Ffancypy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patatetom","download_url":"https://codeload.github.com/patatetom/fancypy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patatetom%2Ffancypy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263083591,"owners_count":23411163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","html","http-server","nginx"],"created_at":"2024-11-14T12:22:47.295Z","updated_at":"2026-04-18T17:32:41.684Z","avatar_url":"https://github.com/patatetom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Fancy directory listing with [Flask](http://flask.pocoo.org/) for web servers\n\nweb servers allow to serve the content of folders, but generally in a pretty poor way :\n\n![ngnix default directory listing](https://github.com/patatetom/fancypy/blob/master/default.png \"ngnix default directory listing\")\n\nwith fancypy, you can simply and easily redefine the layout :\n\n![fancypy directory listing](https://github.com/patatetom/fancypy/blob/master/fancypy.png \"fancypy directory listing\")\n\n---\n\n\n## Installation\n\n*(in this example of installation, fancypy is behind the nginx web server : adjust the procedure to your case)*\n\n* install [Flask](http://flask.pocoo.org/docs/0.11/installation/)\n* create a new user named «fancypy» :\n```\n# useradd -m -c \"Fancy directory listing with flask\" -g nginx -N fancypy\n```\n* copy `fancypy` and `fancypy.html` in the fancypy home directory :\n```\n# wget -P /home/fancypy/ https://raw.githubusercontent.com/patatetom/fancypy/master/fancypy\n# wget -P /home/fancypy/ https://raw.githubusercontent.com/patatetom/fancypy/master/fancypy.html\n```\n* change/check the code of the fancypy python script ;-)\n* make the fancypy python script executable :\n```\n# chmod +x /home/fancypy/fancypy\n```\n* install fancypy service with systemd :\n```\n# echo \"[Unit]\nDescription=Fancy directory listing with flask\nAfter=network.target nginx.service\n[Service]\nExecStart=/home/fancypy/fancypy \u0026\nUser=fancypy\n[Install]\nWantedBy=multi-user.target\n\" \u003e /etc/systemd/system/fancypy.service\n# systemctl enable fancypy\n...\n# systemctl start fancypy\n```\n* check fancypy service :\n```\n# systemctl status fancypy\n...\n# wget -q -O /dev/stdout http://localhost:5000\n:-(\n```\n\n---\n\n\n## Configuration\n\n### Apache\n\n*todo*\n\n\n### Nginx\n\nthe `/clam/` directory was served by ngnix with this simple configuration :\n\n```\n# cat /etc/nginx/nginx.conf\n...\nlocation /clam/ {\n autoindex on;\n autoindex_localtime on;\n autoindex_exact_size off;\n}\n...\n```\n\nonce fancypy installed, the directory can be served with this simple configuration :\n\n```\n# cat /etc/nginx/nginx.conf\n...\nlocation /clam/ {\n proxy_pass http://127.0.0.1:5000/?root=$document_root\u0026uri=$request_uri;\n}\n ...\n```\n\nif directory contains subdirectories, the configuration may be :\n\n```\n# cat /etc/nginx/nginx.conf\n...\nlocation ~ ^/(clam|clam/.*)/$ {\n proxy_pass http://127.0.0.1:5000/?root=$document_root\u0026uri=$request_uri;\n}\n...\n```\n\n---\n\n\n## Template\n\nfancypy will search for the template `fancypy.html` first in the «root+uri» directory and finally fallback in the fancypy home directory. the template will be automaticly removed from listing.\n\n*(here «root» is `/var/www/` and «uri» is `/clam/`)*\n\n```html\n# cat /var/www/clam/fancypy.html \n\u003c!DOCTYPE html\u003e\n\u003chead\u003e\n\u003cmeta charset=\"utf-8\"/\u003e\n\u003cmeta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"/\u003e\n\u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/\u003e\n\u003clink rel=\"icon\" href=\"/img/favicon.ico\"/\u003e\n\u003ctitle\u003eClamAV\u003c/title\u003e\n\u003clink href=\"/css/bootstrap.min.css\" rel=\"stylesheet\"/\u003e\n\u003clink href=\"/css/bootstrap-theme.min.css\" rel=\"stylesheet\"/\u003e\n\u003clink href=\"/css/custom.css\" rel=\"stylesheet\"/\u003e\n\u003c/head\u003e\n\u003cbody role=\"document\"\u003e\n\u003cdiv class=\"container theme-showcase\" role=\"main\"\u003e\n\u003ch1\u003eClamAV Virus Databases\u003c/h1\u003e\n\u003cp\u003eThese files are needed to run the antivirus ClamAV\u003c/p\u003e\n\u003cdiv class=\"alert alert-warning\" role=\"alert\"\u003e\n\u003cstrong\u003eThank you to download large resources \u003c/strong\u003e(+100Mo)\u003cstrong\u003e outside working hours.\u003c/strong\u003e\n\u003c/div\u003e\n{{listing|safe}}\n\u003c/div\u003e\n\u003cscript src=\"/js/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"/js/bootstrap.min.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\nthe most important part of the template is `{{listing|safe}}` : this is where fancypy will place directory listing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatatetom%2Ffancypy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatatetom%2Ffancypy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatatetom%2Ffancypy/lists"}