Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

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.

Expand the admin status page into an operational dashboard

4506a4d3d279556435fdd414265e7499c3dada16 · Keenan Nemetz · 14d ago · parent 2e024cc9

forge/config/config_test.go +25

@@ -119,3 +119,28 @@ acme_directory_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
119 119 t.Fatalf("ACMEDirectoryURL = %q", c.ACMEDirectoryURL)
120 120 }
121 121 }
122
123 // Load records whether it actually read a file, so the status page can tell an
124 // operator whether the effective values came from disk or the built-in defaults.
125 func TestLoadRecordsTheSource(t *testing.T) {
126 t.Parallel()
127 path := filepath.Join(t.TempDir(), "vole.toml")
128 if err := os.WriteFile(path, []byte("data_dir = \"/srv/vole\"\n"), 0o644); err != nil {
129 t.Fatal(err)
130 }
131 c, err := Load(path)
132 if err != nil {
133 t.Fatal(err)
134 }
135 if !c.Loaded || c.Path != path {
136 t.Fatalf("loaded config = %+v, want Loaded with path %q", c, path)
137 }
138
139 missing, err := Load(filepath.Join(t.TempDir(), "missing.toml"))
140 if err != nil {
141 t.Fatal(err)
142 }
143 if missing.Loaded {
144 t.Fatal("a missing config file was reported as loaded")
145 }
146 }