Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(settings.production.base): set GS_DEFAULT_ACL to publicRead #1108

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

josix
Copy link
Collaborator

@josix josix commented Dec 13, 2022

Types of changes

Thanks for sending a pull request! Please fill in the following content to let us know better about this change.
Please put an x in the box that applies

  • New feature

Steps to Produce this PR

  1. put your google-cloud-storage.json under src/
  2. (Workaround) Rewrite https://github.com/pycontw/pycon.tw/blob/master/src/sponsors/models.py#L14 to return default_storage if False else GoogleCloudStorage()
  3. Copy L138 to L142 in https://github.com/pycontw/pycon.tw/pull/1108/files#diff-2ceb691b10b9d00dad55f62e98e5bf2916af93f9138538355a20604d2650ea8dR138-R142 to pycontw2016.base.py
  4. Run docker-compose -f ./docker-compose-dev.yml up

Description

Describe what the change is
You don't need to explain HOW you change the code. Your code, including comments in the code should explicitly
self-describe enough about how you change the code.

Setting GS_DEFAULT_ACL to publicRead so that the return image URL would exclude the expiration period.

Expected behavior

The retrieved image url would not contain the expiration period.

Related Issue

closes #1107

More Information

Screenshots
image

@mattwang44
Copy link
Member

有先測過這個真的有用嗎XD?

@josix
Copy link
Collaborator Author

josix commented Dec 13, 2022

有喔我剛剛附錯圖了,如附圖

有先測過這個真的有用嗎XD?

@@ -139,3 +139,4 @@
os.path.join(BASE_DIR, "google-cloud-storage.json")
)
GS_BUCKET_NAME = "pycontw-static"
GS_DEFAULT_ACL = "publicRead"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 可以考慮 comment 一下為何需要這個

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I added that.

@baby230211
Copy link
Contributor

logoUrl 後面的 expired time 沒了
LGTM

@josix josix merged commit 2970d1f into master Dec 14, 2022
@josix josix deleted the update/gcs-default-acl branch January 9, 2023 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

setting GS_DEFAULT_ACL to uploading images to GCS
3 participants