Skip to content
This repository has been archived by the owner on Aug 21, 2021. It is now read-only.

mdouchement/swift-server

Repository files navigation

Swift-server

Deprecated

Use https://github.com/mdouchement/openstackswift instead.


Only for development and test purpose.

Swift-server is a Sinatra server that responds to the same calls Openstack Swift responds to. It's a convenient way to use Swift out-of-the-box without any fancy dependencies and configuration.

Swift-server doesn't support all of the Swift command set, but the basic ones like upload, download, list, copy, authentication, and make containers are supported. More coming soon™. See file app.rb for supported commands.

Requirements

  • MRI (developmed on 2.7.1)
  • bundler

Installing

$ bundle install

Running

$ export WEB_CONCURRENCY=3
$ bundle exec unicorn -p 10101 -c config/unicorn.rb

# http://localhost:10101
# tenant: test
# username: tester
# password: testing

# http://localhost:10101/v3
# tenant: test
# domain: Default
# region: RegionOne
# name: tester
# password: testing

# storage token: tk_tester

Environment variables:

WEB_CONCURRENCY
SWIFT_STORAGE_TENANT
SWIFT_STORAGE_DOMAIN
SWIFT_STORAGE_USERNAME
SWIFT_STORAGE_PASSWORD

Development

$ bundle install
$ SWIFT_STORAGE_TENANT=test SWIFT_STORAGE_USERNAME=tester SWIFT_STORAGE_PASSWORD=testing bundle exec rerun -b -- rackup -o localhost -p 10101

License

MIT. See the LICENSE for more details.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Ensure specs and Rubocop pass
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

About

Mock server for Openstack Swift object storage

Resources

License

Stars

Watchers

Forks

Packages

No packages published