all repos — dbee @ 6bc91d7e907992c8beeea717c98a830b183af97a

Move PostgreSQL backups using S3

handlers/s3/list.js (view raw)

 1const chalk = require("chalk");
 2const get = require("../../libs/config/get");
 3
 4const ListS3 = params => {
 5  const s3Servers = get("s3");
 6
 7  if (!s3Servers) {
 8    console.log(chalk.red("You have no S3 server"));
 9  } else {
10    const formatedList = Object.entries(s3Servers).map(
11      ([name, info]) => `- ${name} (${info.host})`
12    );
13    console.log(`This is you configured S3 servers:\n`);
14    console.log(chalk.yellowBright(`${formatedList.join("\n")}\n`));
15  }
16};
17
18module.exports = ListS3;