// Identity. Store your memories and mental belongings // Copyright (C) 2024 SofĂ­a Aritz // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published // by the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . import "dotenv/config"; const REQUIRED_VARS = [ "ASSET_API_ASSETS_FOLDER", "ASSET_API_IDENTITY_API_ENDPOINT", "ASSET_API_PRIVATE_KEY_PATH", "ASSET_API_PUBLIC_KEY_PATH", ]; REQUIRED_VARS.forEach((element) => { if ( process.env[element] == null || (typeof process.env[element] === "string" && process.env[element].length === 0) ) { console.error(`Required environment variable was not set: ${element}`); process.exit(1); } }); export const ASSET_API_LANDING_MESSAGE = process.env["ASSET_API_LANDING_MESSAGE"] || "asset-api v0.0.1"; export const LISTEN_PORT = Number(process.env["ASSET_API_LISTEN_PORT"]) || 3001; export const ASSETS_FOLDER = process.env["ASSET_API_ASSETS_FOLDER"]; export const IDENTITY_API_ENDPOINT = process.env["ASSET_API_IDENTITY_API_ENDPOINT"]; export const M2M_ALGORITHM = process.env["ASSET_API_M2M_ALGORITHM"] || "RSA-SHA512"; export const PRIVATE_KEY_PATH = process.env["ASSET_API_PRIVATE_KEY_PATH"] export const PUBLIC_KEY_PATH = process.env["ASSET_API_PUBLIC_KEY_PATH"]