{"action":"created","comment":{"url":"https://api.github.com/repos/mholt/caddy/pulls/comments/82477791","pull_request_review_id":3386227,"id":82477791,"diff_hunk":"@@ -1,84 +1,127 @@\n-# systemd unit for caddy\n+# systemd Service Unit for Caddy\n \n Please do not hesitate to ask on\n [caddyserver/support](https://gitter.im/caddyserver/support)\n-if you have any questions.\n-Feel free to prepend to your question the username of whoever touched the file most recently,\n-for example `@wmark re systemd: …`.\n+if you have any questions. Feel free to prepend to your question\n+the username of whoever touched the file most recently, for example\n+`@wmark re systemd: …`.\n \n-The provided file is written for **systemd version 229** or later!\n+The provided file should work with systemd version 219 or later. It might work with earlier versions.\n+The easiest way to check your systemd version is to look at the version of the installed package\n+(e.g. 'sudo yum info systemd' on RedHat/Fedora systems).\n \n-## Quickstart\n+## Instructions\n \n-In the following sections, we will assume that you want to run caddy\n-as user `www-data` and group `www-data`, with UID and GID 33.\n-Adjust this to your liking according to the preferences of your Linux distribution!\n+We will assume the following:\n+\n+* that you want to run caddy as user `www-data` and group `www-data`, with UID and GID 33\n+* you are working from a non-root user account that can use 'sudo' to execute commands as root\n+\n+Adjust as necessary or according to your preferences.\n+\n+First, put the caddy binary in the system wide binary directory and give it\n+appropriate ownership and permissions:\n \n ```bash\n-groupadd -g 33 www-data\n-useradd \\\n+sudo cp /path/to/caddy /usr/local/bin\n+sudo chown root:root /usr/local/bin/caddy\n+sudo chmod 755 /usr/local/bin/caddy\n+```\n+\n+Give the caddy binary the ability to bind to privileged ports (e.g. 80, 443) as a non-root user:\n+\n+```bash\n+sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy","path":"dist/init/linux-systemd/README.md","position":45,"original_position":45,"commit_id":"a0a7734aa42c24f01f9ff7c925bbe9ce08a08139","original_commit_id":"a0a7734aa42c24f01f9ff7c925bbe9ce08a08139","user":{"login":"wmark","id":191736,"avatar_url":"https://avatars.githubusercontent.com/u/191736?v=3","gravatar_id":"","url":"https://api.github.com/users/wmark","html_url":"https://github.com/wmark","followers_url":"https://api.github.com/users/wmark/followers","following_url":"https://api.github.com/users/wmark/following{/other_user}","gists_url":"https://api.github.com/users/wmark/gists{/gist_id}","starred_url":"https://api.github.com/users/wmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmark/subscriptions","organizations_url":"https://api.github.com/users/wmark/orgs","repos_url":"https://api.github.com/users/wmark/repos","events_url":"https://api.github.com/users/wmark/events{/privacy}","received_events_url":"https://api.github.com/users/wmark/received_events","type":"User","site_admin":false},"body":"This is dangerous, and I have written the unit files for systemd specifically in a way that does no require this.\r\n\r\nAgain, do not use `setcap`. Given the prevalent cargo cult this will end on the internet and cause much grief in the future.","created_at":"2016-10-07T22:02:15Z","updated_at":"2016-10-07T22:02:15Z","html_url":"https://github.com/mholt/caddy/pull/1127#discussion_r82477791","pull_request_url":"https://api.github.com/repos/mholt/caddy/pulls/1127","_links":{"self":{"href":"https://api.github.com/repos/mholt/caddy/pulls/comments/82477791"},"html":{"href":"https://github.com/mholt/caddy/pull/1127#discussion_r82477791"},"pull_request":{"href":"https://api.github.com/repos/mholt/caddy/pulls/1127"}}},"pull_request":{"url":"https://api.github.com/repos/mholt/caddy/pulls/1127","id":86417118,"html_url":"https://github.com/mholt/caddy/pull/1127","diff_url":"https://github.com/mholt/caddy/pull/1127.diff","patch_url":"https://github.com/mholt/caddy/pull/1127.patch","issue_url":"https://api.github.com/repos/mholt/caddy/issues/1127","number":1127,"state":"closed","locked":false,"title":"improvements for Linux systemd integration","user":{"login":"bdaehlie","id":84762,"avatar_url":"https://avatars.githubusercontent.com/u/84762?v=3","gravatar_id":"","url":"https://api.github.com/users/bdaehlie","html_url":"https://github.com/bdaehlie","followers_url":"https://api.github.com/users/bdaehlie/followers","following_url":"https://api.github.com/users/bdaehlie/following{/other_user}","gists_url":"https://api.github.com/users/bdaehlie/gists{/gist_id}","starred_url":"https://api.github.com/users/bdaehlie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdaehlie/subscriptions","organizations_url":"https://api.github.com/users/bdaehlie/orgs","repos_url":"https://api.github.com/users/bdaehlie/repos","events_url":"https://api.github.com/users/bdaehlie/events{/privacy}","received_events_url":"https://api.github.com/users/bdaehlie/received_events","type":"User","site_admin":false},"body":"This PR makes a number of improvements to the Linux systemd service file and instructions.\r\n\r\n* Make the caddy service file compatible with older versions of systemd so it works for more people. Accomplish this by commenting out optional directives that only work with newer versions of systemd.\r\n* Simplify the structure of the instructions.\r\n* Add much more complete step by step instructions for setting up the caddy service.\r\n\r\nI tested this thoroughly on RedHat 7 on AWS, running systemd v219.","created_at":"2016-09-22T21:23:07Z","updated_at":"2016-10-07T22:02:15Z","closed_at":"2016-09-23T22:50:39Z","merged_at":"2016-09-23T22:50:39Z","merge_commit_sha":"3f83eccfbd7f553c593d8e89d173699fb4cd2b61","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mholt/caddy/pulls/1127/commits","review_comments_url":"https://api.github.com/repos/mholt/caddy/pulls/1127/comments","review_comment_url":"https://api.github.com/repos/mholt/caddy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mholt/caddy/issues/1127/comments","statuses_url":"https://api.github.com/repos/mholt/caddy/statuses/a0a7734aa42c24f01f9ff7c925bbe9ce08a08139","head":{"label":"bdaehlie:systemd-fixes","ref":"systemd-fixes","sha":"a0a7734aa42c24f01f9ff7c925bbe9ce08a08139","user":{"login":"bdaehlie","id":84762,"avatar_url":"https://avatars.githubusercontent.com/u/84762?v=3","gravatar_id":"","url":"https://api.github.com/users/bdaehlie","html_url":"https://github.com/bdaehlie","followers_url":"https://api.github.com/users/bdaehlie/followers","following_url":"https://api.github.com/users/bdaehlie/following{/other_user}","gists_url":"https://api.github.com/users/bdaehlie/gists{/gist_id}","starred_url":"https://api.github.com/users/bdaehlie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdaehlie/subscriptions","organizations_url":"https://api.github.com/users/bdaehlie/orgs","repos_url":"https://api.github.com/users/bdaehlie/repos","events_url":"https://api.github.com/users/bdaehlie/events{/privacy}","received_events_url":"https://api.github.com/users/bdaehlie/received_events","type":"User","site_admin":false},"repo":{"id":68861969,"name":"caddy","full_name":"bdaehlie/caddy","owner":{"login":"bdaehlie","id":84762,"avatar_url":"https://avatars.githubusercontent.com/u/84762?v=3","gravatar_id":"","url":"https://api.github.com/users/bdaehlie","html_url":"https://github.com/bdaehlie","followers_url":"https://api.github.com/users/bdaehlie/followers","following_url":"https://api.github.com/users/bdaehlie/following{/other_user}","gists_url":"https://api.github.com/users/bdaehlie/gists{/gist_id}","starred_url":"https://api.github.com/users/bdaehlie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdaehlie/subscriptions","organizations_url":"https://api.github.com/users/bdaehlie/orgs","repos_url":"https://api.github.com/users/bdaehlie/repos","events_url":"https://api.github.com/users/bdaehlie/events{/privacy}","received_events_url":"https://api.github.com/users/bdaehlie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bdaehlie/caddy","description":"Fast, cross-platform HTTP/2 web server with automatic HTTPS","fork":true,"url":"https://api.github.com/repos/bdaehlie/caddy","forks_url":"https://api.github.com/repos/bdaehlie/caddy/forks","keys_url":"https://api.github.com/repos/bdaehlie/caddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bdaehlie/caddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bdaehlie/caddy/teams","hooks_url":"https://api.github.com/repos/bdaehlie/caddy/hooks","issue_events_url":"https://api.github.com/repos/bdaehlie/caddy/issues/events{/number}","events_url":"https://api.github.com/repos/bdaehlie/caddy/events","assignees_url":"https://api.github.com/repos/bdaehlie/caddy/assignees{/user}","branches_url":"https://api.github.com/repos/bdaehlie/caddy/branches{/branch}","tags_url":"https://api.github.com/repos/bdaehlie/caddy/tags","blobs_url":"https://api.github.com/repos/bdaehlie/caddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bdaehlie/caddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bdaehlie/caddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/bdaehlie/caddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bdaehlie/caddy/statuses/{sha}","languages_url":"https://api.github.com/repos/bdaehlie/caddy/languages","stargazers_url":"https://api.github.com/repos/bdaehlie/caddy/stargazers","contributors_url":"https://api.github.com/repos/bdaehlie/caddy/contributors","subscribers_url":"https://api.github.com/repos/bdaehlie/caddy/subscribers","subscription_url":"https://api.github.com/repos/bdaehlie/caddy/subscription","commits_url":"https://api.github.com/repos/bdaehlie/caddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/bdaehlie/caddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/bdaehlie/caddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/bdaehlie/caddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/bdaehlie/caddy/contents/{+path}","compare_url":"https://api.github.com/repos/bdaehlie/caddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bdaehlie/caddy/merges","archive_url":"https://api.github.com/repos/bdaehlie/caddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bdaehlie/caddy/downloads","issues_url":"https://api.github.com/repos/bdaehlie/caddy/issues{/number}","pulls_url":"https://api.github.com/repos/bdaehlie/caddy/pulls{/number}","milestones_url":"https://api.github.com/repos/bdaehlie/caddy/milestones{/number}","notifications_url":"https://api.github.com/repos/bdaehlie/caddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bdaehlie/caddy/labels{/name}","releases_url":"https://api.github.com/repos/bdaehlie/caddy/releases{/id}","deployments_url":"https://api.github.com/repos/bdaehlie/caddy/deployments","created_at":"2016-09-21T22:12:58Z","updated_at":"2016-09-21T22:13:01Z","pushed_at":"2016-09-22T21:16:16Z","git_url":"git://github.com/bdaehlie/caddy.git","ssh_url":"git@github.com:bdaehlie/caddy.git","clone_url":"https://github.com/bdaehlie/caddy.git","svn_url":"https://github.com/bdaehlie/caddy","homepage":"https://caddyserver.com","size":2176,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mholt:master","ref":"master","sha":"d60a26ae30d7e7ca788dcf783a82af1b3a082dd8","user":{"login":"mholt","id":1128849,"avatar_url":"https://avatars.githubusercontent.com/u/1128849?v=3","gravatar_id":"","url":"https://api.github.com/users/mholt","html_url":"https://github.com/mholt","followers_url":"https://api.github.com/users/mholt/followers","following_url":"https://api.github.com/users/mholt/following{/other_user}","gists_url":"https://api.github.com/users/mholt/gists{/gist_id}","starred_url":"https://api.github.com/users/mholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mholt/subscriptions","organizations_url":"https://api.github.com/users/mholt/orgs","repos_url":"https://api.github.com/users/mholt/repos","events_url":"https://api.github.com/users/mholt/events{/privacy}","received_events_url":"https://api.github.com/users/mholt/received_events","type":"User","site_admin":false},"repo":{"id":29207621,"name":"caddy","full_name":"mholt/caddy","owner":{"login":"mholt","id":1128849,"avatar_url":"https://avatars.githubusercontent.com/u/1128849?v=3","gravatar_id":"","url":"https://api.github.com/users/mholt","html_url":"https://github.com/mholt","followers_url":"https://api.github.com/users/mholt/followers","following_url":"https://api.github.com/users/mholt/following{/other_user}","gists_url":"https://api.github.com/users/mholt/gists{/gist_id}","starred_url":"https://api.github.com/users/mholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mholt/subscriptions","organizations_url":"https://api.github.com/users/mholt/orgs","repos_url":"https://api.github.com/users/mholt/repos","events_url":"https://api.github.com/users/mholt/events{/privacy}","received_events_url":"https://api.github.com/users/mholt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mholt/caddy","description":"Fast, cross-platform HTTP/2 web server with automatic HTTPS","fork":false,"url":"https://api.github.com/repos/mholt/caddy","forks_url":"https://api.github.com/repos/mholt/caddy/forks","keys_url":"https://api.github.com/repos/mholt/caddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mholt/caddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mholt/caddy/teams","hooks_url":"https://api.github.com/repos/mholt/caddy/hooks","issue_events_url":"https://api.github.com/repos/mholt/caddy/issues/events{/number}","events_url":"https://api.github.com/repos/mholt/caddy/events","assignees_url":"https://api.github.com/repos/mholt/caddy/assignees{/user}","branches_url":"https://api.github.com/repos/mholt/caddy/branches{/branch}","tags_url":"https://api.github.com/repos/mholt/caddy/tags","blobs_url":"https://api.github.com/repos/mholt/caddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mholt/caddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mholt/caddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mholt/caddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mholt/caddy/statuses/{sha}","languages_url":"https://api.github.com/repos/mholt/caddy/languages","stargazers_url":"https://api.github.com/repos/mholt/caddy/stargazers","contributors_url":"https://api.github.com/repos/mholt/caddy/contributors","subscribers_url":"https://api.github.com/repos/mholt/caddy/subscribers","subscription_url":"https://api.github.com/repos/mholt/caddy/subscription","commits_url":"https://api.github.com/repos/mholt/caddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mholt/caddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mholt/caddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mholt/caddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mholt/caddy/contents/{+path}","compare_url":"https://api.github.com/repos/mholt/caddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mholt/caddy/merges","archive_url":"https://api.github.com/repos/mholt/caddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mholt/caddy/downloads","issues_url":"https://api.github.com/repos/mholt/caddy/issues{/number}","pulls_url":"https://api.github.com/repos/mholt/caddy/pulls{/number}","milestones_url":"https://api.github.com/repos/mholt/caddy/milestones{/number}","notifications_url":"https://api.github.com/repos/mholt/caddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mholt/caddy/labels{/name}","releases_url":"https://api.github.com/repos/mholt/caddy/releases{/id}","deployments_url":"https://api.github.com/repos/mholt/caddy/deployments","created_at":"2015-01-13T19:45:03Z","updated_at":"2016-10-07T21:20:08Z","pushed_at":"2016-10-07T02:40:57Z","git_url":"git://github.com/mholt/caddy.git","ssh_url":"git@github.com:mholt/caddy.git","clone_url":"https://github.com/mholt/caddy.git","svn_url":"https://github.com/mholt/caddy","homepage":"https://caddyserver.com","size":3618,"stargazers_count":8204,"watchers_count":8204,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":528,"mirror_url":null,"open_issues_count":54,"forks":528,"open_issues":54,"watchers":8204,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mholt/caddy/pulls/1127"},"html":{"href":"https://github.com/mholt/caddy/pull/1127"},"issue":{"href":"https://api.github.com/repos/mholt/caddy/issues/1127"},"comments":{"href":"https://api.github.com/repos/mholt/caddy/issues/1127/comments"},"review_comments":{"href":"https://api.github.com/repos/mholt/caddy/pulls/1127/comments"},"review_comment":{"href":"https://api.github.com/repos/mholt/caddy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mholt/caddy/pulls/1127/commits"},"statuses":{"href":"https://api.github.com/repos/mholt/caddy/statuses/a0a7734aa42c24f01f9ff7c925bbe9ce08a08139"}}}}
{"actor":{"display_login":"wmark"}}