{"id":19040770,"url":"https://github.com/cloudfoundry/bosh-gcscli","last_synced_at":"2025-03-15T22:07:47.992Z","repository":{"id":48280471,"uuid":"92226857","full_name":"cloudfoundry/bosh-gcscli","owner":"cloudfoundry","description":"GCS for BOSH","archived":false,"fork":false,"pushed_at":"2024-09-14T10:18:02.000Z","size":20041,"stargazers_count":4,"open_issues_count":0,"forks_count":5,"subscribers_count":33,"default_branch":"main","last_synced_at":"2024-09-14T20:41:09.254Z","etag":null,"topics":["bosh"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudfoundry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2017-05-23T22:41:55.000Z","updated_at":"2024-09-14T10:18:06.000Z","dependencies_parsed_at":"2023-11-25T11:24:07.225Z","dependency_job_id":"2ddb0836-2c19-4302-89f8-d580223fd4cd","html_url":"https://github.com/cloudfoundry/bosh-gcscli","commit_stats":null,"previous_names":[],"tags_count":252,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fbosh-gcscli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fbosh-gcscli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fbosh-gcscli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry%2Fbosh-gcscli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudfoundry","download_url":"https://codeload.github.com/cloudfoundry/bosh-gcscli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243796720,"owners_count":20349263,"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":["bosh"],"created_at":"2024-11-08T22:25:06.162Z","updated_at":"2025-03-15T22:07:47.964Z","avatar_url":"https://github.com/cloudfoundry.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## bosh-gcscli\n\n[![GoDoc](https://godoc.org/github.com/cloudfoundry/bosh-gcscli?status.svg)](https://godoc.org/github.com/cloudfoundry/bosh-gcscli)\n\n\nA Golang CLI for uploading, fetching and deleting content to/from [Google Cloud Storage](https://cloud.google.com/storage/). \nThis tool exists to work with the [bosh-cli](https://github.com/cloudfoundry/bosh-cli) and [director](https://github.com/cloudfoundry/bosh).\n\nThis is **not** an official Google Product.\n\n## Installation\n\n```bash\ngo get github.com/cloudfoundry/bosh-gcscli\n```\n\n## Commands\n\n### Usage\n```bash\nbosh-gcscli --help\n```\n### Upload an object\n```bash\nbosh-gcscli -c config.json put \u003cpath/to/file\u003e \u003cremote-blob\u003e\n```\n### Fetch an object\n```bash\nbosh-gcscli -c config.json get \u003cremote-blob\u003e \u003cpath/to/file\u003e\n```\n### Delete an object\n```bash\nbosh-gcscli -c config.json delete \u003cremote-blob\u003e\n```\n### Check if an object exists\n```bash\nbosh-gcscli -c config.json exists \u003cremote-blob\u003e\n```\n\n### Generate a signed url for an object\nIf there is an encryption key present in the config, then an additional header is sent\n\n```bash\nbosh-gcscli -c config.json sign \u003cremote-blob\u003e \u003chttp action\u003e \u003cexpiry\u003e\n```\nWhere:\n - `\u003chttp action\u003e` is GET, PUT, or DELETE\n - `\u003cexpiry\u003e` is a duration string less than 7 days (e.g. \"6h\")\n\n## Configuration\nThe command line tool expects a JSON configuration file. Run `bosh-gcscli --help` for details.\n\n### Authentication Methods (`credentials_source`)\n* `static`: A [service account](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) key will be provided via the `json_key` field.\n* `none`: No credentials are provided. The client is reading from a public bucket.\n* \u0026lt;empty\u0026gt;: [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials)\n  will be used if they exist (either through `gcloud auth application-default login` or a [service account](https://cloud.google.com/iam/docs/understanding-service-accounts)).\n  If they don't exist the client will fall back to `none` behavior.\n\n## Running Integration Tests\n\n1. Ensure [gcloud](https://cloud.google.com/sdk/downloads) is installed and you have authenticated (`gcloud auth login`).\n   These credentials will be used by the Makefile to create/destroy Google Cloud Storage buckets for testing.\n1. Set the Google Cloud project: `gcloud config set project \u003cyour project\u003e`\n1. Generate a service account with the `Storage Admin` role for your project and set the contents as \n    the environment variable `GOOGLE_APPLICATION_CREDENTIALS`, for example:\n   ```bash\n   export project_id=$(gcloud config get-value project)\n\n   export service_account_name=bosh-gcscli-integration-tests\n   export service_account_email=${service_account_name}@${project_id}.iam.gserviceaccount.com\n   credentials_file=$(mktemp)\n\n   gcloud config set project ${project_id}\n   gcloud iam service-accounts create ${service_account_name} --display-name \"Integration Test Access for bosh-gcscli\"\n   gcloud iam service-accounts keys create ${credentials_file} --iam-account ${service_account_email}\n   gcloud project add-iam-policy-binding ${project_id} --member serviceAccount:${service_account_email} --role roles/storage.admin\n  \n   export GOOGLE_SERVICE_ACCOUNT=\"$(cat ${credentials_file})\"\n   export GOOGLE_APPLICATION_CREDENTIALS=\"$(cat ${credentials_file})\"\n   export LC_ALL=C # fix `tr` complaining about \"illegal byte sequence\" on OSX\n   ```\n1. Run the unit and fast integration tests: `make test-fast-int`\n1. Clean up buckets: `make clean-gcs`\n\n## Development\n\n* A Makefile is provided that automates integration testing. Try `make help` to get started.\n* [gvt](https://godoc.org/github.com/FiloSottile/gvt) is used for vendoring.\n\n## Contributing\n\nFor details on how to contribute to this project - including filing bug reports and contributing code changes - please see [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## License\n\nThis tool is licensed under Apache 2.0. Full license text is available in [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry%2Fbosh-gcscli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudfoundry%2Fbosh-gcscli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry%2Fbosh-gcscli/lists"}