maybe something to backup mealie data idk
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import Joi from 'joi';
|
|
|
|
|
|
|
|
// TODO: add a CUSTOM_TAG env var & validation
|
|
|
|
|
|
|
|
const environmentVariableValidation = (data) => {
|
|
|
|
const schmea = Joi.object({
|
|
|
|
BASE_URL: Joi.string().uri().required(),
|
|
|
|
TOKEN: Joi.string().required(),
|
|
|
|
BACKUP_INTERVAL: Joi.number().default(1440).integer().min(1).max(10080),
|
|
|
|
REMOTE_BACKUPS_MAX: Joi.number().integer().min(5).max(1000),
|
|
|
|
EXPORT_ATTEMPTS: Joi.number().default(10).integer().min(1).max(100),
|
|
|
|
});
|
|
|
|
return schmea.validate(data);
|
|
|
|
};
|
|
|
|
|
|
|
|
const exportDatabaseValidation = (tag) => {
|
|
|
|
const schema = Joi.object({
|
|
|
|
tag: Joi.string().required().trim(),
|
|
|
|
});
|
|
|
|
return schema.validate(tag);
|
|
|
|
};
|
|
|
|
|
|
|
|
export { environmentVariableValidation, exportDatabaseValidation };
|