Repository navigation
Conversation
- keycloak: work on a copy of the shared access instead of writing each user's credentials into it (concurrent logins could end up in another user's directory), reject user names that would escape base_path, accept the KEYCLOAK_CLIENT_SECRET env var (KEYCLAOK_CLIENT_SECRET still works) - config: deduplicate the password hash handling, compare plain-text passwords in constant time, keep the config file permissions when hashing passwords and don't hash keycloak accesses - server: enforce max_clients, default the accesses webhook timeout to 30s (an unset timeout made every login fail), limit the webhook response size, report the right file when the TLS key can't be read, drop shared file systems on config reload, fix a data race in WaitGracefully - main: exit with a non-zero status on startup errors, don't wait a minute when the server couldn't listen - s3: add the right scheme to endpoints without one (hosts starting with an "h" were considered to already have one) - gcs: restrict the access to the configured bucket, which was ignored - mail: SSL, StartTLSPolicy and Port are now optional Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- build: golangci-lint never ran (it depended on an undefined matrix value) and its config was in the v1 format rejected by golangci-lint v2: migrate it to a v2 config, run it after setting up go, and drop the apt-get call that always failed (gcc is already installed on the runners) - codeql: analyze pushes and pull requests on main instead of master - docker: cross-compile the binary instead of building it under QEMU, publish the images from release-please (tags pushed with the default GITHUB_TOKEN don't trigger workflows, images weren't published since v0.15.1), pass the version info as build args instead of templating build.go with ci-info, and build the images on pull requests touching them - docker test: placekitten.com is gone, use a random file, test both images, and build them locally on pull requests touching them - scratch image: provide the /tmp directory served by the default config - schema: document tls_required, extensions, accesses_webhook and the access logging options, which were rejected by the schema, and validate the backend examples too (the mail one wasn't valid JSON) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README: fix the badges (some workflows didn't exist anymore), list every backend with its documentation, document the command line, the signals, all the config options, password hashing, webhook authentication and the docker image tags, use a valid sample config, and replace the dead placekitten.com test file - dropbox: the documentation was a copy of the Google Drive one - gdrive: the base path parameter is base_path, not basePath - keycloak, sftp, mail: write a proper documentation - gcs: document the bucket as the root directory, project_id is unused - fs: the samples weren't valid JSON, explain what each option does - CONTRIBUTING, CLAUDE.md: development workflow and conventions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
To be removed before merging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
An overall cleanup, starting with the README. Along the way I found and fixed a few real bugs. They're split into three commits (fixes, CI, docs) to make review easier.
Bug fixes
GetAccesswrote each user's name and password into the shared keycloak access. With two logins at the same time, one user could get the other user's credentials and land in their directory. A new test (TestGetAccessKeycloakDoesNotShareState) reproduces the data race on the old code. The fix also:base_pathKEYCLOAK_CLIENT_SECRET(the misspelledKEYCLAOK_CLIENT_SECRETstill works)timeout. An unsettimeoutgave the request a deadline of 0, so every login timed out. It now defaults to 30s, and the response size is capped.max_clientswas documented but never enforced. It is now.bucketparameter was ignored. gcsfs treats the first path component as the bucket, so the FTP root couldn't be listed. Each access is now scoped to its bucket.host.example.com) as already having a scheme. Endpoints without one now gethttp://orhttps://depending ondisable_ssl.0644permissions; it now keeps the original onesWaitGracefullySIGHUPso they pick up the new configSSL,StartTLSPolicyandPortwere mandatory, and the example wasn't valid JSON. They're now optional with sensible defaults.CI
matrix.lint, and.golangci.ymlused the v1 format, which golangci-lint v2 rejects. It's migrated to a v2 config with a reasonable set of linters, and the code passes it.apt-get install gccstep: it fails every run (no root) and only passed because gcc is already on the runner.master. They now targetmain.latestdates from 2023. Release-please tags don't trigger workflows (same cause as 最新版还是没有二进制文件下载 #1738), and the QEMU builds were slow and failing. The images are now:ci-info/build.go.tpltemplating/tmp, which the default config serves.tls_required,extensions,accesses_webhookand per-accesslogging. Those are added, and the backend examples are now validated too.Docs
base_path, notbasePath)fs/README.mdsamples are now valid JSON.Testing
go test -race ./...: new tests for password checking/hashing, keycloak isolation, the webhook,max_clientsand S3 endpoints.golangci-lint run(v2.15.0): 0 issues. actionlint: clean, apart from not knowing theubuntu-26.04runner label.dockeranddocker-testworkflows will run on it.🤖 Generated with Claude Code