settings.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import { ReactiveCache } from '/imports/reactiveCache';
  2. Meteor.publish('globalwebhooks', () => {
  3. const boardId = Integrations.Const.GLOBAL_WEBHOOK_ID;
  4. const ret = ReactiveCache.getIntegrations(
  5. {
  6. boardId,
  7. },
  8. {},
  9. true,
  10. );
  11. return ret;
  12. });
  13. Meteor.publish('setting', () => {
  14. const ret = Settings.find(
  15. {},
  16. {
  17. fields: {
  18. disableRegistration: 1,
  19. disableForgotPassword: 1,
  20. productName: 1,
  21. hideLogo: 1,
  22. hideCardCounterList: 1,
  23. hideBoardMemberList: 1,
  24. customLoginLogoImageUrl: 1,
  25. customLoginLogoLinkUrl: 1,
  26. customHelpLinkUrl: 1,
  27. textBelowCustomLoginLogo: 1,
  28. automaticLinkedUrlSchemes: 1,
  29. customTopLeftCornerLogoImageUrl: 1,
  30. customTopLeftCornerLogoLinkUrl: 1,
  31. customTopLeftCornerLogoHeight: 1,
  32. customHTMLafterBodyStart: 1,
  33. customHTMLbeforeBodyEnd: 1,
  34. displayAuthenticationMethod: 1,
  35. defaultAuthenticationMethod: 1,
  36. spinnerName: 1,
  37. oidcBtnText: 1,
  38. mailDomainName: 1,
  39. legalNotice: 1,
  40. },
  41. },
  42. );
  43. return ret;
  44. });
  45. Meteor.publish('mailServer', function() {
  46. const user = ReactiveCache.getCurrentUser();
  47. let ret = []
  48. if (user && user.isAdmin) {
  49. ret = Settings.find(
  50. {},
  51. {
  52. fields: {
  53. 'mailServer.host': 1,
  54. 'mailServer.port': 1,
  55. 'mailServer.username': 1,
  56. 'mailServer.enableTLS': 1,
  57. 'mailServer.from': 1,
  58. },
  59. },
  60. );
  61. }
  62. return ret;
  63. });