mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
Ability to configure whether to log http requests (#149)
This commit is contained in:
@@ -146,6 +146,7 @@ BNB_PORT | 4534 | Default http port for bonob to listen on
|
|||||||
BNB_URL | http://$(hostname):4534 | URL (including path) for bonob so that sonos devices can communicate. **This must be either the public IP or DNS entry of the bonob instance so that the sonos devices can communicate with it.**
|
BNB_URL | http://$(hostname):4534 | URL (including path) for bonob so that sonos devices can communicate. **This must be either the public IP or DNS entry of the bonob instance so that the sonos devices can communicate with it.**
|
||||||
BNB_SECRET | bonob | secret used for encrypting credentials
|
BNB_SECRET | bonob | secret used for encrypting credentials
|
||||||
BNB_AUTH_TIMEOUT | 1h | Timeout for the sonos auth token, described in the format [ms](https://github.com/vercel/ms), ie. '5s' == 5 seconds, '11h' == 11 hours. In the case of using Navidrome this should be less than the value for ND_SESSIONTIMEOUT
|
BNB_AUTH_TIMEOUT | 1h | Timeout for the sonos auth token, described in the format [ms](https://github.com/vercel/ms), ie. '5s' == 5 seconds, '11h' == 11 hours. In the case of using Navidrome this should be less than the value for ND_SESSIONTIMEOUT
|
||||||
|
BNB_SERVER_LOG_REQUESTS | false | Whether or not to log http requests
|
||||||
BNB_SONOS_AUTO_REGISTER | false | Whether or not to try and auto-register on startup
|
BNB_SONOS_AUTO_REGISTER | false | Whether or not to try and auto-register on startup
|
||||||
BNB_SONOS_DEVICE_DISCOVERY | true | Enable/Disable sonos device discovery entirely. Setting this to 'false' will disable sonos device search, regardless of whether a seed host is specified.
|
BNB_SONOS_DEVICE_DISCOVERY | true | Enable/Disable sonos device discovery entirely. Setting this to 'false' will disable sonos device search, regardless of whether a seed host is specified.
|
||||||
BNB_SONOS_SEED_HOST | undefined | sonos device seed host for discovery, or ommitted for for auto-discovery
|
BNB_SONOS_SEED_HOST | undefined | sonos device seed host for discovery, or ommitted for for auto-discovery
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ const app = server(
|
|||||||
clock,
|
clock,
|
||||||
iconColors: config.icons,
|
iconColors: config.icons,
|
||||||
applyContextPath: true,
|
applyContextPath: true,
|
||||||
logRequests: true,
|
logRequests: config.logRequests,
|
||||||
version,
|
version,
|
||||||
smapiAuthTokens: new JWTSmapiLoginTokens(clock, config.secret, config.authTimeout),
|
smapiAuthTokens: new JWTSmapiLoginTokens(clock, config.secret, config.authTimeout),
|
||||||
externalImageResolver: artistImageFetcher
|
externalImageResolver: artistImageFetcher
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export default function () {
|
|||||||
validationPattern: COLOR,
|
validationPattern: COLOR,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
logRequests: bnbEnvVar<boolean>("SERVER_LOG_REQUESTS", { default: false, parser: asBoolean }),
|
||||||
sonos: {
|
sonos: {
|
||||||
serviceName: bnbEnvVar<string>("SONOS_SERVICE_NAME", { default: "bonob" })!,
|
serviceName: bnbEnvVar<string>("SONOS_SERVICE_NAME", { default: "bonob" })!,
|
||||||
discovery: {
|
discovery: {
|
||||||
|
|||||||
@@ -271,6 +271,15 @@ describe("config", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("logRequests", () => {
|
||||||
|
describeBooleanConfigValue(
|
||||||
|
"logRequests",
|
||||||
|
"BNB_SERVER_LOG_REQUESTS",
|
||||||
|
false,
|
||||||
|
(config) => config.logRequests
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
describe("sonos", () => {
|
describe("sonos", () => {
|
||||||
describe("serviceName", () => {
|
describe("serviceName", () => {
|
||||||
it("should default to bonob", () => {
|
it("should default to bonob", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user