diff --git a/modules/only-office/README.md b/modules/only-office/README.md index 8b1a5291..73f787cd 100644 --- a/modules/only-office/README.md +++ b/modules/only-office/README.md @@ -11,7 +11,6 @@ Each directory or archive this module declares says how it treats a file it did - `${dir:logs}`: everything in it is the program's; the mesh moves nothing out (ADR 0422 §2). - `${dir:data}`: everything in it is the program's; the mesh moves nothing out (ADR 0422 §2). - `${dir:server-lib}`: everything in it is the program's; the mesh moves nothing out (ADR 0422 §2). -- `${dir:lib}`: everything in it is the program's; the mesh moves nothing out (ADR 0422 §2). - `${dir:db}`: everything in it is the program's; the mesh moves nothing out (ADR 0422 §2). - `${dir:rabbitmq}`: everything in it is the program's; the mesh moves nothing out (ADR 0422 §2). - `${dir:redis}`: everything in it is the program's; the mesh moves nothing out (ADR 0422 §2). @@ -23,8 +22,3 @@ Everything the container mounts sits in `${dir:box}` (`/var/lib/only-office/box` The image opens what is below each mount to every account on every start (`chmod -R 755`), so the barrier is a parent the container never sees. The module root stays root-owned 0711: the converter, which runs on the host as `only-office-converter`, passes through it to its two secrets and nothing else. - -`${dir:lib}` (`/var/lib/only-office/lib`) is the copy the container used before, no longer mounted, kept by the -mesh because it is not empty and closed to 0700. It keeps its id so mesh-host sets that mode: a new id at a path -the image owns would be used as found (issue 339). Its contents, and those of the old `logs`, `data`, `db`, -`rabbitmq`, `redis` and `fonts` beside it, are removed on the operator's word, and then `lib` leaves the manifest. diff --git a/modules/only-office/manifest_test.go b/modules/only-office/manifest_test.go index 2e44316d..e0919159 100644 --- a/modules/only-office/manifest_test.go +++ b/modules/only-office/manifest_test.go @@ -184,19 +184,16 @@ func TestConverterPassesOnlyTheRoot(t *testing.T) { } } -// 1843/AC3 (unit: manifest check) -// Given the catalogue, when only-office's manifest is read, then the directory lib is declared with no -// path (its old place, /var/lib/only-office/lib) and mode 0700, so the next apply closes the copy the -// image opened, which mesh-host keeps because it is not empty; no container volume names ${dir:lib}; -// and every data entry points at a directory that is mounted now. -func TestOldLibIsClosedAndUnmounted(t *testing.T) { +// 1854/AC1 (unit: manifest check) +// Given the catalogue, when only-office's manifest is read, then it declares no directory lib (the old +// copy the container used before issue 1843, emptied on the operator's word), no container volume names +// ${dir:lib}, and every data entry still points at a directory the server container mounts. +func TestOldLibIsGone(t *testing.T) { m := readLayout(t) - lib := m.dir(t, "lib") - if lib.Path != "" || lib.Place != "" { - t.Errorf("lib = path %q, place %q, want neither: it stays where the old copy is", lib.Path, lib.Place) - } - if lib.Mode != "0700" { - t.Errorf("lib mode = %q, want 0700", lib.Mode) + for _, r := range m.Resources { + if r.ID == "lib" && r.Type == "directory" { + t.Errorf("the manifest still declares the directory lib (path %q, mode %q)", r.Path, r.Mode) + } } mounted := map[string]bool{} for _, v := range m.container(t, "server").Volumes { @@ -213,6 +210,22 @@ func TestOldLibIsClosedAndUnmounted(t *testing.T) { } } +// 1854/AC2 (unit: manifest check) +// Given the catalogue, when only-office's README is read, then it names no ${dir:lib} and no longer +// describes the old copy as kept. +func TestReadmeNamesNoOldLib(t *testing.T) { + raw, err := os.ReadFile("README.md") + if err != nil { + t.Fatalf("reading README.md: %v", err) + } + if strings.Contains(string(raw), "${dir:lib}") { + t.Error("README.md still names ${dir:lib}") + } + if strings.Contains(string(raw), "/var/lib/only-office/lib") { + t.Error("README.md still describes the old copy at /var/lib/only-office/lib") + } +} + type layoutResource struct { ID string `json:"id"` Type string `json:"type"` diff --git a/modules/only-office/module.json b/modules/only-office/module.json index b4c1f5a1..4cabbfd0 100644 --- a/modules/only-office/module.json +++ b/modules/only-office/module.json @@ -188,12 +188,6 @@ "mode": "0711", "unknown": "program" }, - { - "id": "lib", - "type": "directory", - "mode": "0700", - "unknown": "program" - }, { "id": "db", "type": "directory",