{"id":13644846,"url":"https://github.com/google/apt-golang-s3","last_synced_at":"2025-04-21T10:34:37.199Z","repository":{"id":52547065,"uuid":"161685060","full_name":"google/apt-golang-s3","owner":"google","description":"An s3 transport method for the apt package management system","archived":false,"fork":false,"pushed_at":"2024-12-11T21:23:30.000Z","size":89,"stargazers_count":48,"open_issues_count":1,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T22:27:08.858Z","etag":null,"topics":["apt","golang","s3"],"latest_commit_sha":null,"homepage":"","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/google.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}},"created_at":"2018-12-13T19:23:37.000Z","updated_at":"2025-04-06T01:09:08.000Z","dependencies_parsed_at":"2022-08-28T01:50:55.490Z","dependency_job_id":null,"html_url":"https://github.com/google/apt-golang-s3","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/google%2Fapt-golang-s3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fapt-golang-s3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fapt-golang-s3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fapt-golang-s3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/apt-golang-s3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250040878,"owners_count":21365176,"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":["apt","golang","s3"],"created_at":"2024-08-02T01:02:15.601Z","updated_at":"2025-04-21T10:34:32.165Z","avatar_url":"https://github.com/google.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# apt-golang-s3\n\n_An s3 transport method for the `apt` package management system_\n\n[![Build Status](https://travis-ci.org/google/apt-golang-s3.svg?branch=master)](https://travis-ci.org/google/apt-golang-s3)\n[![Go Report Card](https://goreportcard.com/badge/github.com/google/apt-golang-s3)](https://goreportcard.com/report/github.com/google/apt-golang-s3)\n[![GoDoc](https://godoc.org/github.com/google/apt-golang-s3?status.svg)](https://godoc.org/github.com/google/apt-golang-s3)\n\nThe apt-golang-s3 project provides support for hosting private\n[apt](https://en.wikipedia.org/wiki/APT_(Debian)) repositories in\n[Amazon S3](https://aws.amazon.com/s3/). This is useful if you have private\npackages, vendored public packages, or forks of public packages that your\nsoftware or business depend on. There are several opensource projects that\nsolve this problem, but they come with some limitations.\n\n1. They are unmaintained.\n1. They don't support the S3v4 request signature method.\n1. They are written in a language that requires a runtime or other dependencies.\n\nThis project is an attempt to address those limitations.\n\n## TL;DR\n1. Build the binary `$ go build -o apt-golang-s3 main.go`\n1. Install the binary `$ sudo cp apt-golang-s3 /usr/lib/apt/methods/s3`\n1. Add your s3 based source to a package list `$ echo \"deb s3://access-key:access-secret@s3.amazonaws.com/private-repo-bucket stable main\" \u003e /etc/apt/sources.list.d/private-repo.list`\n1. Update and install packages `$ sudo apt-get update \u0026\u0026 sudo apt-get install your-private-package`\n\n## Building the go program\n\nThere is an included Dockerfile to setup an environment for building the binary\nin a sandboxed environment:\n\n```\n$ ls\nDockerfile  main.go  method  README.md\n\n$ docker build -t apt-golang-s3 .\n...\n\n$ docker run -it --rm -v $(pwd):/app apt-golang-s3 bash\n\nroot@83823fffd369:/app# ls\nDockerfile  README.md  build-deb.sh  go.mod  go.sum  main.go  method\n\nroot@83823fffd369:/app# go build -o apt-golang-s3 main.go\n...\n\nroot@83823fffd369:/app# ls\nDockerfile  README.md  apt-golang-s3  build-deb.sh  go.mod  go.sum  main.go  method\n\nroot@83823fffd369:/app# exit\nexit\n\n$ ls\napt-golang-s3  build-deb.sh  Dockerfile  go.mod  go.sum  main.go  method  README.md\n```\n\n## Building a debian package\n\nFor convenience, there is a small bash script in the repository that can build\nthe binary and package it as a .deb.\n\n```\n$ ls\nbuild-deb.sh  Dockerfile  go.mod  go.sum  main.go  method  README.md\n\n$ docker build -t apt-golang-s3 .\n\n$ docker run -it --rm -v $(pwd):/app apt-golang-s3 /app/build-deb.sh\n...\nCreated package {:path=\u003e\"apt-golang-s3_1_amd64.deb\"}\n\n$ ls\napt-golang-s3  apt-golang-s3_1_amd64.deb  build-deb.sh  Dockerfile  go.mod  go.sum  main.go  method  README.md\n```\n\n## Installing in production\n\nThe `apt-golang-s3` binary is an executable. To install it copy it to\n`/usr/lib/apt/methods/s3` on your computer. The .deb file produced by\n`build-deb.sh` will install the method in the correct place.\n\n\n## Configuration\n### APT Repository Source Configuration\n\nWe recommend issuing a separate set of API keys, with read-only access, to the\nS3 bucket that hosts your repository. The keys are specified in the apt sources\nlist configuration as follows:\n\n```\n$ cat /etc/apt/sources.list.d/my-private-repo.list\ndeb s3://aws-access-key-id:aws-secret-access-key@s3.amazonaws.com/my-private-repo-bucket stable main\n```\n\n### APT Method Configuration\n\nThe current default AWS region is set to `us-east-1`, but can be overridden by\nadding an option in your apt configuration, e.g.\n\n```plain\necho \"Acquire::s3::region us-east-1;\" \u003e /etc/apt/apt.conf.d/s3\n```\n\nAlternatively, you may specify an IAM role to assume before connecting to S3.\nThe role will be assumed using the default credential chain; this option is\nmutually exclusive with static credentials in the S3 URL.\n\n```plain\necho \"Acquire::s3::role arn:aws:iam::123456789012:role/s3-apt-reader;\" \u003e /etc/apt/apt.conf.d/s3\n```\n\nAdditional configuration options may be added in the future.\n\n## How it works\n\nApt creates a child process using the `/usr/lib/apt/methods/s3` binary and\nwrites to that processes standard input using a specific protocol. The method\ninterprets the input, downloads the requested files, and communicates back to\napt by writing to its standard output. The protocol spec is available here\n[http://www.fifi.org/doc/libapt-pkg-doc/method.html/ch2.html](http://www.fifi.org/doc/libapt-pkg-doc/method.html/ch2.html).\n\n## Similar Projects\n* [https://github.com/kyleshank/apt-transport-s3](https://github.com/kyleshank/apt-transport-s3)\n* [https://github.com/brianm/apt-s3](https://github.com/brianm/apt-s3)\n* [https://github.com/BashtonLtd/apt-transport-s3](https://github.com/BashtonLtd/apt-transport-s3)\n* [https://github.com/lucidsoftware/apt-boto-s3/](https://github.com/lucidsoftware/apt-boto-s3/)\n\n## Disclaimer\nThis is not an officially supported Google product.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fapt-golang-s3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fapt-golang-s3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fapt-golang-s3/lists"}