caddy-service

将 Caddy 作为服务运行。「⬛ Run Caddy as a service」

Github星跟蹤圖

service - a caddy plugin

⚠️ This plugin is no longer maintained, nor is it compatible with Caddy 2+.

CircleCI branch
community

This plugin uses github.com/kardianos/service to create services on Caddy. To work, it implements two flags on Caddy executable:

  • -name, which corresponds to the name of the service (default: Caddy).
  • -service, which can be either install, uninstall, start, stop or restart.

Right now, this plugin seems to work well on most systems that kardianos/service supports, which are Windows XP+, Linux/(systemd | Upstart | SysV), and OSX/Launchd.

This plugin wasn't widely tested. We count on the community to let us know if you find any eventual bugs and tell us what we can do to improve its functionality.

Install a Caddy service:

caddy -service install -agree -email myemail@email.com -conf /path/to/Caddyfile [-name optionalServiceName] [-option optionValue]

Notes:

  1. You must set the -conf flag to your Caddyfile. Though, usually Caddy works by using the caddyfile in the directory which the caddy executable resides in, which is not necessarily the working directory. However, the service does not load the Caddyfile from the executable directory, and so must be specified using the -conf flag.
  2. You must set the -agree flag, which says that you have read and agree to the Let's Encrypt Subscriber Agreement. Any type of automated startup requires this flag.
  3. You must set the -email flag to your email address if not specified for a site in the Caddyfile. This email address will be used for TLS certificate generation.
  4. Notice that if you install the service with a name that is not the default's, you will need to specify it everytime you use one of the other commands using the flag -name.
  5. You can install the service with default Caddy flag values (e.g. -conf MyCaddyfile)
  6. On Windows, you'll have to run the install command as an administrator to have access to Windows Services.

Uninstall a Caddy service:

caddy -service uninstall [-name optionalName]

Start a Caddy service:

caddy -service start [-name optionalName]

Stop a Caddy service:

caddy -service stop [-name optionalName]

Restart a Caddy service:

caddy -service restart [-name optionalName]

主要指標

概覽
名稱與所有者hacdias/caddy-v1-service
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證Apache License 2.0
所有者活动
創建於2017-01-14 11:45:32
推送於2020-07-17 18:33:49
最后一次提交2020-07-17 19:31:19
發布數2
最新版本名稱v1.0.1 (發布於 )
第一版名稱v1.0.0 (發布於 )
用户参与
星數68
關注者數5
派生數12
提交數37
已啟用問題?
問題數26
打開的問題數0
拉請求數7
打開的拉請求數0
關閉的拉請求數3
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?