settings.js 1.3 KB

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