1.1.0 • Published 3 years ago

directus-extensions-installer v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Introduction

This package is a utility for use with Directus. It retrieves and extracts extensions from Github repositories into your Directus installation.

Its creation was due to the need for a way to install Directus extensions when deploying on Kubernetes. You can run this tool before npx directus bootstrap to install extensions on your Directus pods by overriding the command argument. Example override:

container:
    command:
        - sh
        - -c
    args:
        - npx directus-extensions-installer install;
          npx directus bootstrap && npx directus start;

Configuration for this tool is given in the form of environment variables for indicating directories as well as a .yaml file for the extensions themselves. This way you can mount a ConfigMap as a YAML file inside the image, and then just point the tool to it.

Usage

npx directus-extensions-installer

You may also specify options in the command line if you wish to override the defaults without setting environment variables.

OPTIONDESCRIPTIONDEFAULT
--directus-dirIndicates the Directus installation directory. This variable is used to find out where to extract downloads to./directus
--download-dirDirectory to download the extensions to. If it doesn't exist, it'll be created. This is deleted after use../downloads
--configPoints to the .yaml file which includes the extensions' specifications../extensions.yaml
--keepConfigDetermines whether the configuration file will be kept after the operations. This is because they may contain sensitive information, like tokens.false

 
If you wish to download a release from an extension repository located at https://github.com/foo/bar-extension, then you'd use an extensions.yaml that would look like so:

- name: extension-name
  owner: foo
  repo: bar-extension
  type: module

You can specifiy multiple extensions.

YAML config file model:

PROPERTYTYPEDESCRIPTION
namerequired stringThe extension's name.
ownerrequired stringName of the repository's owner in the Github link. Example: github.com/foo/bar has 'foo' as the owner.
reporequired stringRepository's name.
typerequired stringType of extension. Valid values include only one of the Directus extension types: "module", "interface", "display" or "layout".
tokenoptional stringGithub personal token. Only necessary if the specified repository is private. The token should have the appropriate permissions to read the repository. If invalid, you'll receive an error stating that the asset was not found.
tagoptional stringSpecify a tag to use for downloading the extension. Defaults to latest.

Current limitations

  • Currently only supports extensions available for download as .zip.
  • If run more than once it will install duplicates.
  • Does not check for duplicates in extensions.yaml.

Observations

  • If your Github permission tokens are invalid, it'll throw an error stating that it was not found (instead of saying that you are unauthorized), so make sure your token is valid.
1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7-b

3 years ago

1.0.7-a

3 years ago

1.0.7

3 years ago

0.0.1-dev

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago