Socket
Book a DemoInstallSign in
Socket

ddns-ali

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ddns-ali

提供阿里云的DDNS设置,支持多网卡多域名绑定public --access

Source
npmnpm
Version
1.0.4-beta.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

ddns-ali

提供阿里云的DDNS设置,支持多网卡多域名绑定。

特性

  • 支持阿里云DDNS设置
  • 支持针对多个线路多个网卡单独设置域名
  • 支持IPv4,IPv6
  • 支持Docker

说明

每次运行时,会打印本地适配器信息,推荐根据网卡名绑定域名

必须在阿里云后台建立域名,记录值填写什么无所谓。

阿里云AccessKey开通:https://help.aliyun.com/document_detail/38738.html

安装方式

npm i -g ddns-ali 

命令执行

参数之间只能有一个空格

多网卡绑定多域名方式:

ddns-ali -e true -AccessKey 123 -AccessKeySecret 123 -Domain 'eth0&eth0.xxx.com,eth1&eth1.xxx.com'

单域名方式 不指定网卡,会根据你当前的外网IP动态绑定,如果支持IPv6,会优先绑定

ddns-ali -e true -AccessKey 123 -AccessKeySecret 123 -Domain 'eth0.xxx.com'

指定IPv6方式

ddns-ali -e true -ip 6 -AccessKey 123 -AccessKeySecret 123 -Domain '网卡名&eth0.xxx.com'

程序引入方式

import { IConfig,mian } from 'ddns-ali';

async function init(){
    const config = {} as IConfig;
    config.AccessKey = getArgv('AccessKey') as string;
    config.AccessKeySecret = getArgv('AccessKeySecret') as string;
    config.IPVersion = getArgv('ip') as any || '4';
    config.DomainObj = getDomain(getArgv('Domain'));
    config.Domain = config.DomainObj.domain;
    config.Ethernets = config.DomainObj.ethernet;

    const r = await mian(config);
    if(r) {
        log('---成功---');
    }else{
        log('---失败---');
    }
}

参数

  • -e true或false true是命令行执行
  • -Domain '网卡名1&域名1,网卡名2&域名2', 网卡名与域名通过‘&’进行连接,多个域名使用','分割
  • -ip 4或6 指定要绑定的的ip类型

Keywords

aliyun

FAQs

Package last updated on 24 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts