{"id":20080618,"url":"https://github.com/bluzky/extus","last_synced_at":"2025-05-05T23:31:18.430Z","repository":{"id":62429475,"uuid":"93255261","full_name":"bluzky/extus","owner":"bluzky","description":"An implementation of resumable upload protocol TUS in Elixir","archived":false,"fork":false,"pushed_at":"2022-09-19T11:29:54.000Z","size":29,"stargazers_count":7,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T04:22:22.218Z","etag":null,"topics":["elixir","phoenix","resumable-upload","tus"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bluzky.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2017-06-03T15:01:14.000Z","updated_at":"2024-06-12T05:40:44.000Z","dependencies_parsed_at":"2022-11-01T20:05:26.134Z","dependency_job_id":null,"html_url":"https://github.com/bluzky/extus","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluzky%2Fextus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluzky%2Fextus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluzky%2Fextus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluzky%2Fextus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluzky","download_url":"https://codeload.github.com/bluzky/extus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252593007,"owners_count":21773385,"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":["elixir","phoenix","resumable-upload","tus"],"created_at":"2024-11-13T15:29:20.192Z","updated_at":"2025-05-05T23:31:18.034Z","avatar_url":"https://github.com/bluzky.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extus\n\n**TODO: Add description**\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `extus` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:extus, \"~\u003e 0.1.0\"}]\nend\n```\n\n## 1. Config\n\n```elixir\nconfig :extus,\n  storage: ExTus.Storage.Local,\n  base_dir: \"upload\",\n  expired_after: 24 * 60 * 60 * 1000, #clean uncompleted upload after 1 day\n  clean_interval: 30 * 60 * 1000 # start cleaning job after 30min\n```\n\n- `storage`: module which handle storage file application\n  Currently, ExTus support `ExTus.Storage.Local` and `ExTus.Storage.S3`\n- `base_dir` is where you want to store uploaded file\n\n\n**Config for S3 uploaded**\n\n```elixir\nconfig :extus,\n  storage: ExTus.Storage.S3,\n  base_dir: \"upload\",\n\tasset_host: \"https://dsxymfc8fnnz2.cloudfront.net\",\n\n  config :extus, :s3,\n    virtual_host: true,\n    bucket: \"mofiin\",\n    chunk_size: 5 * 1024 * 1024\n```\n\n- `virtual_host`: true if you want to use \"https://#{bucket}.s3.amazonaws.com\" host.\n   default is \"https://s3.amazonaws.com/#{bucket}\"\n- `asset_host`: host which you use to serve uploaded files\n- `bucket`: name of s3 bucket\n- `chunk_size`: size of part for multipart upload\n\n\n## 2. Dependencies\nIf you use S3 to store file, add below dependencies\n```elixir\n    {:poison, \"~\u003e 2.0\"},\n    {:hackney, \"~\u003e 1.6\"}\n```\n\n\n\n## 3. Usage\n\n**Add new controller for upload**\n\n```elixir\ndefmodule MyApp.UploadController do\n  use MyApp.Web, :controller\n  use ExTus.Controller\n\n  # start upload file callback\n  def on_begin_upload(file_info) do\n    IO.inspect \"create file: #{inspect file_info}\"\n  end\n\t\n  # Completed upload file callback\n  def on_complete_upload(file_info) do\n    IO.inspect \"complete file: #{inspect file_info}\"\n  end\nend\n```\n\n\n\n**Add route**\n\n```elixir\nscope \"/files\", MyApp do\n    options \"/\",  \t\t\tTusController, :options\n    options \"/:file\",  \t\tTusController, :options\n    match :head, \"/:file\",  TusController, :head\n    post \"/\",  \t\t\t\tTusController, :post\n    patch \"/:file\",  \t\tTusController, :patch\n    delete \"/:file\",  \t\tTusController, :delete\nend\n```\n\n\n\n## 4. Implement your own storage\n\n- In progress\n   ~You can implement interface `Storage`~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluzky%2Fextus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluzky%2Fextus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluzky%2Fextus/lists"}