datamate-rethink-it / seafile-release

3 stars 1 forks source link

nfs in storage classes #38

Open christophdb opened 1 week ago

christophdb commented 1 week ago

Currently it seems not possible to use the storage_classes file for nfs shares. The error message is:

the storage class file looked like this:

[
    {
      "storage_id": "nfs",
      "name": "nfs",
      "is_default": true,
      "commits": {
        "backend": "fs",
        "dir": /opt/seafile/seafile-data"
      },
      "fs": {
        "backend": "fs",
        "dir": /opt/seafile/seafile-data"
      },
      "blocks": {
        "backend": "fs",
        "dir": /opt/seafile/seafile-data"
      }
    }
]

Probably it is possible to use different subfolders like /opt/seafile/seafile-data/fs, /opt/seafile/seafile-data/blocks, ...

simonhammes commented 1 week ago

If this is the case, the docs should also be updated.

https://manual.seafile.com/11.0/deploy_pro/multiple_storage_backends/#defining-storage-backends suggests:

[
  {
    "storage_id": "cold_storage",
    "name": "Cold Storage",
    "is_default": false,
    "fs": {
      "backend": "fs",
      "dir": "/storage/seafile/seafile-data"
    },
    "commits": {
      "backend": "fs",
      "dir": "/storage/seafile/seafile-data"
    },
    "blocks": {
      "backend": "fs",
      "dir": "/storage/seafile/seaflle-data"
    }
  }
]

(ignore the typo for the blocks dir)

simonhammes commented 1 week ago

I was wrong.

The JSON in the issue description is invalid: The quotes before /opt/seafile/seafile-data are missing!

BUT: The error message is totally stupid. If you fix the errors, it works. Seafile automatically creates storage/{blocks,commits,fs} subdirectories inside the configured directory.


As a quick "fix", we can add a JSON syntax check to our entrypoint script if SEAFILE__storage__storage_classes_file is set to prevent errors like these.