Merge pull request 'only-office: stop declaring the old lib directory (issue 1854)' (#449) from fix/1854-drop-old-lib into main

This commit was merged in pull request #449.
This commit is contained in:
2026-10-22 16:06:46 +00:00
3 changed files with 25 additions and 24 deletions
-6
View File
@@ -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.
+25 -12
View File
@@ -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"`
-6
View File
@@ -188,12 +188,6 @@
"mode": "0711",
"unknown": "program"
},
{
"id": "lib",
"type": "directory",
"mode": "0700",
"unknown": "program"
},
{
"id": "db",
"type": "directory",