Repository navigation
HC_TEST_TERRAFORM helper, console titles, localhost in Testcontainers, signed installs in the action - #130
Merged
Conversation
Add awstest.Terraform, which skips unless HC_TEST_TERRAFORM is set (and in -short mode), uses the value as the binary when it is an executable, and otherwise looks up terraform, then tofu, on PATH. The IAM, S3, CloudFormation and Route 53 Terraform tests all use it, so HC_TEST_TERRAFORM=1 no longer makes the IAM test run a program called 1, and the IAM test no longer runs unasked. Closes #97
Same change as solinode/setup-homecloud#2: when a release publishes checksums.txt.sigstore.json (v0.5.0 on), verify it with cosign against the release workflow's identity before trusting checksums.txt; releases before v0.5.0 keep the checksum-only check. New input verify-signature (default true).
The Go, Python, Java and Node modules turned a localhost Docker host into 127.0.0.1. Like homecloud aws-env since #125, name a loopback host localhost instead: S3 Control (which the Terraform AWS provider calls for every aws_s3_bucket) puts the account ID in front of the endpoint's host, and 123456789012.127.0.0.1 does not resolve. HomeCloud listens on 127.0.0.1 and clients that try ::1 first fall back to it; the modules' S3 helpers already use path-style addressing, so bucket names never need to resolve. Each module's integration test now calls S3 Control ListTagsForResource, and Python, Java and Node unit-test the host mapping. READMEs and docs/integrations.md explain the choice.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying homecloud with
|
| Latest commit: |
6a042c2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a7fd43d5.homecloud.pages.dev |
| Branch Preview URL: | https://small-fixes-2.homecloud.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #97, closes #98
Terraform tests: one meaning for
HC_TEST_TERRAFORM(#97). Newawstest.Terraform(t)skips unlessHC_TEST_TERRAFORMis set (and in-shortmode), uses the value as the binary when it names an executable file, and otherwise looks upterraform, thentofu, onPATH, skipping with a message when neither is there. The IAM, S3, CloudFormation and Route 53 Terraform tests all use it, soHC_TEST_TERRAFORM=1no longer makes the IAM test run a program called1, and the IAM test no longer runs (and downloads the provider) without the variable. Documented in theawstestpackage comment and the CONTRIBUTING.md table.Console: description and tab titles (#98). The site description no longer lists seven services ("The web console for HomeCloud, a self-hosted AWS-compatible cloud."). The home page sets the title "Home"; the sign-in page, a client component, gets it ("Sign in") from a new
app/login/layout.tsx. The export rendersHome | HomeCloud ConsoleandSign in | HomeCloud Console.Testcontainers: the endpoint is
http://localhost:<port>in all four modules. All four (Go, Python, Java, Node) mapped alocalhostDocker host to127.0.0.1, to keep SDKs from trying IPv6 first or usingbucket.localhostnames. Since #125,homecloud aws-env, the GitHub Action and the docs name a local serverlocalhostbecause S3 Control (which the Terraform AWS provider 6.x calls for everyaws_s3_bucket, ands3controlclients use) puts the account ID in front of the endpoint's host:123456789012.127.0.0.1does not resolve,123456789012.localhostdoes. The two old concerns do not hold: HomeCloud listens on 127.0.0.1 and every SDK's HTTP stack falls back to it when::1refuses (Go's dialer, urllib3, Java's IPv4-first resolution plus the SDK clients' retry of the next address, Node.js 20+autoSelectFamily); and the modules' S3 helpers already force path-style addressing, so bucket names never need to resolve. So the modules now name a loopback Docker host (localhost,127.0.0.1,::1)localhost, matchingaws-env; other hosts are kept. Each module's integration test now also calls S3 ControlListTagsForResource(which fails with a127.0.0.1endpoint), and Python, Java and Node get a unit test of the mapping. READMEs and docs/integrations.md say why.GitHub Action mirror: verify the release signature. Same change as solinode/setup-homecloud#2, in
integrations/github-action: when a release publisheschecksums.txt.sigstore.json(v0.5.0 on), the action verifies it with cosign against the release workflow's identity at the tag before trustingchecksums.txt; older releases keep the checksum-only check; new inputverify-signature(defaulttrue).Tests:
go test ./internal/svc/iam/ ./internal/svc/s3/ ./internal/svc/cfn/ ./internal/svc/route53/ -run Terraform: all four skip without the variable; withHC_TEST_TERRAFORM=1(tofu onPATH) all four pass;HC_TEST_TERRAFORM=/opt/homebrew/bin/tofuruns the IAM test with that binary; a non-executable value with no terraform/tofu onPATHskips with a message.cd console && npx tsc --noEmit && npm run build && npm run build:demo: pass; titles checked inout/index.htmlandout/login/index.html.integrations/testdata/Dockerfileon OrbStack:go test ./...(2 pass),pytest(9 pass),npx vitest run(8 pass),mvn test(8 pass). With the Go module switched back to 127.0.0.1, the new S3 Control check fails withlookup 274530734788.127.0.0.1: no such host.bash integrations/github-action/test/inputs.sh: pass. The install path was run locally for v0.5.0 (signature verified), v0.4.1 (checksum only) andverify-signature=false.