{"id":16135632,"url":"https://github.com/thevickypedia/pyfilebrowser","last_synced_at":"2025-10-15T02:17:15.146Z","repository":{"id":228478997,"uuid":"773174418","full_name":"thevickypedia/pyfilebrowser","owner":"thevickypedia","description":"Python library designed to streamline interactions with filebrowser","archived":false,"fork":false,"pushed_at":"2025-05-25T22:27:47.000Z","size":626,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-30T03:48:17.530Z","etag":null,"topics":["filebrowser"],"latest_commit_sha":null,"homepage":"https://thevickypedia.github.io/pyfilebrowser/","language":"Python","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/thevickypedia.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-16T23:50:12.000Z","updated_at":"2025-07-28T02:40:10.000Z","dependencies_parsed_at":"2024-04-09T22:46:18.209Z","dependency_job_id":"b8c76e5e-982e-41ca-b5bd-10b08a25619c","html_url":"https://github.com/thevickypedia/pyfilebrowser","commit_stats":null,"previous_names":["thevickypedia/pyfilebrowser"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/thevickypedia/pyfilebrowser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thevickypedia%2Fpyfilebrowser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thevickypedia%2Fpyfilebrowser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thevickypedia%2Fpyfilebrowser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thevickypedia%2Fpyfilebrowser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thevickypedia","download_url":"https://codeload.github.com/thevickypedia/pyfilebrowser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thevickypedia%2Fpyfilebrowser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279034573,"owners_count":26089522,"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","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["filebrowser"],"created_at":"2024-10-09T23:08:48.406Z","updated_at":"2025-10-15T02:17:15.113Z","avatar_url":"https://github.com/thevickypedia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Deployments**\n\n![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12-blue)\n\n[![pypi][gha_pypi_badge]][gha_pypi]\n\n[![none-shall-pass][gha_none_shall_pass_badge]][gha_none_shall_pass]\n\n[![book][gha_pages_badge]][gha_pages]\n\n[![PyPI version shields.io](https://img.shields.io/pypi/v/pyfilebrowser)][pypi]\n[![Pypi-format](https://img.shields.io/pypi/format/pyfilebrowser)](https://pypi.org/project/pyfilebrowser/#files)\n[![Pypi-status](https://img.shields.io/pypi/status/pyfilebrowser)][pypi]\n\n# PyFileBrowser\nIntroducing [`pyfilebrowser`][repo], a Python library designed to streamline interactions with [filebrowser][home]\u003cbr\u003e\n\nThis wrapper simplifies integration and automation tasks, enabling seamless interaction with your local file system via\nfilebrowser's web interface.\n\nAll the required configuration, settings, and user profiles are loaded using `.env` files. This provides a more centralized\nway of handling the configuration and initialization.\n\n[`pyfilebrowser`][repo] automatically downloads the system specific executable during startup.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDownload custom-built executables\u003c/strong\u003e\u003c/summary\u003e\n\u003cbr\u003e\n\nAdditionally, custom source _(to download binaries)_ can be configured by specifying the following environment variables\n\n- **OWNER** - Owner of the GitHub repo.\n- **REPO** - Repository name.\n- **TOKEN** - GitHub repository token.\n- **VERSION** - Version of the release.\n\n\u003e _also supports the dotenv file `.github.env`, and prefixes like `github`, `git` and `filebrowser`_\n\nFor this custom source feature to work, the executable should be uploaded to releases as assets,\nand follow the naming convention below.\n\n\u003e **asset naming convention:** `${operating system}-{architecture}-filebrowser-{extension}`\u003cbr\u003e\n\u003e **example:** `darwin-amd64-filebrowser.tar.gz`\n\n\u003c/details\u003e\n\n## Kick Off\n**Install**\n```shell\npython -m pip install pyfilebrowser\n```\n\n**Initiate [programmatically]**\n```python\nimport pyfilebrowser\n\nif __name__ == '__main__':\n    browser = pyfilebrowser.FileBrowser()\n    # browser.proxy = True  # [Optional] Enables proxy server to run in parallel\n    browser.start()\n```\n\n**Initiate [CLI]**\n```shell\npyfilebrowser\n```\n\n## Environment Variables\nEnv vars can either be loaded from `.env` files or directly passed during object init.\n\n#### `.env` files\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eproxy server\u003c/strong\u003e\u003c/summary\u003e\n\n\u003e `.proxy.env` - Loads the proxy server's configuration.\n\n- **host** `str` - Hostname/IP for the proxy server. _Defaults to `socket.gethostbyname('localhost')`_\n- **port** `int` - Port number for the proxy server. _Defaults to `8000`_\n- **workers** `int` - Number of workers used to run the proxy server. _Defaults to `1`_\n- **debug** `bool` - Boolean flag to enable debug level logging. _Defaults to `False`_\n- **origins** `List[str]` - Origins to allow connections through proxy server. _Defaults to `host`_\n- **allow_public_ip** `bool` - Boolean flag to allow public IP address of the host. _Defaults to `False`_\n- **allow_private_ip** `bool` - Boolean flag to allow private IP address of the host. _Defaults to `False`_\n- **origin_refresh** `int` - Interval in seconds to refresh all the allowed origins. _Defaults to `None`_\n- **error_page** `FilePath` - Error page to serve when filebrowser API is down. _Defaults to_ [error.html]\n- **warn_page** `FilePath` - Warning page to serve when accessed from Unsupported browsers. _Defaults to_ [warn.html]\n- **rate_limit** - `Dict/List[Dict]` with the rate limit for the proxy server. _Defaults to `None`_\n\n\u003e `origin_refresh` allows users to set a custom interval to update the public and private IP address of the host,\nbased on their DHCP lease renewal.\u003cbr\u003eThis is specifically useful in cases of long-running server sessions.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003efilebrowser configuration\u003c/strong\u003e\u003c/summary\u003e\n\n\u003e `.config.env` - Loads the server's default configuration. Reference: [config]\n\nExtra configuration settings can be loaded using a `JSON`/`YAML` file.\nThese settings will be merged with the default configuration settings.\nThe filename should be passed as `extra_env` during object instantiation.\nReference: [extra_env]\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003efilebrowser user profiles\u003c/strong\u003e\u003c/summary\u003e\n\n\u003e`.user*.env` - Loads each user's profile specific configuration. Reference: [users]\n\nMultiple user profiles can be loaded using `.user1.env`, `.user2.env` and so on.\u003cbr\u003e\nUser profile's permissions are automatically set based on the `admin` flag set in the env-var `authentication`\n\n\u003c/details\u003e\n\n\u003e `.env` files can be placed in a dedicated directory, whose path can be set using the env var `SECRETS_PATH`\n\u003e before importing `pyfilebrowser`\n\n\u003cdetails\u003e\n\u003csummary\u003eExample\u003c/summary\u003e\n\n**Sample directory structure**\n```text\nroot (current working directory)\n  ├ secrets\n  | ├ .config.env\n  | ├ .github.env\n  | ├ .proxy.env\n  | └ .user.env\n  ├ venv/\n  └ main.py\n```\n\n**Set custom location for secrets [programmatically]**\n```python\nimport os\n\nos.environ[\"secrets_path\"] = os.path.join(os.getcwd(), \"secrets\")\n\nimport pyfilebrowser\n...\n```\n\n**[OR]**\n\n**Set custom location for secrets [CLI]**\n```shell\nexport secrets_path=\"secrets\"\n\npyfilebrowser run\n```\n\n\u003c/details\u003e\n\nRefer [samples] directory for sample `.env` files. For nested configuration settings, refer the [runbook]\n\n\u003e Any configuration changes made in the UI will be lost, unless backed up manually.\u003cbr\u003e\n\u003e Changes should always go through the `.env` files.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eObject level instantiation is also possible, but not recommended\u003c/strong\u003e\u003c/summary\u003e\n\n```python\nfrom pyfilebrowser import FileBrowser\n\nif __name__ == '__main__':\n    file_browser = FileBrowser(\n        user_profiles=[\n            {\"authentication\": {\"username\": \"admin\", \"password\": \"admin\", \"admin\": True}},\n            {\"authentication\": {\"username\": \"user123\", \"password\": \"pwd456\", \"admin\": False}}\n        ]\n    )\n    file_browser.start()\n```\n\n\u003e Object level instantiation might be complex for configuration settings. So it is better to use `.env` files instead.\n\n\u003c/details\u003e\n\n## Proxy Server\n`pyfilebrowser` allows you to run a proxy server in parallel,\nwhich includes a collection of security features and trace level logging information.\n\n\u003e Enabling proxy server increases an inconspicuous latency to the connections,\n\u003e but due to asynchronous functionality, it is hardly noticeable.\u003cbr\u003e\n\u003e The proxy server is designed to be lightweight and efficient, however streaming large video files may increase\n\u003e the memory usage at server side, due to multi-layered buffering.\n\n### [Firewall]\n\nWhile CORS may solve the purpose at the webpage level, the built-in proxy's firewall restricts connections\nfrom any origin regardless of the tool used to connect (PostMan, curl, wget etc.)\n\nDue to this behavior, please make sure to specify **ALL** the origins that are supposed to be allowed\n(including but not limited to reverse-proxy, CDN, redirect servers etc.)\n\n### [Brute Force Protection]\n\n- The built-in proxy service limits the number of failed login attempts from a host address to **three**.\n- Any more than 3 attempts, will result in the host address being temporarily blocked.\n- For every failed attempt _(after the initial 3)_, the host address will be blocked at an incremental rate.\n- After 10 such attempts, the host address will be permanently _(1 month)_ forbidden.\n\n### [Rate Limiter]\nThe built-in proxy service allows you to implement a rate limiter.\n\n[Rate limiting] allows you to prevent [DDoS] attacks and maintain server stability and performance.\n\n\u003e Brute force protection and rate limiting are reset when the server is restarted.\n\n## Coding Standards\nDocstring format: [`Google`][google-docs] \u003cbr\u003e\nStyling conventions: [`PEP 8`][pep8] and [`isort`][isort]\n\n## [Release Notes][release-notes]\n**Requirement**\n```shell\npip install gitverse\n```\n\n**Usage**\n```shell\ngitverse-release reverse -f release_notes.rst -t 'Release Notes'\n```\n\n## Linting\n`pre-commit` will ensure linting, and generate runbook\n\n**Requirement**\n```shell\npip install sphinx==5.1.1 pre-commit recommonmark\n```\n\n**Usage**\n```shell\npre-commit run --all-files\n```\n\n## Pypi Package\n[![pypi-module](https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg)][pypi-repo]\n\n[https://pypi.org/project/pyfilebrowser/][pypi]\n\n## Runbook\n[![made-with-sphinx-doc](https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg)][sphinx]\n\n[https://thevickypedia.github.io/pyfilebrowser/][runbook]\n\n## License \u0026 copyright\n\n\u0026copy; Vignesh Rao\n\nLicensed under the [MIT License][license]\n\n[repo]: https://github.com/thevickypedia/pyfilebrowser\n[samples]: https://github.com/thevickypedia/pyfilebrowser/tree/main/samples\n[license]: https://github.com/thevickypedia/pyfilebrowser/blob/main/LICENSE\n[config]: https://thevickypedia.github.io/pyfilebrowser/#configuration\n[users]: https://thevickypedia.github.io/pyfilebrowser/#users\n[extra_env]: https://thevickypedia.github.io/pyfilebrowser/#module-pyfilebrowser.main\n[home]: https://filebrowser.org/\n[pypi]: https://pypi.org/project/pyfilebrowser\n[pypi-repo]: https://packaging.python.org/tutorials/packaging-projects/\n[sphinx]: https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html\n[runbook]: https://thevickypedia.github.io/pyfilebrowser/\n[gha_pages]: https://github.com/thevickypedia/pyfilebrowser/actions/workflows/pages/pages-build-deployment\n[gha_pages_badge]: https://github.com/thevickypedia/pyfilebrowser/actions/workflows/pages/pages-build-deployment/badge.svg\n[gha_pypi]: https://github.com/thevickypedia/pyfilebrowser/actions/workflows/python-publish.yml\n[gha_pypi_badge]: https://github.com/thevickypedia/pyfilebrowser/actions/workflows/python-publish.yml/badge.svg\n[gha_none_shall_pass]: https://github.com/thevickypedia/pyfilebrowser/actions/workflows/markdown.yml\n[gha_none_shall_pass_badge]: https://github.com/thevickypedia/pyfilebrowser/actions/workflows/markdown.yml/badge.svg\n[release-notes]: https://github.com/thevickypedia/pyfilebrowser/blob/main/release_notes.rst\n[google-docs]: https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings\n[pep8]: https://www.python.org/dev/peps/pep-0008/\n[isort]: https://pycqa.github.io/isort/\n[error.html]: https://github.com/thevickypedia/pyfilebrowser/blob/main/pyfilebrowser/proxy/templates/error.html\n[warn.html]: https://github.com/thevickypedia/pyfilebrowser/blob/main/pyfilebrowser/proxy/templates/warn.html\n[Rate limiting]: https://www.cloudflare.com/learning/bots/what-is-rate-limiting/\n[DDoS]: https://www.cloudflare.com/learning/ddos/glossary/denial-of-service/\n[Rate Limiter]: https://builtin.com/software-engineering-perspectives/rate-limiter\n[Brute Force Protection]: https://owasp.org/www-community/controls/Blocking_Brute_Force_Attacks\n[Firewall]: https://www.zenarmor.com/docs/network-security-tutorials/what-is-proxy-firewall\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthevickypedia%2Fpyfilebrowser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthevickypedia%2Fpyfilebrowser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthevickypedia%2Fpyfilebrowser/lists"}