vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
Add automatic HTTPS with ACME
642e599466fe4f5066afdc9a24775694a52c9749 · Keenan Nemetz · 15d ago · parent 91e6a33a
forge/config/config_test.go +35
| @@ -84,3 +84,38 @@ func TestMaxJobsPerRepoLoads(t *testing.T) { | |||
| 84 | 84 | t.Fatalf("default = %d, want 0 (no cap)", unset.MaxJobsPerRepo) | |
| 85 | 85 | } | |
| 86 | 86 | } | |
| 87 | |||
| 88 | // Automatic HTTPS is opted into by naming an address; the rest of the settings | ||
| 89 | // only matter once that switch is on, so pin their TOML names as a group. | ||
| 90 | func TestACMESettingsLoad(t *testing.T) { | ||
| 91 | t.Parallel() | ||
| 92 | path := filepath.Join(t.TempDir(), "vole.toml") | ||
| 93 | body := `https_addr = ":443" | ||
| 94 | acme_email = "admin@example.com" | ||
| 95 | acme_domains = ["forge.example.com", "git.example.com"] | ||
| 96 | acme_cache_dir = "/var/lib/vole/acme" | ||
| 97 | acme_directory_url = "https://acme-staging-v02.api.letsencrypt.org/directory" | ||
| 98 | ` | ||
| 99 | if err := os.WriteFile(path, []byte(body), 0o644); err != nil { | ||
| 100 | t.Fatal(err) | ||
| 101 | } | ||
| 102 | c, err := Load(path) | ||
| 103 | if err != nil { | ||
| 104 | t.Fatal(err) | ||
| 105 | } | ||
| 106 | if c.HTTPSAddr != ":443" { | ||
| 107 | t.Fatalf("HTTPSAddr = %q", c.HTTPSAddr) | ||
| 108 | } | ||
| 109 | if c.ACMEEmail != "admin@example.com" { | ||
| 110 | t.Fatalf("ACMEEmail = %q", c.ACMEEmail) | ||
| 111 | } | ||
| 112 | if got := len(c.ACMEDomains); got != 2 || c.ACMEDomains[0] != "forge.example.com" { | ||
| 113 | t.Fatalf("ACMEDomains = %v", c.ACMEDomains) | ||
| 114 | } | ||
| 115 | if got := c.ACMECachePath(); got != "/var/lib/vole/acme" { | ||
| 116 | t.Fatalf("ACMECachePath = %q", got) | ||
| 117 | } | ||
| 118 | if c.ACMEDirectoryURL != "https://acme-staging-v02.api.letsencrypt.org/directory" { | ||
| 119 | t.Fatalf("ACMEDirectoryURL = %q", c.ACMEDirectoryURL) | ||
| 120 | } | ||
| 121 | } | ||