configGET.js 1005 B

12345678910111213141516171819202122232425262728
  1. const Route = require('../../structures/Route');
  2. class configGET extends Route {
  3. constructor() {
  4. super('/service/config', 'get', { adminOnly: true });
  5. }
  6. run(req, res) {
  7. return res.json({
  8. message: 'Successfully retrieved config',
  9. config: {
  10. serviceName: process.env.SERVICE_NAME,
  11. uploadFolder: process.env.UPLOAD_FOLDER,
  12. linksPerAlbum: parseInt(process.env.MAX_LINKS_PER_ALBUM, 10),
  13. maxUploadSize: parseInt(process.env.MAX_SIZE, 10),
  14. filenameLength: parseInt(process.env.GENERATED_FILENAME_LENGTH, 10),
  15. albumLinkLength: parseInt(process.env.GENERATED_ALBUM_LENGTH, 10),
  16. generateThumbnails: process.env.GENERATE_THUMBNAILS == 'true' ? true : false,
  17. generateZips: process.env.GENERATE_ZIPS == 'true' ? true : false,
  18. stripExif: process.env.STRIP_EXIF == 'true' ? true : false,
  19. publicMode: process.env.PUBLIC_MODE == 'true' ? true : false,
  20. enableAccounts: process.env.USER_ACCOUNTS == 'true' ? true : false
  21. }
  22. });
  23. }
  24. }
  25. module.exports = configGET;