yaml validation

This commit is contained in:
Ben Phelps 2022-09-18 16:41:01 +03:00
parent b5065673ab
commit 17f54da524
11 changed files with 83 additions and 32 deletions

View file

@ -0,0 +1,9 @@
import checkAndCopyConfig from "utils/config";
const configs = ["docker.yaml", "settings.yaml", "services.yaml", "bookmarks.yaml"];
export default async function handler(req, res) {
const errors = configs.map((config) => checkAndCopyConfig(config)).filter((status) => status !== true);
res.send(errors);
}

View file

@ -14,7 +14,7 @@ export default async function handler(req, res) {
}
if (!apiKey && provider) {
const settings = await getSettings();
const settings = getSettings();
apiKey = settings?.providers?.openweathermap;
}

View file

@ -14,7 +14,7 @@ export default async function handler(req, res) {
}
if (!apiKey && provider) {
const settings = await getSettings();
const settings = getSettings();
apiKey = settings?.providers?.weatherapi;
}