承接 tourze/tencent-cloud-dns-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tourze/tencent-cloud-dns-bundle

最新稳定版本:1.0.1

Composer 安装命令:

composer require tourze/tencent-cloud-dns-bundle

包简介

腾讯云DNS域名解析服务Symfony Bundle集成

README 文档

README

Latest Version Total Downloads PHP Version License Build Status Coverage Status

English | 中文

A Symfony bundle that provides integration with Tencent Cloud DNS (DNSPod) service for managing domain records.

Features

  • Manage Tencent Cloud DNS accounts
  • Create and manage DNS domains
  • Create, update, and delete DNS records
  • Synchronize DNS records between Tencent Cloud and local database
  • Support for various DNS record types (A, MX, TXT, CNAME, NS, URI)
  • Command line tools for DNS management

Requirements

  • PHP 8.1 or higher
  • Symfony 7.3 or higher
  • Doctrine ORM 3.0 or higher
  • Tencent Cloud account with DNS service enabled

Installation

composer require tourze/tencent-cloud-dns-bundle

The bundle uses Symfony's auto-configuration, so it will be automatically enabled once installed.

Configuration

This bundle doesn't require any specific configuration in your Symfony application. It uses Doctrine entities to store configuration and data.

Usage

Setting up a Tencent Cloud Account

Before using the DNS features, you need to add a Tencent Cloud account:

use TencentCloudDnsBundle\Entity\Account;

// Create a new account
$account = new Account();
$account->setName('My Tencent Cloud Account');
$account->setSecretId('your-secret-id'); // From Tencent Cloud Console
$account->setSecretKey('your-secret-key'); // From Tencent Cloud Console

// Save the account
$entityManager->persist($account);
$entityManager->flush();

Managing Domains

use TencentCloudDnsBundle\Entity\DnsDomain;

// Create a new domain
$domain = new DnsDomain();
$domain->setName('example.com');
$domain->setAccount($account); // Link to your Tencent Cloud account

// Save the domain
$entityManager->persist($domain);
$entityManager->flush();

Managing DNS Records

use TencentCloudDnsBundle\Entity\DnsRecord;
use TencentCloudDnsBundle\Enum\DnsRecordType;

// Create a new DNS record
$record = new DnsRecord();
$record->setDomain($domain); // Link to your domain
$record->setName('www'); // Subdomain
$record->setType(DnsRecordType::A);
$record->setValue('192.168.1.1'); // IP address for A record
$record->setTtl(600); // Time to live in seconds

// Save the record
$entityManager->persist($record);
$entityManager->flush();

// The record will be synchronized with Tencent Cloud DNS

Synchronizing Records from Tencent Cloud

You can use the provided command to synchronize DNS records from Tencent Cloud to your local database:

bin/console tencent-cloud-dns:sync-domain-record-to-local

How It Works

The bundle provides a set of Doctrine entities to store DNS configuration and records. It uses the Tencent Cloud SDK to communicate with the DNSPod API for creating, updating, and deleting DNS records.

The workflow is as follows:

  1. Create an Account entity with your Tencent Cloud credentials
  2. Create a DnsDomain entity linked to the account
  3. Create DnsRecord entities linked to the domain
  4. The bundle will automatically synchronize the records with Tencent Cloud DNS

Advanced Usage

Using the DNS Service

You can inject the DNS service to programmatically manage DNS records:

use TencentCloudDnsBundle\Service\DnsService;

class MyDnsController
{
    public function __construct(private DnsService $dnsService)
    {
    }

    public function updateRecord(): Response
    {
        // Use the service to interact with Tencent Cloud DNS
        $result = $this->dnsService->updateRecord($record);
        // Handle the result
    }
}

Custom Domain Parser

The bundle includes a domain parser factory for handling domain validation:

use TencentCloudDnsBundle\Service\DomainParserFactory;

$parser = $this->domainParserFactory->create();
$domain = $parser->parse('example.com');

Security

  • API Keys: Store your Tencent Cloud API keys securely. Never commit them to version control.
  • Validation: All entity properties include validation constraints to prevent invalid data.
  • Access Control: Implement proper access control in your application to restrict DNS management operations.

Security Best Practices

  1. Use environment variables for API credentials
  2. Implement proper user authentication and authorization
  3. Validate all user inputs before processing
  4. Use HTTPS for all API communications
  5. Regularly rotate your API keys

Contributing

Please see CONTRIBUTING.md for details on how to contribute to this project.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固