{"id":28390830,"url":"https://github.com/proboci/probo-asset-receiver","last_synced_at":"2025-06-28T08:31:59.031Z","repository":{"id":42235324,"uuid":"41899284","full_name":"ProboCI/probo-asset-receiver","owner":"ProboCI","description":"A simple service for storing assets in a bucket and allowing them to be retrieved later.","archived":false,"fork":false,"pushed_at":"2025-01-19T20:45:13.000Z","size":713,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-31T17:06:53.749Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ProboCI.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-04T05:25:29.000Z","updated_at":"2025-01-19T20:45:14.000Z","dependencies_parsed_at":"2025-01-18T01:22:48.934Z","dependency_job_id":"ec00a097-8e88-420d-ac69-d00f1ae46e84","html_url":"https://github.com/ProboCI/probo-asset-receiver","commit_stats":{"total_commits":132,"total_committers":7,"mean_commits":"18.857142857142858","dds":0.5606060606060606,"last_synced_commit":"e0a8a296301f7b04d1f7ab849e9b5f644911ff9e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/ProboCI/probo-asset-receiver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProboCI%2Fprobo-asset-receiver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProboCI%2Fprobo-asset-receiver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProboCI%2Fprobo-asset-receiver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProboCI%2Fprobo-asset-receiver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProboCI","download_url":"https://codeload.github.com/ProboCI/probo-asset-receiver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProboCI%2Fprobo-asset-receiver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262400622,"owners_count":23305326,"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":"2025-05-31T06:42:50.896Z","updated_at":"2025-06-28T08:31:59.025Z","avatar_url":"https://github.com/ProboCI.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Probo Asset Receiver\n\nAllows the upload of an asset to a Probo asset storage system. These assets are items such as databases, secrets configurations or other files that are used in conjunction with the Probo build service and specified as an [asset](https://docs.probo.ci/build/assets/).\n\nThis project is designed to be used in conjunction with the corresponding CLI client ([probo-uploader](https://github.com/ProboCI/probo-uploader)) to allow you to upload assets for use in Probo builds as well as the Probo [container service](https://docs.probo.ci/build/configuration/) to load assets into your Probo builds.\n\nBecause the Probo service will need to be able to access files in the asset receiver, it should be configured with a fully qualified domain or subdomain name so that it can be publicly accessed from inside Docker containers. See **#8** below for additional info.\n\n## Authentication\n\nToken-based authentication can be enabled for all APIs except file upload. To enable it, add at least one token in the config file:\n\n```yaml\ntokens:\n  - token_value\n```\n\nTo authenticate API calls use a bearer-token authentication header: `Authentication: Bearer token_value`. It is recommended to use a bearer-token for any production-level system.\n\n```\ncurl -H \"Authentication: Bearer token_value\" http://localhost:3000/buckets/foo\n```\n\n## Usage\n\n1.  Create a bucket to hold assets.\n2.  Create a token that can be used to post assets into that bucket.\n3.  Upload an asset into a bucket with the upload token.\n4.  Retrieve files from asset receiver.\n\n* * *\n\n### 1\\. Create a bucket\n\nThe following will create a bucket called `foo` and store the associated metadata key `some` with value `metadata`.\n\n```bash\ncurl -XPOST -H \"Content-Type: application/json\" -i -d '{\"some\":\"metadata\"}' http://localhost:3000/buckets/foo\n```\n\n* * *\n\n### 2\\. Create a token that can be used to post assets into that bucket\n\nIn order to upload assets to a bucket, you'll need an upload token. This is a shared secret (essentially like an API key) that allows you to upload assets to a particular bucket. You can create any number of these tokens per bucket and in\n\n```bash\ncurl -i -XPOST http://localhost:3000/buckets/\u003cbucket_name\u003e/token/\u003ctoken_value\u003e\n```\n\nTo delete a token:\n\n```bash\ncurl -i -XDELETE http://localhost:3000/buckets/\u003cbucket_name\u003e/token/\u003ctoken_value\u003e\n```\n\n* * *\n\n### 3\\. Use the super secret token to upload a file\n\nThe following curl command will upload our database.sql.gz file as raw binary data. Replace \u0026lt;token\\_value\u0026gt; with your created token and \u0026lt;asset\\_name\u0026gt; with the name of the asset for later reference.\n\n```bash\ncurl -i -XPOST --data-binary @database.sql.gz http://localhost:3000/asset/\u003ctoken_value\u003e/\u003casset_name\u003e\n```\n\n* * *\n\n### 4\\. Download the file that you uploaded\n\n```bash\ncurl -i http://localhost:3000/asset/\u003cbucket_name\u003e/\u003casset_name\u003e \u003e \u003cfile_name\u003e\n```\n\n* * *\n\n### 5\\. Using Amazon S3 to storage your assets\n\nYou can use [Amazon S3 storage](https://aws.amazon.com/s3/) to store your assets by using the AwsS3Storage Plugin. There is an example of this in the `defaults.yaml` file in this repository. You will need to provide your own access keys and bucket name from your Amazon account. You must then move your config file outside of the git repo or add it to your .gitignore file. **Failing to do this step will guarantee you a bad time.** You can then use the config argument `-c` to tell the Probo Asset Reciever to override the defaults.yaml file with your own configuration file.\n\nExample:\n\n```\n./bin/probo-asset-receiver -c /path/to/config-file/custom.yaml\n```\n\n* * *\n\n### 6\\. Pausing and unpausing file uploads\n\nIf doing server maintenance, it is often nice to be able to prevent new files\nfrom coming in but still allowing existing files to be served. This allows\nbuilds to continue to function even though new assets will not be allowed. This\nis helpful when migrating the files to a new server or system.\n\n```\ncurl -X POST -H \"Authorization: Bearer\" -H content-type:application/json --data-binary '{\"uploadsPaused\": true}' http://localhost:3000/service/upload-status\n```\n\n* * *\n\n### 7\\. Docker\n\nThe Dockerfile included is everything you need to build and run the service. To compile a container use the following command\n\n`docker build . -t probo/asset-receiver`\n\nThis will build and create the container.\n\nYou can then run the container, but it is more recommended to use a docker-compose.yml file as follows:\n\n```yaml\nversion: '3'\nservices:\n  probo-asset-receiver:\n    image: proboci/probo-asset-receiver:latest\n    container_name: asset-receiver\n    volumes:\n      - ./probo-config:/etc/probo\n      - ./proboci/probo-asset-receiver/db:/opt/db\n    network_mode: host\n    restart: always\n```\n\nNote that any custom configuration.yaml files should go in the `./probo-config/` folder. An example configuration is as follows, but also be sure\n\n```yaml\nhost: 0.0.0.0\nport: 3070\n\n# The directory in which to store the LevelDB database.\ndatabasePlugin: LevelDB\ndatabaseConfig:\n  databaseDataDirectory: /real/path/to/proboci/probo-asset-receiver/db\n\n# Determines the cipher used to encrypt the assets.\n# See https://www.openssl.org/docs/manmaster/apps/ciphers.html for options.\nencryptionCipher: 'aes-256-cbc'\nencryptionPassword: SECRET\n\n# If using S3 use this template for config settings.\nfileStoragePlugin: AwsS3Storage\nfileStorageConfig:\n  awsAccessKeyId: \u003cKeyID\u003e\n  awsSecretAccessKey: \u003cAccessKey\u003e\n  awsBucket: \u003cbucket\u003e\n```\n\n### 8\\. Fully Qualified Domain Name\n\nBecause your Probo containers will need to be able to publicly access these files, it is recommended that your asset receiver be available on an open port. To secure this, it is STRONGLY RECOMMENDED you use a bearer token to access the asset receiver. You can read more about this in **#2** above.\n\nYou can then replace the \"localhost\" reference in your url with your domain name. So if your domain was \"assets.example.com\" you could use:\n\n```\ncurl -i -XDELETE http://assets.example.com:3000/buckets/\u003cbucket_name\u003e/token/\u003ctoken_value\u003e\n```\n\nBe sure to read the [Nginx Proxy](https://docs.probo.ci/open-source/nginx) instructions for using a reverse proxy to channel things through port 80 or 443 on your web service.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproboci%2Fprobo-asset-receiver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproboci%2Fprobo-asset-receiver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproboci%2Fprobo-asset-receiver/lists"}