* fix: add ssh commands back
Unauthorized users would get an error message when using commands that
need authorization
* feat: bump charmbracelet/ssh to fix race issue
Implement a task manager that can run different tasks given a unique ID.
This is needed to accommodate expensive tasks like importing a large
repository. The current behavior uses the connection's context (the SSH
connection) to import the repository. However, if the server has defined
an SSH `idle_timeout`, `max_timeout`, and/or the connection drops,
Soft Serve cancels the git clone process and aborts importing the
repository.
Instead, we add the import task to the "task manager" and wait on the
connection context. If a task already exists for the same repository,
return `Error: import already in progress`.
Fixes: https://github.com/charmbracelet/soft-serve/issues/348
Users now can generate access tokens and use them to authenticate with
Soft Serve HTTP Git server. It supports basic username & password,
generated access tokens, and JWT tokens.
As of now there is no way the user can set a password. This will be
implemented in a separate PR.
Access tokens hashes are stored in the database along with an optional
expiry date.
Access tokens can be used as the Git user or password in a HTTP clone
URL e.g. `https://<token>@git.example.com/repo.git`
fix: lint errors
fix: ensure default branch on http push
fix: address carlos comments
Generate jwt tokens
Implement git-lfs-authenticate to generate tokens through ssh
Authenticate user using HTTP
fix: git lfs endpoint auth
feat: git lfs locks
Implement git lfs locks endpoints
fix: tests
fix: access tokens migration
add expires_at
fix: lint errors
fix: cleanup
Revert "fix: cleanup"
This reverts commit 728173fbb9594d8ba32e0ca6223be08646e0136a.
fix(db): don't drop tables
Ayman Bagabas
created
8e68dba
feat: implement git-lfs preliminary support
Click to expand commit body
- Support Git LFS SSH transfer (server-side)
- Implement Git LFS Basic transfer (client)
- Import missing LFS objects when importing a repository
wip
fix: user can be nil for anonymous connections
fix: wrap db errors
fix: lint errors
Ayman Bagabas
created
8d41446
fix(ssh): increase the default idle-timeout to 10 minutes
Click to expand commit body
This would close dangling SSH connections that last for more than 10
minutes. The only down side is that the connection will get closed
without restoring the terminal for PTY sessions and the UI.
Add support to git push options.
Reference: https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt
Fixes: https://github.com/charmbracelet/soft-serve/issues/327
Use git plumbing to set the initial default branch name.
Fixes: https://github.com/charmbracelet/soft-serve/issues/147
Fixes: https://github.com/charmbracelet/soft-serve/issues/260
Ayman Bagabas
created
e0882cc
feat: store repo meta data in repo directory (#338)
Click to expand commit body
* feat: store repo meta data in repo directory
- Store auth'd user in context.
- Write description, owner, and git-daemon-export-ok files.
Fixes: https://github.com/charmbracelet/soft-serve/issues/255
Fixes: https://github.com/charmbracelet/soft-serve/issues/256
* fix: add tests
Ayman Bagabas
created
f0eb762
feat(deps): bump github.com/lib/pq from 1.2.0 to 1.10.9 (#339)
e398b4d
refactor: implement database module and abstract backend (#337)
Click to expand commit body
* refactor(server): abstract database from backend
Prepare for multi database driver support
* feat(server): add db models
* feat(db): add database migrations
* feat(db): add support to postgres
* feat: implement database store logic
* refactor: use db module and abstract backend logic
* fix(db): postgres migrate sql
* feat(db): add database query tracing
* refactor: move internal packages to server
* fix(config): normalize sqlite database path
* fix,feat: support custom log path and fix logging leak in hooks
* fix(test): race condition
* refactor: tidy up files and use middlewares
* chore: add test for repo commit command
Reference: https://github.com/charmbracelet/soft-serve/pull/331
* fix: lint errors
* fix: use utc time and fix git packp error format
* fix: lint errors
* fix: testscript on windows
* chore: format sql files
* fix: lint issues
re-enable revive linter
* refactor: clean up server/config
* feat: add admin command to manage server
* fix(db): use migration versions
* chore: add deprecation warning.
* refactor: move shared interfaces and errors to proto
* fix: increase golangci lint timeout
* feat: add move tests
e78725f
Smart HTTP Git transport & partial clones (#291) (#332)
Click to expand commit body
* refactor: tidy up server git
use git services to implement handling git server commands
pass config to git as environment variables
* feat(git): enable partial clones
* feat(server): use smart http git backend
This implements the smart http git protocol which also supports
git-receive-pack service.
* Add commit command
* fix bad refactor
* fix: actually support the color flag
* Squashed commit of the following:
commit 814ee9f8fa7014dd4fafab12974e2edd4b8f7d73
Author: Andy Lu <luandy64@gmail.com>
Date: Fri Jun 30 23:07:49 2023 -0400
Run gofmt
commit 3db029502c74461b57e776a0ebc9d27c944acc5d
Author: Andy Lu <luandy64@gmail.com>
Date: Fri Jun 30 23:06:31 2023 -0400
Pull out statsLine and diffLine, add a commit body line
commit eb1da4296e0181bae842622e0dc98ca8ca845049
Author: Andy Lu <luandy64@gmail.com>
Date: Fri Jun 30 23:05:36 2023 -0400
Add flag for printing the patch only
commit e76702e92b085f02427aae1c7052f235454242fd
Author: Andy Lu <luandy64@gmail.com>
Date: Fri Jun 30 22:50:55 2023 -0400
Add commit, author, date, and stats
commit 0359b1dc49417d11f8f8b8529f8b942417d79128
Author: Andy Lu <luandy64@gmail.com>
Date: Fri Jun 30 21:43:35 2023 -0400
Add commit, author, date, and stats
Missing color on stats
* Whitespace cleanup