With the IPFS source, the run first installs kubo on the server, joins the private swarm, finds the newest signed publish (by IPNS, or over HTTPS if the swarm is slow) and serves its OCI layout as a local registry. The playbook, roles, packages and images then all come through the server's gateway, an SSH forward reaching it from here. Seeding is a choice the setup asks: seeders keep the daemon running and listen on 4001, others stop it after the run. The publish's playbook commit is pinned, so the roles match the images it carries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
1.5 KiB
Go
51 lines
1.5 KiB
Go
package config
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestMissingFlagsInvalidExtraYAML(t *testing.T) {
|
|
c := Default()
|
|
c.Domain = "example.org"
|
|
c.ExtraYAML = "sss\ns\ns"
|
|
got := strings.Join(c.Missing(), "\n")
|
|
if !strings.Contains(got, "aren't valid YAML") {
|
|
t.Fatalf("invalid extra YAML not reported: %q", got)
|
|
}
|
|
c.ExtraYAML = "matrix_synapse_max_upload_size_mb: 200\n"
|
|
if m := c.Missing(); len(m) != 0 {
|
|
t.Fatalf("valid extra YAML reported: %v", m)
|
|
}
|
|
}
|
|
|
|
// The playbook fails on a Synapse password provider next to MAS.
|
|
func TestMissingFlagsPasswordProviderWithMAS(t *testing.T) {
|
|
c := Default()
|
|
c.Domain = "example.org"
|
|
c.Components = map[string]bool{"mas": true, "ldap-auth": true}
|
|
c.Values["matrix_synapse_ext_password_provider_ldap_uri"] = "ldap://ldap.example.org"
|
|
c.Values["matrix_synapse_ext_password_provider_ldap_base"] = "dc=example,dc=org"
|
|
if got := strings.Join(c.Missing(), "\n"); !strings.Contains(got, "doesn't work with MAS logins") {
|
|
t.Fatalf("LDAP next to MAS not reported: %q", got)
|
|
}
|
|
c.Components["mas"] = false
|
|
if m := c.Missing(); len(m) != 0 {
|
|
t.Fatalf("LDAP without MAS reported: %v", m)
|
|
}
|
|
}
|
|
|
|
// Seeding over IPFS is asked during setup, never assumed.
|
|
func TestMissingIPFSSeedChoice(t *testing.T) {
|
|
c := Default()
|
|
c.Domain = "example.org"
|
|
c.Sources.IPFS = true
|
|
if got := strings.Join(c.Missing(), "\n"); !strings.Contains(got, "IPFS") {
|
|
t.Fatalf("unanswered seeding not reported: %q", got)
|
|
}
|
|
c.Sources.IPFSSeed = "no"
|
|
if m := c.Missing(); len(m) != 0 {
|
|
t.Fatalf("answered seeding reported: %v", m)
|
|
}
|
|
}
|