settings.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Meteor.publish('globalwebhooks', () => {
  2. const boardId = Integrations.Const.GLOBAL_WEBHOOK_ID;
  3. return Integrations.find({
  4. boardId,
  5. });
  6. });
  7. Meteor.publish('setting', () => {
  8. return Settings.find(
  9. {},
  10. {
  11. fields: {
  12. disableRegistration: 1,
  13. disableForgotPassword: 1,
  14. productName: 1,
  15. hideLogo: 1,
  16. customLoginLogoImageUrl: 1,
  17. customLoginLogoLinkUrl: 1,
  18. textBelowCustomLoginLogo: 1,
  19. automaticLinkedUrlSchemes: 1,
  20. customTopLeftCornerLogoImageUrl: 1,
  21. customTopLeftCornerLogoLinkUrl: 1,
  22. customTopLeftCornerLogoHeight: 1,
  23. customHTMLafterBodyStart: 1,
  24. customHTMLbeforeBodyEnd: 1,
  25. displayAuthenticationMethod: 1,
  26. defaultAuthenticationMethod: 1,
  27. spinnerName: 1,
  28. oidcBtnText: 1,
  29. mailDomainName: 1,
  30. legalNotice: 1,
  31. },
  32. },
  33. );
  34. });
  35. Meteor.publish('mailServer', function() {
  36. if (!Match.test(this.userId, String)) return [];
  37. const user = Users.findOne(this.userId);
  38. if (user && user.isAdmin) {
  39. return Settings.find(
  40. {},
  41. {
  42. fields: {
  43. 'mailServer.host': 1,
  44. 'mailServer.port': 1,
  45. 'mailServer.username': 1,
  46. 'mailServer.enableTLS': 1,
  47. 'mailServer.from': 1,
  48. },
  49. },
  50. );
  51. }
  52. return [];
  53. });