{"id":49501636,"url":"https://github.com/axelhahn/restic-http-server-for-synology","last_synced_at":"2026-05-01T12:53:05.841Z","repository":{"id":86688096,"uuid":"352460175","full_name":"axelhahn/restic-http-server-for-synology","owner":"axelhahn","description":"Shell scripts to install an maintain a restic http server on a Synology NAS (private usage)","archived":false,"fork":false,"pushed_at":"2025-12-28T23:19:24.000Z","size":19,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-01T12:53:00.091Z","etag":null,"topics":["backup","http","restic","server","shell-script","synology"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/axelhahn.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-03-28T23:15:55.000Z","updated_at":"2026-03-07T09:59:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"88e8a004-dba6-4abc-a4f2-a2d0f880917b","html_url":"https://github.com/axelhahn/restic-http-server-for-synology","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/axelhahn/restic-http-server-for-synology","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelhahn%2Frestic-http-server-for-synology","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelhahn%2Frestic-http-server-for-synology/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelhahn%2Frestic-http-server-for-synology/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelhahn%2Frestic-http-server-for-synology/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axelhahn","download_url":"https://codeload.github.com/axelhahn/restic-http-server-for-synology/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axelhahn%2Frestic-http-server-for-synology/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32497815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["backup","http","restic","server","shell-script","synology"],"created_at":"2026-05-01T12:53:03.594Z","updated_at":"2026-05-01T12:53:05.836Z","avatar_url":"https://github.com/axelhahn.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Restic Http Server on Synology NAS\r\n\r\n## 🔶 Description\r\n\r\nA set of bash scripts to \r\n\r\n* Install rest http server on a Synology NAS.\r\n* Service handling: start/stop/status of server\r\n* A user administration for access to private repos; it handles user entries in [webroot]/.htpasswd (using openssl)\r\n\r\n📄 Source: https://github.com/axelhahn/restic-http-server-for-synology\r\n\r\n📜 License GNU GP 3.0\r\n\r\nLatest tested versions:\r\n\r\n* Restic: 0.14.0\r\n* on Synology DSM 7.3\r\n\r\n\r\n## 🔷 Introduction\r\n\r\nRestic **client**: https://restic.net/ - it is an opensource backup tool. \r\n\r\nIt is very fast and uses deduplication. Copy a single to your client binary and use it. \r\nIt stores backup data on (USB) disk, SFTP, S3 or other backend supported by rclone.\r\n\r\nTo use https as backend there is a **Restic server**. https://github.com/restic/rest-server\r\n\r\nIf you have a Synology NAS at home then this repository helps you to install that https backend and maintain users.\r\n\r\nOn your Windows/ Linux/ Mac OS client you additionally need to install the client and configure the backend url of the https server.\r\n\r\n## 🪄 Installation\r\n\r\nRemark: since DSM 7.2 (?) `sudo -i` isn't allowed anymore to open a shell as root and execute all commands. All actions are written with sudo in front now.\r\n\r\n### Prepare\r\n\r\nWeb based stuff:\r\n\r\n* Login into the web ui of your Synology with an admin user\r\n* Activate DDNS for your NAS\r\n* Activate ssl certificate for your NAS (what is using Let's Encrypt in the background)\r\n\r\n### Get sources\r\n\r\nVia SSH console:\r\n\r\n* Login to your Synology with an admin account\r\n* Create a directory, and get the files of the project there\r\n\r\n```shell\r\n# Create directory\r\nsudo mkdir -p /volume1/opt/restic\r\ncd /volume1/opt/restic\r\n\r\n# get the sources\r\nsudo curl -o master.tar.gz https://codeload.github.com/axelhahn/restic-http-server-for-synology/tar.gz/refs/heads/master\r\nsudo tar -xzf master.tar.gz\r\ncd restic-http-server-for-synology-master\r\nsudo cp * ..\r\ncd ..\r\nsudo rm -rf restic-http-server-for-synology-master master.tar.gz\r\n```\r\n\r\nThe result is something like that:\r\n\r\n```shell\r\n# ls -1\r\ninstall.sh\r\nrest_server.conf.dist\r\nrest_server.sh\r\nuseradmin.sh\r\n```\r\n\r\n### Run installer\r\n\r\nExecute `sudo ./install.sh` to download the required binary and initialize the service.\r\n\r\nThe reuslt is\r\n\r\n```txt\r\n# ls -1\r\ndata\r\ninstall.sh\r\nlog\r\nrest-server\r\nrest-server_0.14.0_linux_arm64\r\nrest-server_0.14.0_linux_arm64.tar.gz\r\nrest_server.conf\r\nrest_server.conf.dist\r\nrest_server.sh\r\nuseradmin.sh\r\n```\r\n\r\nThe installer also creates a /usr/local/etc/rc.d/rest_server.sh - which is a softlink to rest_server.sh in your\r\ninstallation directory.\r\nWith that link the restic http server will start automatically if your Synology nas is (re-)booting.\r\n\r\n### See the config\r\n\r\nThere is no need to change at this point ... but have a look:\r\n\r\n```shell\r\nroot@nas:/volume1/opt/restic# cat rest_server.conf\r\n# ======================================================================\r\n#\r\n# HTTP REST SERVER CONFIG FILE\r\n#\r\n#\r\n# a relative path is relative to restic_server.sh - or use absolute\r\n#\r\n# ======================================================================\r\n\r\n\r\n\r\n# where to find binary of http rest server - no need to change\r\ndir_server=rest-server\r\n\r\n# place of key and cert; it is specific for Synonlogy NAS - no need to change\r\ndir_cert=/usr/syno/etc/certificate/system/default\r\n\r\n\r\n# listen port of rest server; 8000 is default\r\nlisten=':8000'\r\n\r\n# webroot of backup data\r\ndir_data=data\r\n\r\n# path of log\r\nlogfile=log/restic-server.log\r\n\r\n\r\n# ----------------------------------------------------------------------\r\n#\r\n# flags for restic server process\r\n#\r\nappendonly=0\r\nprivaterepos=1\r\nnoauth=1\r\n\r\n\r\n# ----------------------------------------------------------------------\r\n#\r\n# user admin\r\n#\r\n# length of user password for a new user\r\npwlength=32\r\n\r\n# ----------------------------------------------------------------------\r\n```\r\n\r\n### Create a user for http access\r\n\r\nThe default config activates private repos (see restic http doc for description).\r\nIn short: a user [user] gets access to [backup-url]:[port]/[user]/ only ... with its own password.\r\n\r\nExecute `./useradmin.sh add USERNAME` to create (or update) a user with a generated password (32 chars by default).\r\nCopy and paste the shown password in the output to your restic client config. The password visible only once.\r\n\r\nIt is not possible to show the password again.\r\n\r\nBut you can repeat `./useradmin.sh add USERNAME` to set a new password and update the client config.\r\n\r\nExecute `./useradmin.sh status` to see all users and their used size.\r\n\r\n```\r\n# sudo ./useradmin.sh\r\nUSAGE: useradmin.sh [status|add|delete]\r\n  status         Show status of current users and used disk size\r\n  add [user]     Add a new user and password.\r\n                 As 2nd parameter you can optionally add a username.\r\n                 Without given user it will be asked for interactively.\r\n                 If the user exists it will update its password.\r\n  delete [user]  Delete a user and all its backup data(!!!).\r\n                 Without given user you get the status and it will be asked\r\n                 for interactively.\r\n```\r\n\r\n### Start service\r\n\r\n`sudo ./rest_server.sh start` is our service script for start/ stop/ restart restic http and logrotation.\r\n\r\n```\r\n# sudo ./rest_server.sh\r\nUSAGE: rest_server.sh [start|stop|status|restart|logrotate]\r\n```\r\n\r\nExecute `sudo ./rest_server.sh start` to start the restic http server.\r\nIt detects if an ssl certificate was enabled and uses https if possible.\r\n\r\nExecute `sudo ./rest_server.sh status` to see the process with PID and full path and used port.\r\n\r\n### Logrotation\r\n\r\nThe installer creates a file for restic http server in /etc/logrotate.d/.\r\n\r\nOLD method (which still works):\r\n\r\n`./rest_server.sh logrotate` detects existance of restic config file in /etc/logrotate.d/. \r\nIf it fails the old way works only once per day - it will rotate the logfile with the date as extension.\r\nRotated logs older 7d will be deleted.\r\n\r\nTo run the logrotation regulary:\r\nIn the synology web ui go to the task planner and let execute a custom script daily.\r\nThe Script to execute is\r\n\r\n`/volume1/opt/restic/rest_server.sh logrotate`\r\nor\r\n`/usr/local/etc/rc.d/rest_server.sh logrotate`\r\n\r\nIn the beginning you can activate to send an email of each execution. Test the job with run now\r\nand then check your email inbox.\r\n\r\n## 👉 Status of this project\r\n\r\nIn short: work in progress.\r\n\r\nDONE\r\n\r\n* installation for binary and initial running config\r\n* use https (using Let's Encrypt certicate of the system)\r\n* handle service start|stop|status\r\n* configure service behaviour in a conf file\r\n* add/ update users for private repositories\r\n* autostart service on reboot\r\n* handle users with encrypted password in .htpasswd \r\n* logrotation; installer creates file in /etc/logrotate.d/ (if it fails you can create a cronjob)\r\n\r\nTODO\r\n\r\n* service runs as root - not as unprivileged http user\r\n* log format - the output for a request is quite basic\r\n* no package ... it is a manual way by scripts so far\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelhahn%2Frestic-http-server-for-synology","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxelhahn%2Frestic-http-server-for-synology","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxelhahn%2Frestic-http-server-for-synology/lists"}