api/config: add cobalt user agent
This commit is contained in:
parent
f3521da9c1
commit
4478a963c5
1 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
|
import { getVersion } from "@imput/version-info";
|
||||||
import { services } from "./processing/service-config.js";
|
import { services } from "./processing/service-config.js";
|
||||||
|
|
||||||
const genericUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36";
|
const version = await getVersion();
|
||||||
|
|
||||||
const disabledServices = process.env.DISABLED_SERVICES?.split(',') || [];
|
const disabledServices = process.env.DISABLED_SERVICES?.split(',') || [];
|
||||||
const enabledServices = new Set(Object.keys(services).filter(e => {
|
const enabledServices = new Set(Object.keys(services).filter(e => {
|
||||||
|
@ -40,7 +41,11 @@ const env = {
|
||||||
enabledServices,
|
enabledServices,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const genericUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36";
|
||||||
|
const cobaltUserAgent = `cobalt/${version} (+https://github.com/imputnet/cobalt)`;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
env,
|
env,
|
||||||
genericUserAgent,
|
genericUserAgent,
|
||||||
|
cobaltUserAgent,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue