tyler-eon / waffle_gcs Goto Github PK
View Code? Open in Web Editor NEWGoogle Cloud Storage for Waffle
License: Apache License 2.0
Google Cloud Storage for Waffle
License: Apache License 2.0
There has been many attempts to fix some issues with it, but non merged for a while now. If it's dead and we need to make a new one, please tell us.
Hey there,
I have opened the issue on Goth here peburrows/goth#107 but it may very well be an issue with waffle_gcs or with my code / config entirely. I am sorry if this is wrong place.
In short: I am using waffle_gcs on GAE, with a default service account and I am not providing any config, just relying on Goth picking up the defaults.
The service account is a Storage Admin, so has full access to uploading files to buckets. And indeed, uploading itself works. The app, however, crashes every time we are trying to generate signed URL. The issue seems to be with this line:
https://github.com/tyler-eon/waffle_gcs/blob/master/lib/waffle/storage/google/url_v2.ex#L82
which returns :error. Any ideas you may have I appreciate...
When I run mix deps.get
I get the following error message:
Resolving Hex dependencies...
Failed to use "waffle" (version 1.1.0) because
waffle_gcs (versions 0.1.0 and 0.1.1) requires ~> 0.0.3
mix.exs specifies ~> 1.1.0
** (Mix) Hex dependency resolution failed, change the version requirements of your dependencies or unlock them (by using mix deps.update or mix deps.unlock). If you are unable to resolve the conflicts you can try overriding with {:dependency, "~> 1.0", override: true}
Needs an update for waffle
from version 0.0.3 to 1.1.0.
When the image gets uploaded, when I open image URL it gets downloaded instead of being shown in the browser, because the Content-Type header is missing.
For S3 adapter uploader definition can have s3_object_headers/2
function that returns keywords list. Example:
def s3_object_headers(_version, {_file, _scope}) do
[content_type: "image/jpeg"]
end
Waffle GCS adapter currently doesn't have this option, but Arc GCS adapter does (https://github.com/martide/arc_gcs/blob/ad6826124ac176fb52e00869f49a19cde860e227/lib/arc/storage/gcs.ex#L133).
At this moment, this package is not compatible with the new versions of Goth. We should use Goth.fetch/1
instead of Goth.Token.for_scope/1
Deprecation:
warning: Goth.Token.for_scope/1 is deprecated. Use Goth.fetch/1 instead
I'll be happy to contribute in this project to add this support.
Are you open to receive new PRs? Is the library still maintained?
If I have CDN in front of GCS bucket and have this in my config:
config :waffle,
storage: Waffle.Storage.Google.CloudStorage,
bucket: "bucket_name",
asset_host: "cdn-domain.com"
Avatar.url("image.jpg")
will generate URLs that have bucket name in the path, e. g. https://cdn-domain.com/bucket_name/uploads/image.jpg
instead of https://cdn-domain.com/uploads/image.jpg
.
Storage adapter Waffle.Storage.S3
generates URLs correctly without bucket name in the path. GCS adapter should replicate that behaviour.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.