settings.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. hideCardCounterList: 1,
  17. hideBoardMemberList: 1,
  18. customLoginLogoImageUrl: 1,
  19. customLoginLogoLinkUrl: 1,
  20. customHelpLinkUrl: 1,
  21. textBelowCustomLoginLogo: 1,
  22. automaticLinkedUrlSchemes: 1,
  23. customTopLeftCornerLogoImageUrl: 1,
  24. customTopLeftCornerLogoLinkUrl: 1,
  25. customTopLeftCornerLogoHeight: 1,
  26. customHTMLafterBodyStart: 1,
  27. customHTMLbeforeBodyEnd: 1,
  28. displayAuthenticationMethod: 1,
  29. defaultAuthenticationMethod: 1,
  30. spinnerName: 1,
  31. oidcBtnText: 1,
  32. mailDomainName: 1,
  33. legalNotice: 1,
  34. },
  35. },
  36. );
  37. });
  38. Meteor.publish('mailServer', function() {
  39. if (!Match.test(this.userId, String)) return [];
  40. const user = Users.findOne(this.userId);
  41. if (user && user.isAdmin) {
  42. return Settings.find(
  43. {},
  44. {
  45. fields: {
  46. 'mailServer.host': 1,
  47. 'mailServer.port': 1,
  48. 'mailServer.username': 1,
  49. 'mailServer.enableTLS': 1,
  50. 'mailServer.from': 1,
  51. },
  52. },
  53. );
  54. }
  55. return [];
  56. });