Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for go modules #9

Merged
merged 15 commits into from Feb 1, 2021
Merged

Add support for go modules #9

merged 15 commits into from Feb 1, 2021

Conversation

andrew
Copy link
Member

@andrew andrew commented Jan 26, 2021

⚠️ work in progress ⚠️

Adds support for acting as a go modules proxy server like https://proxy.golang.org, caching the zips to ipfs along the way.

Also lots of refactoring to make the codebase less npm specific, still some more work to do:

  • go server needs to cache metadata as well as zips
  • forest packages only lists npm packages atm
  • forest republish only reads package-lock.json files, should also read go.sum files, output should be a combination of both
  • forest seed may not work for go modules at the moment
  • verification of modules annoucned on pubsub needs to be done using sum.golang.org server
  • forest verify command only checks npm packages atm
  • forest update doesn't check go modules right now
  • forest preload only looks for package-lock.json files, should also search for go.sum files
  • go server currently runs on a separate port, needs to be combined with server.js
  • need to watch https://index.golang.org/index for new updates to go modules in the background
  • forest watch only watches for new npm releases
  • go support needs documenting
  • flag for some cli commands to only operate on one manager, i.e. --manager npm
  • config/unconfig commanda only changes npm config (go modules enabled using GOPROXY= env var)

@andrew
Copy link
Member Author

andrew commented Jan 26, 2021

Note: requests to proxy.golang.org must be lowercase, otherwise it errors: golang/go#40202 (comment)

@andrew
Copy link
Member Author

andrew commented Jan 27, 2021

Go's integrity checking code for zips: https://github.com/golang/mod/blob/master/sumdb/dirhash/hash.go (h1 is base64 encoded sha256), need to implement the HashZip and Hash1 functions from that file.

https://www.npmjs.com/package/node-stream-zip should be helpful

@andrew andrew marked this pull request as ready for review February 1, 2021 11:01
@andrew andrew merged commit f14583e into master Feb 1, 2021
@andrew
Copy link
Member Author

andrew commented Feb 1, 2021

Merged to avoid more conflicts in the near future

@andrew andrew deleted the go-proxy branch February 1, 2021 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant