{"id":15515227,"url":"https://github.com/szepeviktor/rootfiles","last_synced_at":"2025-04-23T03:15:22.158Z","repository":{"id":65717709,"uuid":"62889016","full_name":"szepeviktor/RootFiles","owner":"szepeviktor","description":"Important files in the document root which get downloaded without links.","archived":false,"fork":false,"pushed_at":"2023-04-10T02:07:14.000Z","size":1222,"stargazers_count":14,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T03:15:15.592Z","etag":null,"topics":["document-root","download","root","website"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/szepeviktor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"Security Policies/README.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-08T13:02:23.000Z","updated_at":"2024-07-12T15:18:08.000Z","dependencies_parsed_at":"2025-03-05T01:30:59.881Z","dependency_job_id":"a3313c89-72de-458b-840f-23823ed2e3eb","html_url":"https://github.com/szepeviktor/RootFiles","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szepeviktor%2FRootFiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szepeviktor%2FRootFiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szepeviktor%2FRootFiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szepeviktor%2FRootFiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szepeviktor","download_url":"https://codeload.github.com/szepeviktor/RootFiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250360509,"owners_count":21417721,"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":["document-root","download","root","website"],"created_at":"2024-10-02T10:01:30.917Z","updated_at":"2025-04-23T03:15:22.141Z","avatar_url":"https://github.com/szepeviktor.png","language":"PHP","readme":"# Serve files missing from the document root\n\n[![Build Status](https://app.travis-ci.com/szepeviktor/RootFiles.svg?branch=master)](https://app.travis-ci.com/szepeviktor/RootFiles)\n\nNot all projects have the resources to hand-craft every *root file*.\n\nThis single PHP class generates all of them for you. Apache configuration files are also included.\n\nThis repository is modular. See **Adding a new root file** section below.\n\n## Usage\n\n```bash\n# Clone this repo\ngit clone https://github.com/szepeviktor/RootFiles.git\ncd RootFiles/bin/\n# Generate Apache configuration files\n./generate-apache-httpd-configs.sh /directory/for/generator-script\n```\n\nComment out aliases for **existing files** in `dist/rootfiles.conf`,\ninclude it in your site's configuration\nand copy `dist/rootfiles.php` at the specified path.\n\nYou're done!\n\n## Download\n\nIf you don't have access to Apache vhost config\njust download the [current release](https://github.com/szepeviktor/RootFiles/releases/latest) (`.htaccess` and `rootfiles.php`)\nand place them in your site's document root.\n\n## 404 handling\n\nSee https://github.com/szepeviktor/wordpress-plugin-construction/blob/master/404-adaptive.php\n\nBased on https://github.com/mathiasbynens/small\n\n## See the results\n\nSearch access log for served root files\n\n```bash\ngrep -E \"GET ($(sed -ne 's|^\\s*Alias \"\\(.\\+\\)\" /.\\+$|\\1|p' rootfiles.conf|paste -d\"|\" -s) HTTP/)\" /var/log/apache2/access.log\n```\n\n## List of Well-Known URIs\n\nhttp://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml\n\n## Other root files\n\n- If users are allowed to upload files to any directory use an upload warning file found in `/_File upload warning`\n- Site verification files for Google, Bing, Yandex and Baidu\n- PHP user configuration `.user.ini` http://php.net/manual/en/configuration.file.per-user.php\n- Apache httpd directory configuration `.htaccess` (with rewrite rules, security, compression, browser cache etc. settings)\n\n## Alternative solution\n\n```apache\nRewriteEngine On\nRewriteRule \"^/apple-app-site-association$\" - [R=200]\n\u003cLocation \"/apple-app-site-association\"\u003e\n    # Inline response body\n    ErrorDocument 200 '{ \"applinks\": { \"apps\": [], \"details\": [] } }'\n\u003c/Location\u003e\n```\n\n## Contribution\n\n[PR-s](https://github.com/szepeviktor/RootFiles/pulls) are welcome!\n\n### Adding a new root file\n\n1. Add a `README.md` file (example below)\n1. Add all the paths with leading slash in `.path`\n1. Create the file with minimal contents with full path (could be in a subdirectory)\n1. Add `generator.phps` with case statement (path, content type, content) you may use the `%%FILE:file.ext%%` placeholder for base64 encoded file contents\n1. Optionally add full example in the `_example` directory\n\n```markdown\n# Full Name with Company and Function\n\nSmall description.\n\n| Data          |               |\n| ------------- | ------------- |\n| file name     | file.ext      |\n| type          | JSON          |\n| specification | [Title](/URL) |\n| tutorial      | [Title](/URL) |\n\n### HTML head link\n\n\u003clink rel=\"name\" /\u003e\n\nOr: Must be in the document root.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszepeviktor%2Frootfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszepeviktor%2Frootfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszepeviktor%2Frootfiles/lists"}