You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
9 months ago
|
---
|
||
|
title: Traefik将acme.json 分割成证书
|
||
|
tags:
|
||
|
- 网络
|
||
7 months ago
|
categories: NAS技术
|
||
9 months ago
|
abbrlink: 60950
|
||
|
date: 2023-06-22 11:02:22
|
||
|
keywords:
|
||
|
description:
|
||
|
---
|
||
|
我们在使用Let’s Encrypt进行自动证书获取时,是将TLS信息存放到acme.json中的。但是总有那么些原因要用到证书,比如我在同一个域名下,有另外一个服务没有使用traefik代理,这时候就需要将acme.json分割成证书。
|
||
|
|
||
|
在此,使用docker-compose安装certdump来对acme.json进行分割。
|
||
|
|
||
|
在traefik目录下,创建certdump.yml文件。
|
||
|
|
||
|
<img src="https://img.dreamlyn.cn:8443/i/2024/02/23/101307.webp">
|
||
|
|
||
|
文件内容如下:
|
||
|
```
|
||
|
---
|
||
|
version: "3"
|
||
|
services:
|
||
|
certdumper:
|
||
|
image: humenius/traefik-certs-dumper:latest
|
||
|
container_name: certdumper
|
||
|
environment:
|
||
|
- PUID=1000
|
||
|
- PGID=1000
|
||
|
- TZ=Asia/Shanghai
|
||
|
volumes:
|
||
|
- ./configs:/traefik:ro
|
||
|
- ./output:/output:rw
|
||
|
networks:
|
||
|
default:
|
||
|
external:
|
||
|
name: docker_default
|
||
|
```
|
||
|
此时在traefik目录下执行如下命令:
|
||
|
```
|
||
|
# 创建docker网络
|
||
|
docker network create -d bridge --attachable=true docker_default
|
||
|
# 启动容器,分割acme.json
|
||
|
docker-compose -f certdump.yml up -d
|
||
|
```
|
||
|
容器启动后,将会在output文件夹下导出证书。
|