{"id":24788822,"url":"https://github.com/t0xh3x/pfserver","last_synced_at":"2026-04-09T01:32:17.430Z","repository":{"id":284143369,"uuid":"924343875","full_name":"t0xh3x/pfserver","owner":"t0xh3x","description":"pfserver is a Python-based web file server built on the http.server","archived":false,"fork":false,"pushed_at":"2025-01-29T20:43:31.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T10:43:39.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/t0xh3x.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,"zenodo":null}},"created_at":"2025-01-29T20:43:05.000Z","updated_at":"2025-01-29T20:44:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"cfcc998a-aae2-4b86-b820-eccbffeee04c","html_url":"https://github.com/t0xh3x/pfserver","commit_stats":null,"previous_names":["t0xh3x/pfserver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/t0xh3x/pfserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0xh3x%2Fpfserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0xh3x%2Fpfserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0xh3x%2Fpfserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0xh3x%2Fpfserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t0xh3x","download_url":"https://codeload.github.com/t0xh3x/pfserver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t0xh3x%2Fpfserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31581864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bash","css","html","python"],"created_at":"2025-01-29T17:15:11.275Z","updated_at":"2026-04-09T01:32:17.392Z","avatar_url":"https://github.com/t0xh3x.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview\n\n`pfserver` is a Python-based web file server built on the `http.server` module. It allows users to share and access files over a local network. With features like dynamic file listings, file exclusion, and process management, `pfserver` is an excellent tool for quickly setting up a simple file-sharing service.\n\n![Screenshot](screenshot.png)\n\n## Features\n\n1. **JSON Configuration**:\n   - Server settings are managed through a JSON configuration file for easy modification.\n   - Configure document root, port, excluded files, and header settings in one place.\n\n2. **Customizable Document Root**:\n   - Serve files from any directory by specifying the document root in the configuration.\n\n3. **File Exclusion**:\n   - Automatically exclude specified files from the directory listing (e.g., `index.html`, `style.css`, `server.pid`).\n   - Configure excluded files list in the JSON configuration.\n\n4. **Dynamic File Listings**:\n   - Automatically generate a the HTML page displaying available files for download.\n\n5. **Process Management**:\n   - A `server.pid` file is created to track the server process, enabling easy start/stop operations.\n\n6. **Daemon Mode**:\n   - The server can run in the background as a daemon, ensuring seamless operation.\n\n7. **Integrated Logging**:\n   - Logs server activity in a `server.log` file for monitoring and troubleshooting.\n\n## Installation\n\n### Requirements\n- Python 3\n\n### Setup\n1. Clone or download the repository.\n```\ngit clone https://github.com/t0xh3x/pfserver.git\n```\n![Download](https://github.com/t0xh3x/pfserver/archive/refs/heads/main.zip)\n\n2. Place files in the desired directory.\n3. Make `pfserver.py` executable: `chmod +x pfserver.py`.\n\n## Configuration\n\nThe server is configured through `server_config.json` in the same directory as `pfserver.py`. Here's an example configuration:\n\n```json\n{\n    \"doc_root\": \"/path/to/pfserver/pfserver_files/\",\n    \"port\": 8080,\n    \"excluded_files\": [\"index.html\", \"style.css\", \"favicon.ico\"],\n    \"header_image\": true,\n    \"header_text\": \"pfserver\",\n    \"header_image_file\": \"header.jpg\"\n}\n```\n\n### Configuration Options:\n\n- **doc_root**: Directory from which files will be served\n- **port**: Port number for the server (default: 8080)\n- **excluded_files**: List of files to hide from directory listing\n- **header_image**: Boolean to toggle between image or text header\n- **header_text**: Text to display when header_image is false\n- **header_image_file**: Image file name for header (file must be in doc_root)\n\n## Usage\n\n### Start the Server\nRun the following command to start the server:\n```bash\n./pfserver.py -u\n```\n- The server will start in the background and serve files at `http://localhost:8080` by default (or the configured port).\n- Download files by clicking on their links in the dynamically generated directory listing.\n- Server logs are stored in `server.log` within your configured document root.\n\n### Stop the Server\nUse this command to stop the server:\n```bash\n./pfserver.py -d\n```\n\n### Check Server Status\nVerify if the server is running using:\n```bash\nps aux | grep python\n```\n\n### Force Kill the Server\nIf the server does not stop gracefully:\n1. Locate the server's PID using:\n   ```bash\n   cat /path/to/server.pid\n   ```\n   (The PID file will be in your configured document root)\n\n2. Terminate the process:\n   ```bash\n   kill -9 \u003cPID\u003e\n   ```\n\n## Troubleshooting\n\n  - Check file permissions and path validity.\n  - Ensure `server_config.json` exists and is properly JSON formated.\n  - Verify the configuration file is properly formatted.\n  - Check the log in `server.log` for error messages.\n  - If the configured port is already in use, modify the port number in `server_config.json` and restart.\n\n## Common Errors\n\n  ```\n  Fork not available, running in background...\n  Failed to start server. Check logs for details.\n  ```\n  - When starting the `pfserver.py` script if the above error occurs the `server_config.json` file is not set correctly.\n\n## Disclaimer\n\nThis script is intended for personal use on trusted networks. Do not use it on public or insecure networks without implementing additional security measures.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft0xh3x%2Fpfserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft0xh3x%2Fpfserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft0xh3x%2Fpfserver/lists"}