我可以通过API向Firebase主机添加域吗?

cdmah0mi  于 2022-11-17  发布在  其他
关注(0)|答案(4)|浏览(135)

我希望能够使用API而不是Web UI将域添加到Firebase托管中,可以吗?
我想添加数百个域,Firebase中每个项目是否有域限制?

u5rb5r59

u5rb5r591#

As far as I can tell from the entire CLI documentation , there isn't any way to do this.
Lets take a step back and consider what the web UI process involves i.e. the generation of a TXT record to add to your DNS records, after verifying the presence of said TXT record on the domain, providing A records that you (authorized owner) add to allow redirecting to your firebase hosted site.
In my opinion, this very manual back and forth is necessary as a security measure. The only way it is taken out of the equation via the CLI is by providing a means for you to authenticate ownership of a domain (registered with any one of many domain registrars), and being granted authorization to change your A records. These are both outside the scope of Firebase, and could potentially introduce severe security flaws. Regardless, even if it existed, it would still have to be step-by-step and somewhat manual via CLI rather than the single command it sounds like you're looking for.

4uqofj5v

4uqofj5v2#

目前无法通过API自动添加自定义域。
它也不允许您创建代理商或多租户项目(即动态连接大量域或子域),因为您无法将超过36个域连接到一个项目。

mbjcgjjk

mbjcgjjk3#

可以使用Firebase Hosting Rest Api添加域名。我不知道为什么他们没有把它放在官方网站上,但我今天检查了一下,它工作正常。https://developers.google.com/resources/api-libraries/documentation/firebasehosting/v1beta1/java/latest/com/google/api/services/firebasehosting/v1beta1/FirebaseHosting.Sites.Domains.html

swvgeqrz

swvgeqrz4#

我从Firebase支持部门收到的答复:
目前还没有允许您添加自定义域的API,之前曾要求将其作为一项功能,但遗憾的是,我们没有更多有关此功能的信息-因此,目前只有控制台UI允许您添加自定义域。
在限制方面,在一个项目中,一个自定义域被附加到一个网站-每个项目可以有36个网站,对于一个网站没有硬性限制,但我们建议不要超过20个自定义域。当每个网站超过20个域时,您可能会遇到SSL证书的技术问题,我们无法解决这些问题,因为系统不是为此类用例设计的。

相关问题