This commit is contained in:
@@ -52,6 +52,10 @@ environment variables / command-line arguments):
|
|||||||
|---|---|
|
|---|---|
|
||||||
| `webgit.worktree-path` | Path to the shared network drive where working trees are stored (the files your retro machines will access). |
|
| `webgit.worktree-path` | Path to the shared network drive where working trees are stored (the files your retro machines will access). |
|
||||||
| `webgit.git-dir-path` | Path where `.git` directories are stored (can be a local disk on the server). |
|
| `webgit.git-dir-path` | Path where `.git` directories are stored (can be a local disk on the server). |
|
||||||
|
| `webgit.username` | Username for push/pull authentication (e.g. a dedicated Gitea account). |
|
||||||
|
| `webgit.password` | Password or access token for push/pull authentication. |
|
||||||
|
|
||||||
|
Credentials can be supplied via environment variables (`WEBGIT_USERNAME`, `WEBGIT_PASSWORD`) to avoid storing them in config files.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
|||||||
@@ -615,7 +615,11 @@ public class GitService
|
|||||||
{
|
{
|
||||||
try (Git git = openRepository(name))
|
try (Git git = openRepository(name))
|
||||||
{
|
{
|
||||||
git.push().call();
|
var cmd = git.push();
|
||||||
|
if (properties.getUsername() != null)
|
||||||
|
cmd.setCredentialsProvider(new org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider(
|
||||||
|
properties.getUsername(), properties.getPassword()));
|
||||||
|
cmd.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -623,7 +627,11 @@ public class GitService
|
|||||||
{
|
{
|
||||||
try (Git git = openRepository(name))
|
try (Git git = openRepository(name))
|
||||||
{
|
{
|
||||||
git.pull().call();
|
var cmd = git.pull();
|
||||||
|
if (properties.getUsername() != null)
|
||||||
|
cmd.setCredentialsProvider(new org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider(
|
||||||
|
properties.getUsername(), properties.getPassword()));
|
||||||
|
cmd.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,3 +4,7 @@ webgit.worktree-path=./webgit/worktree
|
|||||||
|
|
||||||
webgit.telnet.enabled=true
|
webgit.telnet.enabled=true
|
||||||
webgit.telnet-port=2323
|
webgit.telnet-port=2323
|
||||||
|
|
||||||
|
# Optional: credentials for push/pull (can also be set via WEBGIT_USERNAME / WEBGIT_PASSWORD env vars)
|
||||||
|
#webgit.username=
|
||||||
|
#webgit.password=
|
||||||
|
|||||||
Reference in New Issue
Block a user