Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
iskey committed Jan 31, 2024
1 parent cae6b50 commit 8e0a07e
Showing 1 changed file with 98 additions and 1 deletion.
99 changes: 98 additions & 1 deletion docs/Linux/System/Caddy服务器.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ newgrp docker
## Create caddy file

```json title=/etc/caddy/Caddyfile
iskey.me:443 {
mydomain.com:443 {
tls [email protected]
root * /data/html

Expand All @@ -45,3 +45,100 @@ caddy html
```
[官方文档](https://caddyserver.com/docs/)

## 重新编译caddy容器镜像

### 编译caddy_with_godaddy模块


```Dockerfile
FROM docker.io/library/golang:latest AS builder
#ENV XCADDY_RACE_DETECTOR 1
#ENV XCADDY_DEBUG 1
ENV http_proxy http://x.x.x.x:9090
ENV https_proxy http://x.x.x.x:9090

RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest

RUN xcaddy build \
--with github.com/caddy-dns/godaddy

FROM docker.io/library/caddy:latest

COPY --from=builder /go/caddy /usr/bin/caddy
```

### 执行编译命令

```bash
podman build . --loglevel 3 -t caddy_with_godaddy:latest

or

docker build . -t caddy_with_godaddy:latest
```

## 手动获取证书


参考手动申请域名进行多域名申请,[[Lets Encrypt证书生成#DNS手动申请域名/泛域名证书]]


```bash
acme.sh --issue -d isnokey.shop -d *.isnokey.shop --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please

acme.sh --renew -d isnokey.shop -d *.isnokey.shop --yes-I-know-dns-manual-mode-enough-go-ahead-please
```


acme.sh --renew -d isnokey.shop -d *.isnokey.shop --yes-I-know-dns-manual-mode-enough-go-ahead-please
```
[Mon Jan 29 18:33:40 CST 2024] The domain 'isnokey.shop' seems to have a ECC cert already, lets use ecc cert.
[Mon Jan 29 18:33:40 CST 2024] Renew: 'isnokey.shop'
[Mon Jan 29 18:33:40 CST 2024] Renew to Le_API=https://acme.zerossl.com/v2/DV90
[Mon Jan 29 18:33:41 CST 2024] Using CA: https://acme.zerossl.com/v2/DV90
[Mon Jan 29 18:33:41 CST 2024] Multi domain='DNS:isnokey.shop,DNS:*.isnokey.shop'
[Mon Jan 29 18:33:41 CST 2024] Getting domain auth token for each domain
[Mon Jan 29 18:33:41 CST 2024] Verifying: isnokey.shop
[Mon Jan 29 18:33:52 CST 2024] Processing, The CA is processing your order, please just wait. (1/30)
[Mon Jan 29 18:33:56 CST 2024] Success
[Mon Jan 29 18:33:56 CST 2024] Verifying: *.isnokey.shop
[Mon Jan 29 18:33:57 CST 2024] Processing, The CA is processing your order, please just wait. (1/30)
[Mon Jan 29 18:34:01 CST 2024] Success
[Mon Jan 29 18:34:01 CST 2024] Verify finished, start to sign.
[Mon Jan 29 18:34:01 CST 2024] Lets finalize the order.
[Mon Jan 29 18:34:01 CST 2024] Le_OrderFinalize='https://acme.zerossl.com/v2/DV90/order/X25Dctgiv7yHJvG1maL_xw/finalize'
[Mon Jan 29 18:34:03 CST 2024] Order status is processing, lets sleep and retry.
[Mon Jan 29 18:34:03 CST 2024] Retry after: 15
[Mon Jan 29 18:34:19 CST 2024] Polling order status: https://acme.zerossl.com/v2/DV90/order/X25Dctgiv7yHJvG1maL_xw
[Mon Jan 29 18:34:23 CST 2024] Downloading cert.
[Mon Jan 29 18:34:23 CST 2024] Le_LinkCert='https://acme.zerossl.com/v2/DV90/cert/Ew9fRRhMHdJOi2Bl82C_Jw'
[Mon Jan 29 18:34:26 CST 2024] Cert success.
-----BEGIN CERTIFICATE-----
MIIECjCCA4+gAwIBAgIRAP4YWVi7bVqNymluolWZ2PwwCgYIKoZIzj0EAwMwSzEL
MAkGA1UEBhMCQVQxEDAOBgNVBAoTB1plcm9TU0wxKjAoBgNVBAMTIVplcm9TU0wg
RUNDIERvbWFpbiBTZWN1cmUgU2l0ZSBDQTAeFw0yNDAxMjkwMDAwMDBaFw0yNDA0
MjgyMzU5NTlaMBcxFTATBgNVBAMTDGlzbm9rZXkuc2hvcDBZMBMGByqGSM49AgEG
CCqGSM49AwEHA0IABA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jg7aNqKW6PgdR
92uyLKNDh4e2Ve/O61ytdZrljjINdLTCbNL3G8Pd
-----END CERTIFICATE-----
[Mon Jan 29 18:34:26 CST 2024] Your cert is in: /home/iskey/.acme.sh/isnokey.shop_ecc/isnokey.shop.cer
[Mon Jan 29 18:34:26 CST 2024] Your cert key is in: /home/iskey/.acme.sh/isnokey.shop_ecc/isnokey.shop.key
[Mon Jan 29 18:34:26 CST 2024] The intermediate CA cert is in: /home/iskey/.acme.sh/isnokey.shop_ecc/ca.cer
[Mon Jan 29 18:34:26 CST 2024] And the full chain certs is there: /home/iskey/.acme.sh/isnokey.shop_ecc/fullchain.cer
```

0 comments on commit 8e0a07e

Please sign in to comment.