{"id":19555641,"url":"https://github.com/chris-l/php-restic-server","last_synced_at":"2025-07-04T06:05:23.469Z","repository":{"id":72746759,"uuid":"295368038","full_name":"chris-l/php-restic-server","owner":"chris-l","description":"This is a PHP implementation of Restic's REST backend API: Use a regular PHP server as a Restic repository!","archived":false,"fork":false,"pushed_at":"2020-10-01T06:46:17.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-08T21:22:10.489Z","etag":null,"topics":["backend","backend-server","backup","php","restic","restic-rest-server"],"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/chris-l.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":"2020-09-14T09:29:53.000Z","updated_at":"2023-08-06T09:18:43.000Z","dependencies_parsed_at":"2023-03-19T11:06:28.131Z","dependency_job_id":null,"html_url":"https://github.com/chris-l/php-restic-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-l%2Fphp-restic-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-l%2Fphp-restic-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-l%2Fphp-restic-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-l%2Fphp-restic-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris-l","download_url":"https://codeload.github.com/chris-l/php-restic-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240814837,"owners_count":19861955,"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":["backend","backend-server","backup","php","restic","restic-rest-server"],"created_at":"2024-11-11T04:35:06.464Z","updated_at":"2025-02-26T07:43:03.143Z","avatar_url":"https://github.com/chris-l.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-restic-server\n\nphp-restic-server is a PHP implementation of restic's [REST backend API](http://restic.readthedocs.io/en/latest/100_references.html#rest-backend).  It provides a way to backup data to a remote PHP server, using [restic](https://github.com/restic/restic) backup client via the [rest: URL](http://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server).\n\n**NOTE: If possible, use the [official rest-server](https://github.com/restic/rest-server) instead of this project.** Use php-restic-server only for those cases when the server where you want to make your backups only allows you to run PHP scripts.\n\n## Requirements\n\n* PHP 5.3 or better.\n* The server needs to allow PHP scripts to create, edit, and delete files and directories.\n* The server should allow you to redirect every request in the path where php-restic-server is installed to be handled by the `restic-index.php` script. That can be done with an `.htaccess` file in the case of apache.\n* The server should allow the upload and storage of files of the size of the Blobs (some servers put limits on the sizes allowed). According to the [documentation](https://restic.readthedocs.io/en/latest/100_references.html#backups-and-deduplication), Blobs are from 512 KiB to 8 MiB in size. However, in my tests, I have found Blobs as large as 8.7 MiB. Therefore, the server should allow uploads and storage of files with a size slightly bigger, like 10 MiB at least.\n* To use the private repos mode, authentication is required. And its highly recommended that the server has an SSL cert to serve requests via HTTPS. Otherwise, the auth password could easily be sniffed by a third party.\n\n## Installation\n\nCreate a directory inside the document root of your server and copy the files `restic-index.php`, `restic-server.php` and `restic-config.php` there. In this same directory, create a `restic` directory where your repos will reside (you can change the directory that will store your repos by editing the line `\"path\" =\u003e \"./restic\"` on `restic-config.php`).\n\nIf the server is Apache, then create an `.htaccess` file to redirect every request to `restic-index.php`.\n\nThe content of the file may have to be adjusted for your particular server, but it will be something similar to this:\n\n```conf\nRewriteEngine on\nRewriteRule ^.*$ restic-index.php [L]\n```\n\nIf the server is going to use authentication, it will be necessary to also add the required lines for that.\n\nIf you are using nginx instead, the same result can be achieved with `try_files` using a line similar to this:\n\n```conf\ntry_files $uri $uri/ /restic-index.php?$args;\n```\n\nRead the nginx documentation to find more about it.\n\n## Usage\n\nEdit the file `restic-config.php` to change the options.\n\n(They use the same names and are used mostly the same way as the [original rest-server](https://github.com/restic/rest-server#usage), but not all the options are present)\n\n\n| property        | type     | default value     | description |\n| --------------- | -------- | ----------------- | ----------- |\n| `append_only`   | `bool`   | `false`           | enable append only mode |\n| `max_size`      | `int`    | `0`               | the maximum size of the repository in bytes. Set it to 0 to be unlimited. |\n| `path`          | `string` | `\"./restic\"`      | data directory |\n| `private_repos` | `bool`   | `false`           | users can only access their private repo. Requires http auth. |\n\nFor using the private repos mode, http auth is required. And it's _highly recommended_ to use HTTPS, to prevent the auth password being passed over an unencrypted connection.\n\n## License\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-l%2Fphp-restic-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris-l%2Fphp-restic-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-l%2Fphp-restic-server/lists"}