我已经成功创建了一个托管在Google云端存储上的静态网站.
存储桶名称如下:www.example.com
和我指向www的CNAME记录 c.storage.googleapis.com
我已使用Google网站站长工具验证了www和root域名.
在Google网站管理员工具上,我将www设置为主域名(我不知道这是否相关,但在此处的另一篇文章中看到了它的引用)并且重要的是我从www子域而不是根目录服务该站点.
我可以很好地访问www.example.com,但无论我尝试使用我的根域,我只会得到<NoSuchBucket>错误.
信息点:我的DNS由Cloudflare管理.当我使用Github页面来托管静态站点时,我通常会将根指向具有CNAME记录的www(并且根本没有A记录,因为Cloudflare允许CNAME展平),但这在此处不起作用.
我已经尝试将我的根域指向带有CNAME记录的www并尝试将其指向 c.storage.googleapis.com.
步骤2 的云存储网站配置文档说:" For example, for example.com, the CNAME record contains the following information: www CNAME c.storage.googleapis.com"但没有提到指向根域,但这必须是一个常见的要求.
我意识到我可以使用根域创建一个额外的存储桶并将其指向http中的www,但似乎应该有一种方法可以使用DNS记录执行此操作.
我在 Google Cloud 中有两个项目。在第一个项目中,我在容器注册表中有一些图像,我在 gke 中使用它。
当我尝试在第二个项目中创建容器时,它给了我一个错误:
错误:状态 403 试图拉存储库 project-1/image-x:“拒绝访问。”
我如何在 gke 中但在不同的项目中使用这些图像?我不想在第二个项目中创建相同的图像。
我成功地创建了一个独立的Java应用程序,可以为Google云端存储中的资产创建过期签名URL.但是,我一直未能成功通过AppEngine确定如何为这些相同的资产创建过期签名URL.
如何创建Google云端存储资产的过期签名URL,我可以返回到客户端应用程序?
这是我的Java应用程序:
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.Signature;
import java.security.UnrecoverableKeyException;
import java.util.Calendar;
import org.apache.commons.codec.binary.Base64;
public class GCSSignedURL {
public static void main(String[] args) throws Exception {
final String googleAccessId = "XXXXXXXXXXXX@developer.gserviceaccount.com";
final String keyFile = "D:\\XXXXXXXXXXXXXXXXXXXXXXXXXXXXX-privatekey.p12";
final String keyPassword = "notasecret";
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MINUTE, 30);
String httpVerb = "GET";
String contentMD5 = "";
String contentType = "";
long expiration = calendar.getTimeInMillis();
String canonicalizedExtensionHeaders = "";
String canonicalizedResource = "/myproj/foo.txt";
String stringToSign …Run Code Online (Sandbox Code Playgroud)