2
0
mirror of https://github.com/acepanel/templates.git synced 2026-02-03 21:07:14 +08:00

feat: 新增彩虹DNS与自动推送

This commit is contained in:
2026-01-16 20:50:29 +08:00
parent a5b37db6c2
commit 3d9349e8f4
44 changed files with 271 additions and 60 deletions

View File

@@ -2,7 +2,7 @@ name:
en: Act Runner
zh_CN: Act Runner
zh_TW: Act Runner
tags:
categories:
- devops
description:
en: A runner for Gitea based on act

View File

@@ -2,7 +2,7 @@ name:
en: AdGuard Home
zh_CN: AdGuard Home
zh_TW: AdGuard Home
tags:
categories:
- tool
- safe
description:

View File

@@ -2,7 +2,7 @@ name:
en: Certd
zh_CN: Certd
zh_TW: Certd
tags:
categories:
- tool
- devops
description:

View File

@@ -2,7 +2,7 @@ name:
en: Certimate
zh_CN: Certimate
zh_TW: Certimate
tags:
categories:
- tool
- devops
description:

22
dnsmgr/data.yml Executable file
View File

@@ -0,0 +1,22 @@
name:
en: Rainbow Aggregated DNSMgr
zh_CN: 彩虹聚合 DNS 管理系统
zh_TW: 彩虹聚合 DNS 管理系統
categories:
- tool
- devops
description:
en: Multi-platform DNS management system with failover switching and SSL certificate automation
zh_CN: 多平台 DNS 聚合管理系统,支持容灾切换和 SSL 证书自动化
zh_TW: 多平台 DNS 聚合管理系統,支援容災切換和 SSL 證書自動化
website: https://github.com/netcccyun/dnsmgr
architectures:
- amd64
environments:
DNSMGR_PORT_HTTP:
description:
en: HTTP Port
zh_CN: HTTP 端口
zh_TW: HTTP 埠
type: port
default: 8081

14
dnsmgr/docker-compose.yml Normal file
View File

@@ -0,0 +1,14 @@
services:
dnsmgr:
image: netcccyun/dnsmgr:latest
restart: always
networks:
- acepanel-network
volumes:
- ./data:/app/www
ports:
- ${DNSMGR_PORT_HTTP}:80
networks:
acepanel-network:
external: true

BIN
dnsmgr/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -2,7 +2,7 @@ name:
en: Elasticsearch
zh_CN: Elasticsearch
zh_TW: Elasticsearch
tags:
categories:
- middleware
- database
description:
@@ -29,10 +29,8 @@ environments:
type: select
default: "true"
options:
- label: "True"
value: "true"
- label: "False"
value: "false"
"True": "true"
"False": "false"
ELASTICSEARCH_PASSWORD:
description:
en: Password

View File

@@ -2,7 +2,7 @@ name:
en: Gatus
zh_CN: Gatus
zh_TW: Gatus
tags:
categories:
- monitor
- tool
description:

View File

@@ -2,7 +2,7 @@ name:
en: GitLab
zh_CN: GitLab
zh_TW: GitLab
tags:
categories:
- devops
description:
en: Complete DevOps platform with version control, CI/CD, and project management

10
go.mod Normal file
View File

@@ -0,0 +1,10 @@
module acepanel-templates
go 1.25.5
require (
github.com/go-resty/resty/v2 v2.17.1
go.yaml.in/yaml/v4 v4.0.0-rc.3
)
require golang.org/x/net v0.43.0 // indirect

8
go.sum Normal file
View File

@@ -0,0 +1,8 @@
github.com/go-resty/resty/v2 v2.17.1 h1:x3aMpHK1YM9e4va/TMDRlusDDoZiQ+ViDu/WpA6xTM4=
github.com/go-resty/resty/v2 v2.17.1/go.mod h1:kCKZ3wWmwJaNc7S29BRtUhJwy7iqmn+2mLtQrOyQlVA=
go.yaml.in/yaml/v4 v4.0.0-rc.3 h1:3h1fjsh1CTAPjW7q/EMe+C8shx5d8ctzZTrLcs/j8Go=
go.yaml.in/yaml/v4 v4.0.0-rc.3/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=

View File

@@ -2,7 +2,7 @@ name:
en: Grafana
zh_CN: Grafana
zh_TW: Grafana
tags:
categories:
- monitor
- tool
description:

View File

@@ -2,7 +2,7 @@ name:
en: Home Assistant
zh_CN: Home Assistant
zh_TW: Home Assistant
tags:
categories:
- ai
- tool
description:

View File

@@ -2,7 +2,7 @@ name:
en: Koishi
zh_CN: Koishi
zh_TW: Koishi
tags:
categories:
- tool
description:
en: Cross-platform high-performance chatbot framework

View File

@@ -2,7 +2,7 @@ name:
en: LobeChat
zh_CN: LobeChat
zh_TW: LobeChat
tags:
categories:
- ai
- tool
description:

View File

@@ -2,7 +2,7 @@ name:
en: Lsky Pro
zh_CN: Lsky Pro
zh_TW: Lsky Pro
tags:
categories:
- storage
- tool
description:

167
main.go Normal file
View File

@@ -0,0 +1,167 @@
package main
import (
"encoding/base64"
"encoding/json"
"fmt"
"os"
"path/filepath"
"github.com/go-resty/resty/v2"
"go.yaml.in/yaml/v4"
)
const (
apiURL = "https://api.acepanel.net/template/import"
batchSize = 10
)
func main() {
apiKey := os.Getenv("API_KEY")
if apiKey == "" {
fmt.Println("Error: API_KEY environment variable is not set")
os.Exit(1)
}
// Get current working directory
cwd, err := os.Getwd()
if err != nil {
fmt.Printf("Error getting current directory: %v\n", err)
os.Exit(1)
}
// Find all data.yml files
var templates []map[string]any
entries, err := os.ReadDir(cwd)
if err != nil {
fmt.Printf("Error reading directory: %v\n", err)
os.Exit(1)
}
for _, entry := range entries {
if !entry.IsDir() {
continue
}
dataPath := filepath.Join(cwd, entry.Name(), "data.yml")
if _, err := os.Stat(dataPath); os.IsNotExist(err) {
continue
}
// Read and parse data.yml
data, err := os.ReadFile(dataPath)
if err != nil {
fmt.Printf("Error reading %s: %v\n", dataPath, err)
continue
}
var template map[string]any
if err := yaml.Unmarshal(data, &template); err != nil {
fmt.Printf("Error parsing %s: %v\n", dataPath, err)
continue
}
// Add directory name as template slug
template["slug"] = entry.Name()
// Convert environments from map to array format
// From: {ENV_NAME: {description: xxx, type: xxx, default: xxx}}
// To: [{name: ENV_NAME, description: xxx, type: xxx, default: xxx}]
if envMap, ok := template["environments"].(map[string]any); ok {
envArray := make([]map[string]any, 0, len(envMap))
for name, value := range envMap {
if envValue, ok := value.(map[string]any); ok {
envItem := map[string]any{"name": name}
for k, v := range envValue {
envItem[k] = v
}
envArray = append(envArray, envItem)
}
}
template["environments"] = envArray
}
// Read docker-compose.yml
composePath := filepath.Join(cwd, entry.Name(), "docker-compose.yml")
composeData, err := os.ReadFile(composePath)
if err != nil {
fmt.Printf("Error reading docker-compose.yml for %s: %v\n", entry.Name(), err)
continue
}
template["compose"] = string(composeData)
// Read and encode logo (check svg first, then png)
var logoPath string
var logoMime string
svgPath := filepath.Join(cwd, entry.Name(), "logo.svg")
pngPath := filepath.Join(cwd, entry.Name(), "logo.png")
if _, err := os.Stat(svgPath); err == nil {
logoPath = svgPath
logoMime = "image/svg+xml"
} else if _, err := os.Stat(pngPath); err == nil {
logoPath = pngPath
logoMime = "image/png"
}
if logoPath != "" {
logoData, err := os.ReadFile(logoPath)
if err != nil {
fmt.Printf("Error reading logo for %s: %v\n", entry.Name(), err)
} else {
template["icon"] = "data:" + logoMime + ";base64," + base64.StdEncoding.EncodeToString(logoData)
}
}
templates = append(templates, template)
fmt.Printf("Loaded template: %s\n", entry.Name())
}
fmt.Printf("\nTotal templates loaded: %d\n", len(templates))
if len(templates) == 0 {
fmt.Println("No templates found")
return
}
// Send templates in batches
client := resty.New()
totalBatches := (len(templates) + batchSize - 1) / batchSize
for i := 0; i < len(templates); i += batchSize {
end := i + batchSize
if end > len(templates) {
end = len(templates)
}
batch := templates[i:end]
batchNum := i/batchSize + 1
jsonData, err := json.Marshal(batch)
if err != nil {
fmt.Printf("Error marshaling batch %d: %v\n", batchNum, err)
continue
}
fmt.Printf("\nSending batch %d/%d (%d templates)...\n", batchNum, totalBatches, len(batch))
resp, err := client.R().
SetHeader("Content-Type", "application/json").
SetHeader("X-API-KEY", apiKey).
SetBody(jsonData).
Post(apiURL)
if err != nil {
fmt.Printf("Error sending batch %d: %v\n", batchNum, err)
continue
}
if resp.IsSuccess() {
fmt.Printf("Batch %d sent successfully (status: %d)\n", batchNum, resp.StatusCode())
} else {
fmt.Printf("Batch %d failed (status: %d): %s\n", batchNum, resp.StatusCode(), resp.String())
}
}
fmt.Println("\nImport completed!")
}

View File

@@ -2,7 +2,7 @@ name:
en: MariaDB
zh_CN: MariaDB
zh_TW: MariaDB
tags:
categories:
- database
description:
en: Open source relational database, MySQL fork

View File

@@ -1,8 +1,8 @@
name:
en: Mliev DWZ
zh_CN: Mliev DWZ
zh_TW: Mliev DWZ
tags:
zh_CN: 木雷坞短网址
zh_TW: 木雷坞短鏈接
categories:
- tool
description:
en: Enterprise-level URL shortener service platform
@@ -35,10 +35,8 @@ environments:
type: apps
default: mysql
options:
- label: MySQL
value: mysql
- label: PostgreSQL
value: postgres
"MySQL": "mysql"
"PostgreSQL": "postgres"
MLIEV_DWZ_DB_HOST:
description:
en: Database Host

View File

@@ -2,7 +2,7 @@ name:
en: MS SQL Server
zh_CN: MS SQL Server
zh_TW: MS SQL Server
tags:
categories:
- database
description:
en: Microsoft SQL Server relational database

View File

@@ -2,7 +2,7 @@ name:
en: MySQL
zh_CN: MySQL
zh_TW: MySQL
tags:
categories:
- database
description:
en: World's most popular open source relational database

View File

@@ -2,7 +2,7 @@ name:
en: Nacos
zh_CN: Nacos
zh_TW: Nacos
tags:
categories:
- middleware
- devops
description:
@@ -78,10 +78,8 @@ environments:
type: select
default: "FALSE"
options:
- label: "TRUE"
value: "TRUE"
- label: "FALSE"
value: "FALSE"
"True": "TRUE"
"False": "FALSE"
NACOS_AUTH_IDENTITY_KEY:
description:
en: Auth Identity Key

View File

@@ -2,7 +2,7 @@ name:
en: New API
zh_CN: New API
zh_TW: New API
tags:
categories:
- ai
- tool
description:

View File

@@ -2,7 +2,7 @@ name:
en: Nextcloud
zh_CN: Nextcloud
zh_TW: Nextcloud
tags:
categories:
- storage
- tool
description:

View File

@@ -2,7 +2,7 @@ name:
en: Nezha
zh_CN: 哪吒监控
zh_TW: 哪吒監控
tags:
categories:
- monitor
- tool
description:

View File

@@ -2,7 +2,7 @@ name:
en: Ollama
zh_CN: Ollama
zh_TW: Ollama
tags:
categories:
- ai
- tool
description:

View File

@@ -2,7 +2,7 @@ name:
en: One API
zh_CN: One API
zh_TW: One API
tags:
categories:
- ai
- tool
description:

View File

@@ -2,7 +2,7 @@ name:
en: OpenList
zh_CN: OpenList
zh_TW: OpenList
tags:
categories:
- storage
- tool
description:

View File

@@ -2,7 +2,7 @@ name:
en: pgAdmin 4
zh_CN: pgAdmin 4
zh_TW: pgAdmin 4
tags:
categories:
- tool
description:
en: PostgreSQL management and development platform

View File

@@ -2,7 +2,7 @@ name:
en: PostgreSQL
zh_CN: PostgreSQL
zh_TW: PostgreSQL
tags:
categories:
- database
description:
en: Powerful open source object-relational database system

View File

@@ -2,7 +2,7 @@ name:
en: Prometheus
zh_CN: Prometheus
zh_TW: Prometheus
tags:
categories:
- monitor
description:
en: Open source monitoring and alerting toolkit

View File

@@ -2,7 +2,7 @@ name:
en: Qinglong
zh_CN: 青龙
zh_TW: 青龍
tags:
categories:
- tool
description:
en: Scheduled task management platform

View File

@@ -2,7 +2,7 @@ name:
en: RabbitMQ
zh_CN: RabbitMQ
zh_TW: RabbitMQ
tags:
categories:
- middleware
description:
en: Feature-rich multi-protocol messaging broker

View File

@@ -2,7 +2,7 @@ name:
en: Redis
zh_CN: Redis
zh_TW: Redis
tags:
categories:
- database
- middleware
description:

View File

@@ -2,7 +2,7 @@ name:
en: RocketMQ
zh_CN: RocketMQ
zh_TW: RocketMQ
tags:
categories:
- middleware
description:
en: Cloud-native messaging and streaming platform

View File

@@ -2,7 +2,7 @@ name:
en: RustDesk
zh_CN: RustDesk
zh_TW: RustDesk
tags:
categories:
- tool
- game
description:

View File

@@ -2,7 +2,7 @@ name:
en: RustFS
zh_CN: RustFS
zh_TW: RustFS
tags:
categories:
- middleware
- storage
description:
@@ -50,7 +50,5 @@ environments:
type: select
default: "true"
options:
- label: "True"
value: "true"
- label: "False"
value: "false"
"True": "true"
"False": "false"

View File

@@ -2,7 +2,7 @@ name:
en: Apache Tomcat
zh_CN: Apache Tomcat
zh_TW: Apache Tomcat
tags:
categories:
- middleware
description:
en: Open source Java Servlet container and web server

View File

@@ -2,7 +2,7 @@ name:
en: Umami
zh_CN: Umami
zh_TW: Umami
tags:
categories:
- tool
- monitor
description:
@@ -29,10 +29,8 @@ environments:
type: select
default: postgresql
options:
- label: MySQL
value: mysql
- label: PostgreSQL
value: postgresql
"MySQL": "mysql"
"PostgreSQL": "postgresql"
UMAMI_DB_HOST:
description:
en: Database Host

View File

@@ -2,7 +2,7 @@ name:
en: Uptime Kuma
zh_CN: Uptime Kuma
zh_TW: Uptime Kuma
tags:
categories:
- tool
- devops
description:

View File

@@ -2,7 +2,7 @@ name:
en: Vaultwarden
zh_CN: Vaultwarden
zh_TW: Vaultwarden
tags:
categories:
- tool
- safe
description:

View File

@@ -2,7 +2,7 @@ name:
en: Watchtower
zh_CN: Watchtower
zh_TW: Watchtower
tags:
categories:
- tool
- devops
description:

View File

@@ -2,7 +2,7 @@ name:
en: Windows
zh_CN: Windows
zh_TW: Windows
tags:
categories:
- tool
description:
en: Run Windows in Docker container with KVM acceleration