Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
blocks:server_configuration_file [2023-04-24 08:01] admin Added apiKey |
blocks:server_configuration_file [2024-05-17 07:41] (current) admin defaultSpotCSS added note |
||
---|---|---|---|
Line 33: | Line 33: | ||
#corsPath: / | #corsPath: / | ||
# | # | ||
+ | |||
applicationConnectors: | applicationConnectors: | ||
- type: http | - type: http | ||
port: 8080 | port: 8080 | ||
- | | + | |
+ | # | ||
+ | # servlet: | ||
+ | # security: | ||
+ | # - matchers: internalMatcher | ||
+ | # authorizers: | ||
+ | # clients: internalDigest | ||
+ | |||
scripting: | scripting: | ||
watchFiles: true | watchFiles: true | ||
Line 73: | Line 81: | ||
* **root**. Absolute path to Blocks' | * **root**. Absolute path to Blocks' | ||
- | * **serverRootRedirect**. Server path to go to when accessing the root level of the server. This is often used to specify the path to a Visitor Spot to be accessed by default by guests. | + | * **serverRootRedirect**. Server path to go to when accessing the root level of the server. This is often used to specify the path to a Visitor Spot to be accessed by default by guests |
- | * **defaultSpotCSS**. Specifies a default CSS file that will be automatically applied to all Spots. The path, if any, must be specified | + | * **defaultSpotCSS**. Specifies a default CSS file that will be automatically applied to all Spots. The path must be relative (with no leading slash), and is then relative to the server' |
* **homeScreenIcon**. Specifies a custom home screen icon, to appear when adding a Spot to the home screen on an iOS or Android device. Specify the URL to the image file, which must be 180 x 180 pixels. Preferably, store the image on the Blocks server under / | * **homeScreenIcon**. Specifies a custom home screen icon, to appear when adding a Spot to the home screen on an iOS or Android device. Specify the URL to the image file, which must be 180 x 180 pixels. Preferably, store the image on the Blocks server under / | ||
* **defaultNetwork**. Address of network interface (NIC) to be use for general broadcast data, such as wake-on-LAN packets. Set this to the NIC used by such devices if your server has more than one active NIC, to avoid having such data go out the wrong NIC. | * **defaultNetwork**. Address of network interface (NIC) to be use for general broadcast data, such as wake-on-LAN packets. Set this to the NIC used by such devices if your server has more than one active NIC, to avoid having such data go out the wrong NIC. | ||
Line 84: | Line 92: | ||
* **mail**. Options for sending email from Blocks, such as the SMTP server credentials to use. See below. | * **mail**. Options for sending email from Blocks, such as the SMTP server credentials to use. See below. | ||
* **apiKeys**. Keys and values for protecting Blocks API endpoints. See below. | * **apiKeys**. Keys and values for protecting Blocks API endpoints. See below. | ||
+ | * **mqtt**. Enables MQTT integration, | ||
Some top-level items have more complex structure, and are described individually below. | Some top-level items have more complex structure, and are described individually below. | ||
Line 120: | Line 129: | ||
=== server: auth === | === server: auth === | ||
- | Specifies advanced authentication and authorization options. In most cases, you don't need to specify these settings. | + | Specifies advanced authentication and authorization options. The settings shown above correspond to the defaults if no auth section is provided. In most cases, you don't need to specify these settings. |
+ | |||
+ | :!: **IMPORTANT**: | ||
==== Top level tftp item ==== | ==== Top level tftp item ==== | ||
Specifies options for the built-in TFTP-server. This is intended for [[blocks: | Specifies options for the built-in TFTP-server. This is intended for [[blocks: | ||
Line 193: | Line 204: | ||
*/ | */ | ||
@resource(undefined, | @resource(undefined, | ||
- | @apiKey(" | + | @apiKey(" |
public message( | public message( | ||
body: object, | body: object, | ||
Line 204: | Line 215: | ||
A function such as the one shown here must be placed in a User Script. For more information, | A function such as the one shown here must be placed in a User Script. For more information, | ||
+ | |||
+ | :!: **IMPORTANT**: | ||
+ | |||
+ | ==== Top level mqtt item ==== | ||
+ | |||
+ | :!: **NOTE**: This feature was added in Blocks 6.1. If you're using an older version, this section does not apply to you. | ||
+ | |||
+ | < | ||
+ | mqtt: | ||
+ | defaultBroker: | ||
+ | address: localhost | ||
+ | username: pixi # Default is no username and password | ||
+ | password: pixi | ||
+ | encryption: false #Change to true if secure connection (tls) is available. | ||
+ | </ | ||
+ | |||
+ | In the standard case, no explicit MQTT configuration is required, in which case a default broker connection to // | ||
+ | |||
+ | :!: **NOTE**: In addition to an MQTT broker, a suitable device driver is required for the device you want to control (here' | ||
+ | |||
+ | |||
+ | If you want to use a broker running on another computer, specify its IP address or name using the //address// setting as shown above. If your broker [[blocks: | ||
+ | |||
+ | :!: **NOTE**: These are the credentials of your MQTT broker – not your Blocks server. | ||
+ | |||
+ | |||
===== Alternative Blocks Root Directory ===== | ===== Alternative Blocks Root Directory ===== |