{"id":19667300,"url":"https://github.com/willnet/refile_cdn_switcher","last_synced_at":"2025-10-26T15:39:12.225Z","repository":{"id":40221339,"uuid":"197727197","full_name":"willnet/refile_cdn_switcher","owner":"willnet","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-19T13:51:10.000Z","size":34,"stargazers_count":1,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T02:16:44.368Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-19T07:46:39.000Z","updated_at":"2019-07-19T09:50:13.000Z","dependencies_parsed_at":"2023-02-11T02:30:26.047Z","dependency_job_id":null,"html_url":"https://github.com/willnet/refile_cdn_switcher","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/willnet%2Frefile_cdn_switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Frefile_cdn_switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Frefile_cdn_switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willnet%2Frefile_cdn_switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willnet","download_url":"https://codeload.github.com/willnet/refile_cdn_switcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240976372,"owners_count":19887476,"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-11T16:31:38.489Z","updated_at":"2025-10-26T15:39:12.133Z","avatar_url":"https://github.com/willnet.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RefileCdnSwitcher\n\nIf you use refile and have to deal with sensitive file, you can use [Authentication](https://github.com/refile/refile#authentication). But if you use CDN(you should use CDN), users can bypass it.\n\nRefileCdnSwitcher disable CDN by default and enable it selectively.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'refile_cdn_switcher'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install refile_cdn_switcher\n\n## prerequisite\n\nRefileCdnSwitcher depends on `root_url`.\n\n\nconfig/routes.rb\n\n```ruby\nroot 'yourcontroller#youraction'\n```\n\nconfig/environments/*.rb\n\n```ruby\nRails.application.routes.default_url_options = { host: 'yourhost', port: 'yourport' }\n```\n\n## Usage\n\nIf you want to use cdn, you can pass `cdn: true` option to attachment method. (and ofcource set Refile.cdn_host)\n\n```ruby\nclass User \u003c ApplicationRecord\n  attachment :file, cdn: true\nend\n```\n\nIf you doesn't pass cdn option, it means that cdn is disabled with the file.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo 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](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/willnet/refile_cdn_switcher. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the RefileCdnSwitcher project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/willnet/refile_cdn_switcher/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillnet%2Frefile_cdn_switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillnet%2Frefile_cdn_switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillnet%2Frefile_cdn_switcher/lists"}