Add custom gateway files to backup

Often we use config files at a gateway level (in the data folder, not project) for customizations on a per-gateway basis.

Normally we use git to move things around, so it handles these pretty well, but I have a use case where I can’t use git and need to move them with a gateway backup.

Is there either a way to implement this through one of the following?

  1. Something naming or config related that ignition will just pick up on. I.e. if we name it “configs” specifically, the gateway backup utility will catch it.
  2. Some config parameter I could give the ignition.conf file to tell it to include an extra folder inside data (ideal)
  3. Something module wise I could implement to implement a backup hook that allows me to add my own resources to the backup, that are gateway specific.

The easiest thing would probably be to use the filetype .conf; Ignition will grab anything with that extension. I would have thought storing in data/modules/$yourModuleId would be safe, but you’d probably want to do testing.

Darn, the only annoying thing about that is most of our configs are json out of the ease of use in python/perspective. Any I would miss the syntax highlighting in vs code by switching to .conf

Looks like anything in this folder makes its way through. I just create a random folder at data/modules/not-a-module with a json file and it worked. Not in love with the idea of nesting it in the modules folder, but this will at least work in the short term.

If I go the route of building an extra module so they can live at the data level, do you know of any hooks into the backup utility? Ideally I would like to use data/configs since thats what we have standardized on at this point.

EDIT: A bit cheeky, but if you name the top level folder configs.conf then it looks like whatever wildcard search Ignition is using catches that, however it doesn't catch a folder named .conf? Maybe something to do with how it tries to avoid .git folders causing issues with project resources.

Yeah, that's exactly what's happening. The current behavior looks like this:

private final Set<String> includes = Set.of("opc", "gateway.xml", "redundancy.xml", "gateway-network",
    "log4j.properties", "opcua-clients-unknown.keystore", "certificates", "modules", "projects",
    "logback.xml", "opcua");

public boolean accept(File file) {
    String name = file.getName();
    return !name.startsWith(".") && !name.endsWith(".bak") && !name.endsWith(".gwbk")
        && (includes.contains(name.toLowerCase()) || name.endsWith(".conf"))
        || isPerspectiveThemeBackupFolder(file) || isOpcUaUuidFile(file);
}

Not the clearest thing in the world...

And there’s no hooks for third party modules to change this behavior. You’d probably be best off using the data/modules/ route with a custom module.

Who doesn't love a hyper-custom chain of and/or logic to determine if something counts as valid! lol

I appreciate the insight. Sounds like the desired pattern would be adding something into a module, the .conf route feels a little hacky, I appreciate the help.