简体   繁体   English

谷歌存储桶配置主页

[英]google storage buckets configuration main page

I made a bucket lets call it my bucket.我做了一个水桶,就叫它我的水桶吧。 I gave "Legacy Storage Read" to this bucket and it means that it should not list the buckets but if someone knows the URL of specific files or folders inside the buckets they could visit it.我为这个存储桶提供了“Legacy Storage Read”,这意味着它不应该列出存储桶,但如果有人知道存储桶中特定文件或文件夹的 URL,他们就可以访问它。

If I enter the only bucket address in URL I get access denied even though, I added index.html ( which is in the root of the bucket) as the main page in the bucket website configuration.如果我在 URL 中输入唯一的存储桶地址,即使访问被拒绝,我也添加了 index.html(位于存储桶的根目录中)作为存储桶网站配置中的主页。 Anyone has any idea why the bucket does not routed to index.html if I just go to the bucket URL?任何人都知道为什么桶没有路由到 index.html 如果我只是 go 到桶 URL?

在此处输入图像描述

Have you configured your permision?你有没有配置你的权限? If this is not the case you can try below steps.如果不是这种情况,您可以尝试以下步骤。
For full details you can refer to this link有关完整详细信息,您可以参考此链接

  1. In the Google Cloud Console, go to the Cloud Storage Browser page.在 Google Cloud Console 中,go 到 Cloud Storage Browser 页面。 Go to Browser Go 到浏览器

  2. Click the Bucket overflow menu () associated with the bucket to which you want to grant a member a role.单击与您要向其授予成员角色的存储桶关联的存储桶溢出菜单 ()。

  3. Choose Edit bucket permissions.选择编辑存储桶权限。

  4. Click the + Add Members/Principal button.单击 + 添加成员/委托人按钮。

  5. In the New members field, enter one or more identities that need access to your bucket.在新成员字段中,输入一个或多个需要访问您的存储桶的身份。 If you want to serve your bucket to the public, then type allUsers如果您想向公众提供您的存储桶,请输入allUsers

  6. Select a role and grant Storage Legacy Object Reader (or roles) from the Select a role drop-down menu. Select 角色并从 Select 角色下拉菜单中授予Storage Legacy Object Reader (或角色)。 You can check at ( Legacy Role Permision reference ).您可以在( Legacy Role Permision 参考)中查看。

  7. Click Save.单击保存。

Also, below steps is to route your bucket to desired html file.此外,以下步骤是将您的存储桶路由到所需的 html 文件。
For full details you can refer to this link Static website examples and tips有关详细信息,您可以参考此链接Static 网站示例和提示

  1. In the Google Cloud Console, go to the Cloud Storage Browser page.在 Google Cloud Console 中,go 到 Cloud Storage Browser 页面。 Go to Browser Go 到浏览器

  2. In the list of buckets, find the bucket you created.在存储桶列表中,找到您创建的存储桶。

  3. Click the Bucket overflow menu () associated with the bucket and select Edit website configuration.单击与存储桶关联的 Bucket 溢出菜单 () 和 select 编辑网站配置。

  4. In the website configuration dialog, specify the main page and error page.在网站配置对话框中,指定主页和错误页面。

  5. Click Save.单击保存。

To learn how to get detailed error information about failed operations in the Cloud Storage browser, see Troubleshooting .要了解如何在云存储浏览器中获取有关失败操作的详细错误信息,请参阅故障排除

It seems like you are trying to connect directly to the object URL in your bucket.似乎您正在尝试直接连接到存储桶中的 object URL。

If your goal is to setup a static website you have to configure the permissions of your bucket so it is accessible to the public and the set up a Load Balancer to serve it.如果您的目标是建立一个 static 网站,您必须配置存储桶的权限,以便公众可以访问它,并设置一个负载均衡器来为其提供服务。

To configure the permissions for your bucket you can follow the steps here .要为您的存储桶配置权限,您可以按照此处的步骤操作。 You can test if they are properly configured by trying to access the object with their URL http://storage.googleapis.com/BUCKET_NAME/OBJECT_NAME , I recommend using a Incognito window to make sure it is accessible for all users.您可以通过尝试访问 object 和他们的 URL http://storage.googleapis.com/BUCKET_NAME/OBJECT_NAME来测试它们是否配置正确,我建议使用隐身模式 window 以确保所有用户都可以访问它。

Once you have configured the permissions you have to configure the Load Balancer, which you can do following this guide.配置权限后,您必须配置负载均衡器,您可以按照指南进行操作。 Please note that even though the guide says you need a domain you can test this feature by leaving the "Frontend configuration" as default and connecting directly to the Load Balancer IP address.请注意,即使指南说您需要一个域,您也可以通过将“前端配置”保留为默认值并直接连接到负载均衡器 IP 地址来测试此功能。

The changes to the "Edit website configuration" option in the buckets are applied to the Load Balancer.对存储桶中“编辑网站配置”选项的更改将应用于负载均衡器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 指向位于 Google 存储桶中的 GCP 中的文件 - Pointing to a file in GCP located in Google Storage Buckets 谷歌云存储桶的扩展授权 - Scaling Authorization for Google Cloud Storage Buckets 如何从谷歌存储/桶中检索最近创建/更新的 blob? - How to retrieve recently create/updated blobs from google storage/buckets? 在 Python/Django 中从 Google Cloud Storage/ Buckets 上传和检索文件 - Upload and retrieve files from Google Cloud Storage/ Buckets in Python/Django 使用 Java 在两个 Google Cloud Storage 存储桶之间复制 - Copy between two Google Cloud Storage buckets using Java 有没有办法在本地将谷歌存储桶中的图像存储为 JPEG? - Is there a way to store image from the google storage buckets as JPEG locally? 如何使用 IAM 用户对 Google Cloud Storage Bucket 进行日志记录和监控 - how to do Logging & Monitoring on Google Cloud Storage Buckets with IAM user 如何根据用户 auth uid 授予对谷歌云存储桶的访问权限 - How to grant access to google cloud storage buckets based on users auth uid 使用 terraform 创建 google 存储桶并为指定的桶设置生命周期规则 - Create google storage bucket using terraform and set life cycle rule for the specified buckets 使用 terraform 创建多个 GCP 存储桶 - Create multiple GCP storage buckets using terraform
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM