Add WebgitProperties configuration
Add configuration properties class with worktreePath and gitDirPath settings, and JGit dependency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
79
README.md
Normal file
79
README.md
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
# WebGit
|
||||||
|
|
||||||
|
A web interface for managing Git repositories, designed to work on retro systems
|
||||||
|
such as Windows 3.11, Windows 98, and FreeDOS.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
WebGit allows old machines on a local network to interact with Git repositories
|
||||||
|
through a simple HTML-based web interface. The server clones repositories to a
|
||||||
|
shared network drive so that legacy systems can access the working files
|
||||||
|
directly. Git operations — committing, branching, pushing, and pulling — are
|
||||||
|
performed through the web UI since these machines cannot run Git themselves.
|
||||||
|
|
||||||
|
```
|
||||||
|
┌──────────────┐ ┌──────────────┐
|
||||||
|
│ Win 3.11 / │ HTTP │ │ ┌────────────────┐
|
||||||
|
│ Win 98 PC ├───────►│ WebGit ├───►│ Git remote │
|
||||||
|
│ (browser) │ │ server │ └────────────────┘
|
||||||
|
└──────┬───────┘ └──────┬───────┘
|
||||||
|
│ │
|
||||||
|
│ ┌──────────────┐ │
|
||||||
|
└───►│ Network drive│◄──┘
|
||||||
|
│ (work trees) │
|
||||||
|
└──────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- **Clone repositories** — clone a remote repository; the working tree is placed
|
||||||
|
on the shared network drive and the `.git` directory is stored separately.
|
||||||
|
- **Create commits** — stage files and create commits from the web interface.
|
||||||
|
- **Push and pull** — sync with remote repositories.
|
||||||
|
- **Branch management** — check out existing branches or create new ones.
|
||||||
|
- **Retro-compatible UI** — pure HTML with table-based layout. No JavaScript or
|
||||||
|
CSS, so it works in period-appropriate browsers.
|
||||||
|
- **Telnet interface** — planned interface for FreeDOS users without a graphical
|
||||||
|
web browser.
|
||||||
|
|
||||||
|
## Tech Stack
|
||||||
|
|
||||||
|
- Java 25
|
||||||
|
- Spring Boot 4.0
|
||||||
|
- Thymeleaf (server-side HTML templating)
|
||||||
|
- Gradle
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Configure the following properties in `application.properties` (or via
|
||||||
|
environment variables / command-line arguments):
|
||||||
|
|
||||||
|
| Property | Description |
|
||||||
|
|---|---|
|
||||||
|
| `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). |
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```properties
|
||||||
|
webgit.worktree-path=/mnt/shared/repos
|
||||||
|
webgit.git-dir-path=/var/lib/webgit/git
|
||||||
|
```
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./gradlew build
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./gradlew bootRun
|
||||||
|
```
|
||||||
|
|
||||||
|
Then open `http://<server>:8080` in any web browser.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
TBD
|
||||||
@@ -28,6 +28,7 @@ dependencies {
|
|||||||
implementation("org.springframework.boot:spring-boot-starter-actuator")
|
implementation("org.springframework.boot:spring-boot-starter-actuator")
|
||||||
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
|
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
|
||||||
implementation("org.springframework.boot:spring-boot-starter-webmvc")
|
implementation("org.springframework.boot:spring-boot-starter-webmvc")
|
||||||
|
implementation("org.eclipse.jgit:org.eclipse.jgit:7.2.0.202503040940-r")
|
||||||
compileOnly("org.projectlombok:lombok")
|
compileOnly("org.projectlombok:lombok")
|
||||||
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
developmentOnly("org.springframework.boot:spring-boot-devtools")
|
||||||
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
|
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package be.seeseepuff.webgit.config;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "webgit")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class WebgitProperties
|
||||||
|
{
|
||||||
|
private Path worktreePath;
|
||||||
|
private Path gitDirPath;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package be.seeseepuff.webgit.config;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.TestPropertySource;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
@TestPropertySource(properties = {
|
||||||
|
"webgit.worktree-path=/mnt/shared/repos",
|
||||||
|
"webgit.git-dir-path=/var/lib/webgit/git"
|
||||||
|
})
|
||||||
|
class WebgitPropertiesTest
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private WebgitProperties properties;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void worktreePathIsBound()
|
||||||
|
{
|
||||||
|
assertEquals(Path.of("/mnt/shared/repos"), properties.getWorktreePath());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void gitDirPathIsBound()
|
||||||
|
{
|
||||||
|
assertEquals(Path.of("/var/lib/webgit/git"), properties.getGitDirPath());
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user