settings.js 1.3 KB

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