Zum Hauptinhalt springen
Version: 4.0

Inclusion

Service Remote Inclusions provide the ability to download files from remote servers before starting a service. This means that CloudNet calls the set URL with each service start and downloads the provided file. This is then copied to the service to be started.

URL

With the URL setting, you can determine from which URL the file can be downloaded. It is important that the URL is always the direct download. For example, the latest version from your own CI can always be downloaded without changing the files yourself.

For ProtocolLib, this URL could be used:

https://ci.dmulloy2.net/job/ProtocolLib/lastSuccessfulBuild/artifact/build/libs/ProtocolLib.jar

Destination

The Destination setting determines where within the service the downloaded file should be placed. For the destination, a relative path is specified; the path is relative to the service folder. For services with StaticServices enabled or disabled, the same applies here.

If you want, for example, ProtocolLib to be downloaded to the plugins folder, the destination should look like this:

plugins/ProtocolLib.jar

Cache Strategy

The Cache Strategy setting allows you to specify whether and how a downloaded inclusion should be cached. Currently, there are the following cache strategies:

  • none The inclusion is not kept in a cache. The inclusion is downloaded anew each time.
  • until-node-restart The inclusion is kept in cache until the node restarts. This means that no further downloads of the same inclusion take place, but the file from the cache is used.

Properties

The Properties setting allows you to set additional options for Remote Inclusions. By default, CloudNet only uses the headers option. With this option, you can determine which request headers CloudNet should send to the server when downloading files. This can be used, for example, to implement authentication.

To set headers, the properties must look like this:

"properties": {
"headers": {
"Key": "Value",
"Cache-Control": "max-age=0"
}
}

Modules and plugins can use these properties for their own advanced functions.