settings.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. accessibilityPageEnabled: 1,
  41. accessibilityTitle: 1,
  42. accessibilityContent: 1,
  43. },
  44. },
  45. );
  46. return ret;
  47. });
  48. Meteor.publish('mailServer', function() {
  49. const user = ReactiveCache.getCurrentUser();
  50. let ret = []
  51. if (user && user.isAdmin) {
  52. ret = Settings.find(
  53. {},
  54. {
  55. fields: {
  56. 'mailServer.host': 1,
  57. 'mailServer.port': 1,
  58. 'mailServer.username': 1,
  59. 'mailServer.enableTLS': 1,
  60. 'mailServer.from': 1,
  61. },
  62. },
  63. );
  64. }
  65. return ret;
  66. });