1 Star 0 Fork 0

Serverless Devs Registry / fc3-domain

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

通过该组件,快速部署函数计算自定义域名

快速使用

  1. 在本地创建s.yaml
edition: 3.0.0 #  命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
name: fcDomainApp #  项目名称
access: quanxi #  秘钥别名

resources:
  fc-domain-test: #  服务名称
    component: fc3-domain
    props: #  组件的属性值
      region: cn-huhehaote
      domainName: my.abc.com
      protocol: HTTP # HTTP | HTTPS 
      routeConfig:
        routes:
          - functionName: test-serverless-devs-custom-domain-ci-1
            methods:
              - GET
            path: /a
            qualifier: LATEST
          - functionName: test-serverless-devs-custom-domain-ci-2
            methods:
              - GET
            path: /bb
            qualifier: LATEST
  1. 可以通过s deploy快速进行部署

完整配置

edition: 3.0.0 #  命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
name: fcDomainApp #  项目名称
access: quanxi #  秘钥别名

resources:
  fc-domain-test:
    component: fc3-domain
    props: #  组件的属性值
      region: cn-huhehaote
      # domainName: auto
      domainName: xiliu-test.shoushuai.top # 可以使用 auto 自动获取一个临时测试域名
      protocol: HTTP,HTTPS  # HTTP | HTTPS | HTTP,HTTPS
      routeConfig:
        routes:
          - functionName: test-serverless-devs-custom-domain-ci-1
            methods:
              - GET
            path: /a
            qualifier: LATEST
            rewriteConfig:
              equalRules:
                - match: /equalRules
                  replacement: /xxxx
              regexRules:
                - match: ^/old/[a-z]+/
                  replacement: /xxxx
              wildcardRules:
                - match: /api/*
                  replacement: /$1
          - functionName: test-serverless-devs-custom-domain-ci-2
            methods:
              - GET
            path: /bb
            qualifier: LATEST

      wafConfig:
        enableWAF: false
      
      tlsConfig:
        cipherSuites:
          - "TLS_RSA_WITH_AES_128_CBC_SHA"
          - "TLS_RSA_WITH_AES_256_CBC_SHA"
          - "TLS_RSA_WITH_AES_128_GCM_SHA256"
          - "TLS_RSA_WITH_AES_256_GCM_SHA384"
          - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"
          - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"
          - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"
          - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"
          - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
          - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
          - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
          - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
          - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305"
          - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305"
          - "TLS_RSA_WITH_RC4_128_SHA"
          - "TLS_RSA_WITH_3DES_EDE_CBC_SHA"
          - "TLS_RSA_WITH_AES_128_CBC_SHA256"
          - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA"
          - "TLS_ECDHE_RSA_WITH_RC4_128_SHA"
          - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA"
          - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"
          - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
        maxVersion: TLSv1.3
        minVersion: TLSv1.0
     
      certConfig:
        certName: test-cert
        certificate: oss://cn-huhehaote/serverless-devs-fc3-ci-test/xiliu-test.shoushuai.top.pem
        privateKey: oss://cn-huhehaote/serverless-devs-fc3-ci-test/xiliu-test.shoushuai.top.key
	  
      # certConfig:
      #   certName: test-cert
      #   certificate: /Users/songluo/work/code-inc/domain/examples/xiliu-test.shoushuai.top.pem
      #   privateKey: /Users/songluo/work/code-inc/domain/examples/xiliu-test.shoushuai.top.key

      # certConfig:
      #   certName: test-cert
      #   certificate: https://images.devsapp.cn/test/xiliu-test-cert/xiliu-test.shoushuai.top.pem
      #   privateKey: https://images.devsapp.cn/test/xiliu-test-cert/xiliu-test.shoushuai.top.key


      # certConfig:
      #   certId: 7246639

      # authConfig:
      #   authInfo: xxx
      #   authType: jwt || function || anonymous

其中针对 certConfig 可以支持如下四种方式:

    1. 本地文件形式
    1. http url 形式
    1. oss object 地址形式
    1. 阿里云数字证书管理服务中的ssl证书 id

参数详情

参数名 必填 类型 参数描述
region True enum 地域
domainName True string 已在阿里云备案或接入备案的自定义域名名称
protocol True enum 域名支持的协议类型: HTTP:仅支持HTTP协议 HTTPS:仅支持HTTPS协议 HTTP,HTTPS:支持HTTP及HTTPS协议
routeConfig True object 路由表:自定义域名访问时的PATH到Function的映射
certConfig False object HTTPS证书的信息
tlsConfig False object TLS配置信息
wafConfig False object Web应用防火墙配置信息

命令相关

Deploy命令

进行函数计算自定义域名部署

参数全称 参数缩写 Yaml 模式下必填 参数含义
assume-yes y 选填 在交互时,默认选择y
access a 选填 本次请求使用的密钥,可以使用通过config 命令 配置的密钥信息,以及配置到环境变量的密钥信息
debug - 选填 打开debug模式,将会输出更多日志信息
help h 选填 查看帮助信息

Remove命令

移除函数计算自定义域名

参数全称 参数缩写 Yaml 模式下必填 Cli 模式下必填 参数含义
region - 选填 必填 地区,取值范围请参考: 函数计算开服地域
domain-name - 选填 必填 自定义域名名字,比如 myabc.com
assume-yes y 选填 选填 在交互时,默认选择y
access a 选填 必填 本次请求使用的密钥,可以使用通过config 命令 配置的密钥信息,以及配置到环境变量的密钥信息
debug - 选填 选填 打开debug模式,将会输出更多日志信息
help h 选填 选填 查看帮助信息

Plan命令

展示函数计算自定义域名本地yaml配置和线上自定义域名配置差异

参数全称 参数缩写 Yaml 模式下必填 参数含义
access a 选填 本次请求使用的密钥,可以使用通过config 命令 配置的密钥信息,以及配置到环境变量的密钥信息
debug - 选填 打开debug模式,将会输出更多日志信息
help h 选填 查看帮助信息

Info命令

显示已经部署到线上的自定义域名配置信息

参数全称 参数缩写 Yaml 模式下必填 Cli 模式下必填 参数含义
region - 选填 必填 地区,取值范围请参考: 函数计算开服地域
domain-name - 选填 必填 自定义域名名字,比如 myabc.com
access a 选填 必填 本次请求使用的密钥,可以使用通过config 命令 配置的密钥信息,以及配置到环境变量的密钥信息
debug - 选填 选填 打开debug模式,将会输出更多日志信息
help h 选填 选填 查看帮助信息
MIT License Copyright (c) 2020 Serverless Devs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

None 展开 收起
TypeScript 等 3 种语言
MIT
取消

发行版 (3)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/devsapp/fc3-domain.git
git@gitee.com:devsapp/fc3-domain.git
devsapp
fc3-domain
fc3-domain
master

搜索帮助