{"id":21023928,"url":"https://github.com/ieedan/esetres","last_synced_at":"2025-07-27T04:36:52.068Z","repository":{"id":243933885,"uuid":"810895466","full_name":"ieedan/esetres","owner":"ieedan","description":"A self hosted file storage server.","archived":false,"fork":false,"pushed_at":"2024-09-09T20:30:17.000Z","size":205,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-22T00:53:19.387Z","etag":null,"topics":["file-storage","file-upload","jwt","rest","storage-api"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ieedan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-05T14:52:12.000Z","updated_at":"2024-12-11T14:06:07.000Z","dependencies_parsed_at":"2024-09-10T00:12:49.933Z","dependency_job_id":"e578d094-8c7b-48e0-a63b-eeb2bd1a1ecc","html_url":"https://github.com/ieedan/esetres","commit_stats":null,"previous_names":["ieedan/esetres"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ieedan/esetres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ieedan%2Fesetres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ieedan%2Fesetres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ieedan%2Fesetres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ieedan%2Fesetres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ieedan","download_url":"https://codeload.github.com/ieedan/esetres/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ieedan%2Fesetres/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267300059,"owners_count":24066095,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["file-storage","file-upload","jwt","rest","storage-api"],"created_at":"2024-11-19T11:21:15.872Z","updated_at":"2025-07-27T04:36:52.035Z","avatar_url":"https://github.com/ieedan.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esetres\n\nA single install self hosted file storage server.\n\n## Get Started\n\n### Install\n\n```bash\ncargo install esetres\n\n# check version to verify installation\nesetres -V\n```\n\n### Run Init\n\nRun the [init](#init) command and go through the setup process.\n\n```bash\nesetres init\n```\n\n### Start the server\n\n```bash\nesetres start\n```\n\n\u003e [!TIP]\n\u003e See our [examples](https://github.com/ieedan/esetres/tree/main/examples) to see how to host and structure your server.\n\n## API\n\n\u003e [!NOTE]\n\u003e Clients may be added in the future\n\n### Health Check `GET/health`\n\nReturns a simple running status for the server.\n\n### Create bucket `POST/buckets` `(authed)`\n\nCreates a new bucket.\n\nRequest Body:\n\n```json\n{\n\t\"name\": \"bucket_name\"\n}\n```\n\n### Invalidate Cache `POST/cache/invalidate`\n\nThis is configured for local only access. It will invalidate the token cache causing a refetch from the database. This will be hit when you mint or revoke tokens.\n\n### Get File `GET/buckets/{bucket}/{public | private}/{file_name}`\n\nGets the requested file from the requested bucket. Requests to `private` must be authorized.\n\n### Upload File `PUT/buckets/{bucket}/{public | private}/{file_name}` `(authed)`\n\nUploads the file to the requested bucket with the requested file name.\n\nRequest Body: File Content In Bytes\n\n### Delete File `DELETE/buckets/{bucket}/{public | private}/{file_name}` `(authed)`\n\nDeletes the file with the requested bucket and file name.\n\n## CLI\n\n\u003e [!WARNING]\n\u003e All commands must be run from the same directory as the server.\n\n### Init\n\nStep by step process for setting up the environment variables, running the migration and creating your first bucket.\n\n```bash\nesetres init\n\nWelcome to esetres cli!\n|\no Do you want us to generate the token secret? yes\n|\n✓ Generated token secret.\n|\no Select your the ip: 172.31.144.1\n|\no Enter the port: 8080\n|\no Use https? no\n\nTOKEN_SECRET=\"[hidden]\"\n\nIP=\"172.31.144.1\"\nPORT=\"8080\"\nHTTPS=0\n\no .env file Ok? yes\n|\n✓ Created .env file.\n|\no Run sqlite migration? yes\n|\n✓ Ran sqlite migration.\n|\no Create a bucket? yes\n|\no Enter the bucket name: default\n|\n✓ Bucket [default] created.\n|\n✓ Completed initialization.\n```\n\n### Start\n\nStarts the server.\n\n```bash\nesetres start\n\nListening at 127.0.0.1:3000...\n```\n\n### Run Migration\n\nesetres uses a local sqlite database to store the tokens. In the `init` function you can choose to run this automatically or you can run it yourself at any time with:\n\n```bash\nesetres migrate\n```\n\n### Buckets\n\nYou can create buckets from the api or by creating the folders yourself on the server. However the CLI enables some extra functionality.\n\n#### Create\n\nCreates a new bucket and the required folders.\n\n```bash\nesetres buckets create my_bucket\n```\n\n#### Delete\n\nDeletes the bucket and all contents.\n\n```bash\nesetres buckets delete my_bucket\n```\n\n#### List\n\nLists all the buckets and their last modified time.\n\n```bash\nesetres buckets list\n\nName      Modified\n-----------------------------------------------\ndefault | 2024-06-11 09:36:37.522380 -05:00\ntest    | 2024-06-11 09:44:01.888576100 -05:00\n```\n\n### Tokens\n\nTokens allow you to control access to the server. It uses jwt with the Bearer scheme meaning authorized routes require the authorization header.\n\nTokens are cached by the server for fast responses and when you create or delete tokens the cache will automatically be updated.\n\n#### Mint\n\nCreates a new token with specified scope and access.\n\nCreate\n\n```bash\nesetres tokens mint MY_TOKEN\n\nNew token (MY_TOKEN) created for scope (*).\neyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...\n```\n\nSet **Scope**\n\nScope allows you to limit the buckets a token has access to.\n\n```bash\n# default scope is \"*\"\nesetres tokens mint MY_TOKEN --scope default\n```\n\nSet **Access**\n\nAccess allows you to limit the permissions a token has to create buckets, upload files, and read files.\n\n```bash\n# default access is \"read\"\nesetres tokens mint MY_TOKEN --access write\n```\n\n#### List\n\nLists all existing tokens with the most recently created being at the top.\n\n```bash\nesetres tokens list\n\nName                        Scope     Access\n----------------------------------------------\nANOTHER_REALLY_LONG_TOKEN | test    | full\nNEW_TEST_TOKEN            | default | read\nTEST_TOKEN                | *       | write\n```\n\n#### Revoke\n\nDeletes a token from the database.\n\n```bash\nesetres tokens revoke MY_TOKEN\n\nToken revoked.\n```\n\n## Mime Types\n\nThe mime types come from [mime-db](https://github.com/jshttp/mime-db). When you first start the server it will grab the types from the db and store it on machine. You can always delete the `mime-db.json` file to refresh it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fieedan%2Fesetres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fieedan%2Fesetres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fieedan%2Fesetres/lists"}