{"id":21657012,"url":"https://github.com/cotag/condominios","last_synced_at":"2025-04-11T22:12:40.698Z","repository":{"id":4704074,"uuid":"5851495","full_name":"cotag/Condominios","owner":"cotag","description":"A condo for your users files","archived":false,"fork":false,"pushed_at":"2023-03-08T19:49:06.000Z","size":387,"stargazers_count":48,"open_issues_count":11,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-11T22:12:34.220Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cotag.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-09-18T04:40:47.000Z","updated_at":"2022-04-12T00:44:30.000Z","dependencies_parsed_at":"2023-02-16T14:45:53.876Z","dependency_job_id":"ecf5a0ff-1420-476f-b1be-08bc3e0c015c","html_url":"https://github.com/cotag/Condominios","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2FCondominios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2FCondominios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2FCondominios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2FCondominios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cotag","download_url":"https://codeload.github.com/cotag/Condominios/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487683,"owners_count":21112190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T09:18:45.478Z","updated_at":"2025-04-11T22:12:40.671Z","avatar_url":"https://github.com/cotag.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"h1. Condominios aka Condo\n\nA \"Rails plugin\":http://guides.rubyonrails.org/plugins.html and \"AngularJS application\":http://angularjs.org/ that makes direct uploads to multiple cloud storage providers easy.\nOnly supports \"XMLHttpRequest Level 2\":http://en.wikipedia.org/wiki/XMLHttpRequest capable browsers and cloud providers that have a \"RESTful API\":http://en.wikipedia.org/wiki/Representational_state_transfer with \"CORS\":http://en.wikipedia.org/wiki/Cross-origin_resource_sharing support.\n\n\nWhy compromise?\n\nGet started now: @gem install condo@ or checkout the \"example application\":https://github.com/cotag/condo_example\nAlso see our \"github pages site\":http://cotag.github.com/Condominios/\n\n\nh2. License\n\nGNU Lesser General Public License v3 (LGPL version 3)\n\n\nh2. Concept\n\nCondominios was created to provide direct to cloud uploads using standards based browser technology. However it is not limited to that use case.\nThe API is RESTful, providing an abstraction layer and signed URLs that can be utilised in native (mobile) applications.\n\nThe main advantages are:\n* Off-loads processing to client machines\n* Better guarantees against upload corruption\n** file hashing on the client side\n* Upload results are guaranteed\n** user is always aware of any failures in the process\n* Detailed progress and control over the upload\n \nThis has numerous advantages over traditional Form Data style post uploads too.\n* Progress bars\n* Resumability when uploading large files\n* Optional parallel uploads (multiple parts of the file simultaneously)\n\n\nSupport for all major browsers\n* Chrome\n* Firefox\n* Safari\n* Opera\n* IE10+\n\n\nh2. Usage\n\nh3. Terms\n\n* Residence == the current storage provider\n* Resident == the current user\n\n\nh3. Quick Start\n\nSee the \"example application\":https://github.com/cotag/condo_example which implements the steps below on an otherwise blank rails app.\n\n# Add the following to your rails application gemfile:\n#* @gem 'condo'@\n#* Add a datastore\n#** @gem 'condo_active_record'@ (for traditional databases)\n#** \"condo_mongoid\":https://github.com/axomi/condo_mongoid by \"axomi\":https://github.com/axomi for \"MongoDB\":http://mongodb.org/\n#* @gem 'condo_interface'@ (optional - an example interface)\n# Run migrations if using active record\n#* @rake railties:install:migrations FROM=condo_active_record@\n#* @rake db:migrate@\n# Create an initialiser for any default residencies. (details further down)\n# Create controllers that will be used as Condo endpoints\n#* Typically @rails g controller Uploads@\n#* Add the resource to your routes\n# At the top of the new controller add the following line to the class: @include Condo@\n#* This creates the following public methods at run time: new, create, edit, update, destroy implementing the API\n#* The following protected methods are also generated: set_residence, current_residence, current_resident, current_upload\n# You are encouraged to use standard filters to authenticate users and set the residence (if this is dynamic) + implement index / show if desired\n# You must implement the following call-backs:\n#* resident_id - this should provide a unique identifier for the current user, used for authorisation\n#* upload_complete - provides the upload information for storage in the greater application logic. Return true if successful.\n#* destroy_upload - provides the upload information so that a scheduled task can be created to clean up the upload. Return true if successfully scheduled.\n#** This should be done in the background using something like \"Fog\":http://fog.io/ Can't trust the client\n\n\nIf you are using \"Condo Interface\":https://github.com/cotag/condo_interface then you may want to do the following:\n# Create an index for your controller @def index; end@\n# Create an index.html.erb in your view with:\n# Make sure your AngularJS app includes: @angular.module('YourApp', ['Condo', 'CondoInterface']);@\n#* @\u003cdiv data-ng-app=\"YourApp\"\u003e\u003c%= render \"condo_interface/upload\" %\u003e\u003c/div\u003e@\n\nAlternative you could load an AngularJS template linking to \u003c%= asset_path('templates/_upload.html') %\u003e\n\n\nh3. Defining Static Residencies\n\nIf you are creating an application that only communicates with one or two storage providers or accounts then this is the simplest way to get started.\nIn an initialiser do the following:\n\n\u003cpre\u003e\u003ccode class=\"ruby\"\u003e\nCondo::Configuration.add_residence(:AmazonS3, {\n    :access_id =\u003e ENV['S3_KEY'],\n    :secret_key =\u003e ENV['S3_SECRET']\n    # :location =\u003e 'us-west-1'    # or 'ap-southeast-1' etc (see http://docs.amazonwebservices.com/general/latest/gr/rande.html#s3_region)\n                                # Defaults to 'us-east-1' or US Standard - not required for Google\n    # :namespace =\u003e :admin_resident    # Allows you to assign different defaults to different controllers or users etc\n})\n\n\u003c/code\u003e\u003c/pre\u003e\n\nThe first residence to be defined in a namespace will be the default. To change the residence for the current request use @set_residence(:name, :location)@ - location is optional\nCurrently available residencies:\n* :AmazonS3\n* :GoogleCloudStorage\n* :RackspaceCloudFiles (Works with Swift left as rackspace for backwards compatibility)\n\n\nNote:: There is also a callback to dynamically set storage provider. Which is useful if your users use:\n* Their own bucket\n* Different cloud providers etc\n\n\nh3. Callbacks\n\nThese are pretty well defined \"here\":https://github.com/cotag/Condominios/blob/master/lib/condo/configuration.rb\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcotag%2Fcondominios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcotag%2Fcondominios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcotag%2Fcondominios/lists"}