⚠️ I've stopped work on this extension b/c the OpenStack provider I was using on a project didn't have CORS support. To complete this effort, we need an OpenStack provider with CORS support. I'm happy to review PRs or handoff the code to someone who is keen on maintaining the code. 😃
👏 I'm happy to report @chaadow has completed this work. You should use https://github.com/chaadow/activestorage-openstack/ going forward!!
Add this line to your application's Gemfile:
gem "mime-types"
gem 'activestorage-openstack'
And then execute:
$ bundle
In your storage.yml
, create an entry for your OpenStack service. Like other
services, you can create as many as you want. For example, you might a separate
service definition for staging and production so you can isolate the containers.
dev_openstack:
service: OpenStack
container: <container name>
credentials:
openstack_auth_url: <auth url>
openstack_username: <username>
openstack_api_key: <password>
openstack_project_name: <tenant name>
openstack_domain_id: default
openstack_temp_url_key: <temp url key>
connection_options: # optional
You can put what the appropriate login params for your version of Keystone in
credentials. They will all be passed to Fog::Storage::OpenStack.new
.
In your OpenStack provider's dashboard, set your container to private. Next, set
the Temp-URL-Key
on the container or account. You'll likely have to use the
CLI tools to set this value. Instructions can be found in the tempUrl
Docs
⚠️ If you're using macOS, you might have trouble running theswift
command as the Swift compiler has the same name. You might have to call the OpenStack swift tool with it's fully qualified name. Check/usr/local/bin/swift
if you run into problems. Depending how yourPATH
is set your mileage may vary. This should get you started in your hunt. 😃
- Complete direct uploads implementation. CORS must be supported on OpenStack for this to be possible.
- Support disposition and filename in URLs
- Fix streaming for downloads
- Smartly pick whether uploads should be chunked
- Require mime-types so as to not require extra setup.
- Test the service
After checking out the repo, run bin/setup
to install dependencies. Then, run
rake test
to run the tests. You can also run bin/console
for an interactive
prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To
release a new version, update the version number in version.rb
, and then run
bundle exec rake release
, which will create a git tag for the version, push
git commits and tags, and push the .gem
file to
rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/jeffreyguenther/activestorage-openstack. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Activestorage::Openstack project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.