Creates missing files for NextCloud in an S3 storage, so it understands the directory structure.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.2 KiB

NC-DIRS

What is this?

When you're using NextCloud (the "nc" part of the name of this) and you're using an object store (like AWS S3 or Digital Ocean Spaces), it will need some special files, marked with content-type "unix/http-directory" to understand directories; when those files are missing, NextCloud will not show the directories.

Uploading files directly from the NextCloud interface will create those files, but you use some other tool, like s3cmd, for example, those files will be missing.

nc-dirs will scan the object store and add the missing "directory" files.

Running

To run, you'll need some environment variables:

  • NC_REGION with the region name.
  • NC_ENDPOINT with the storage endpoint.
  • NC_BUCKET with the bucket name you want to scan and ensure the files are there.
  • NC_ACCESS_KEY with the access key to access the bucket.
  • NC_SECRET_KEY with the secret key to access the bucket.

(NC_ENDPOINT may seem redundant if you're using AWS S3, but as a Digital Ocean Spaces client, I need that to be able to access it properly.)