-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fix/upload image url #317
Fix/upload image url #317
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloud Formationのymlのcommitもお願いします。
すでに本体でつかってるこれをいじれば簡単にできると思います。
@komtaki これでどうでしょうか? |
def url(*) | ||
encoded_path = encode_path(path) | ||
if (host = asset_host) | ||
if host.respond_to? :call | ||
"#{host.call(self)}/#{encoded_path}" | ||
else | ||
"#{host}/#{encoded_path}" | ||
end | ||
else | ||
(base_path || "") + path | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ちょっとここの定義がなぜこうなっているかがよく分かりませんでした…。
それ以外は特に問題なさそうでした。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これがいうゆるcloud frontのエンドポイントにs3の画像の宛先を向けている箇所で、中身に関しては、carriwaveからほとんどそのまま取ってきたので、aseet_hostが必ずある前提で組むでもいいかなとも思ってます!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
形修正しました!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Carrierwaveあんまり詳しくないのですが、たしかにこんな感じになるかなあ…という気もします(あんまり自信ないですが)。
とりあえずこれでやってみるでいいんではないでしょうか。
対応ありがとうございます。:bow: |
@komtaki |
ありがとうございます。s3を新しく作るなら、一緒にcloud formationで作る。作り直さないならパラメーターでアタッチするでいいと思います。:+1: |
ということはそこの分岐などを用意した方がいいんでしょうか..? |
さすがに分岐はできないです。今回はs3のバケットを作るなら、今のままで不要なパラメータを削ればいいと思います。:+1: 「全部Cloud Formationで作るなら、yamlに全部書く」、「一部手動で作成したリソースをCloud Formationで使うなら、パラメータでARNとかを流し込んで使う」のどちらかの対応をするのかという意味です。 |
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
指摘箇所修正しました! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
いろいろ対応ありがとうございます。:clap:
🎩 What? Why?
uploadされた画像の配信をS3からcloudfrontで行うようにする
📌 Related Issues
https://meta.diycities.jp/assemblies/nazo/f/286/proposals/297
📋 Subtasks
CHANGELOG
upgrade notes, if required