-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
331 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
/runtime | ||
/bin | ||
|
||
data.db | ||
|
||
/frontend/node_modules | ||
/frontend/dist | ||
/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
APP_NAME: ${{ github.event.repository.name }} | ||
NAMESPACE: app | ||
REGISTRY: ${{ secrets.DOCKER_REGISTRY && secrets.DOCKER_REGISTRY || 'docker.io' }} | ||
REPOSITORY: ${{ github.repository }} | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Mkdir | ||
run: | | ||
mkdir -p frontend/dist | ||
- name: Lint | ||
uses: golangci/golangci-lint-action@v6 | ||
|
||
- name: Tests | ||
run: | | ||
go test $(go list ./...) | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Set outputs | ||
id: vars | ||
run: | | ||
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
- name: Docker build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
file: Dockerfile | ||
tags: ${{ env.REPOSITORY }}:${{ steps.vars.outputs.sha_short }} | ||
context: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- !main | ||
- !release/* | ||
- !test/* | ||
|
||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
install-mode: goinstall | ||
args: --timeout=30m | ||
|
||
- name: Tests | ||
run: | | ||
go test $(go list ./...) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,4 @@ | |
|
||
/runtime | ||
/bin | ||
|
||
data.db | ||
/datworkflowsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ linters: | |
- nolintlint | ||
|
||
run: | ||
timeout: 10m | ||
timeout: 10m | ||
|
||
linters-settings: | ||
stylecheck: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,75 @@ | ||
# DNS Kit | ||
# DNS Kit | ||
> 一个可以申请SSL证书部署到CDN的工具 | ||
![32c977b8bcba2d7b5b7062c589a3889c](img/README.assets/32c977b8bcba2d7b5b7062c589a3889c.png) | ||
|
||
## 功能 | ||
|
||
- 支持管理多平台DNS记录 | ||
- 支持管理多平台CDN | ||
- 支持自动申请SSL证书 | ||
- 支持自动部署SSL证书到CDN | ||
|
||
## 支持平台 | ||
|
||
- 腾讯云(CDN、DNS) | ||
- 阿里云(DNS) | ||
- 七牛云(CDN) | ||
- Cloudflare(DNS) | ||
- Kubernetes(CDN) | ||
|
||
## 部署方式 | ||
|
||
### Docker(推荐) | ||
|
||
``` | ||
docker run -d \ | ||
-v $PWD/data:/app/runtime \ | ||
-p 5174:5174 \ | ||
--name dns-kit \ | ||
--restart unless-stopped \ | ||
codfrm/dns-kit:latest | ||
``` | ||
|
||
### docker-compose(推荐) | ||
|
||
```yaml | ||
version: '3' | ||
|
||
services: | ||
dns-kit: | ||
image: codfrm/dns-kit:latest | ||
container_name: dns-kit | ||
restart: unless-stopped | ||
volumes: | ||
- ./data:/app/runtime | ||
ports: | ||
- "5174:5174" | ||
``` | ||
```bash | ||
docker-compose up -d | ||
``` | ||
|
||
### 从源代码 | ||
|
||
从源代码构建需要预先准备好以下环境: | ||
|
||
- go 1.22+ | ||
- node 20+ | ||
- yarn | ||
|
||
```bash | ||
git clone https://github.com/CodFrm/dns-kit.git | ||
cd dns-kit | ||
make build | ||
# 创建配置文件 | ||
cp ./configs/config.example.yaml ./configs/config.yaml | ||
# 启动, 默认端口为5174, 版本号根据实际情况修改 | ||
./bin/dns-kit_v1.0.0 | ||
``` | ||
|
||
## 使用 | ||
|
||
访问 http://localhost:5174 默认账号密码为 `admin` `123456` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
# 检查是否存在./runtime/config.yaml文件 | ||
if [ ! -f ./runtime/config.yaml ]; then | ||
echo "配置文件不存在,复制默认配置文件" | ||
mkdir -p runtime | ||
cp ./configs/config.yaml.example ./runtime/config.yaml | ||
# 设置默认字符串长度 | ||
LENGTH=16 | ||
# 生成随机字符串 | ||
RANDOM_STRING=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c $LENGTH) | ||
# 替换配置文件中的变量 | ||
sed -i "s/\${RANDOM_STRING}/${RANDOM_STRING}/g" ./runtime/config.yaml | ||
fi | ||
|
||
# 启动应用 | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: '3' | ||
|
||
services: | ||
dns-kit: | ||
image: codfrm/dns-kit:1.0.0 | ||
container_name: dns-kit | ||
restart: unless-stopped | ||
volumes: | ||
- ./data:/app/runtime | ||
ports: | ||
- "5174:5174" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.