snapcraft.yaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. name: wekan
  2. version: 0
  3. version-script: git describe --dirty --tags | cut -c 2-
  4. summary: The open-source Trello-like kanban
  5. description: |
  6. Wekan is an open-source and collaborative kanban board application.
  7. Whether you’re maintaining a personal todo list, planning your holidays with some friends, or working in a team on your next revolutionary idea, Kanban boards are an unbeatable tool to keep your things organized. They give you a visual overview of the current state of your project, and make you productive by allowing you to focus on the few items that matter the most.
  8. Depending on target environment, some configuration settings might need to be adjusted.
  9. For full list of configuration options call:
  10. $ wekan.help
  11. confinement: strict
  12. grade: stable
  13. architectures:
  14. - amd64
  15. plugs:
  16. mongodb-plug:
  17. interface: content
  18. target: $SNAP_DATA/shared
  19. hooks:
  20. configure:
  21. plugs:
  22. - network
  23. - network-bind
  24. slots:
  25. mongodb-slot:
  26. interface: content
  27. write:
  28. - $SNAP_DATA/share
  29. apps:
  30. wekan:
  31. command: wekan-control
  32. daemon: simple
  33. plugs: [network, network-bind]
  34. mongodb:
  35. command: mongodb-control
  36. daemon: simple
  37. plugs: [network, network-bind]
  38. caddy:
  39. command: caddy-control
  40. daemon: simple
  41. plugs: [network, network-bind]
  42. help:
  43. command: wekan-help
  44. database-backup:
  45. command: mongodb-backup
  46. plugs: [network, network-bind]
  47. database-list-backups:
  48. command: ls -ald $SNAP_COMMON/db-backups/*
  49. database-restore:
  50. command: mongodb-restore
  51. plugs: [network, network-bind]
  52. parts:
  53. mongodb:
  54. source: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.20.tgz
  55. plugin: dump
  56. stage-packages: [libssl1.0.0]
  57. filesets:
  58. mongo:
  59. - usr
  60. - bin
  61. - lib
  62. stage:
  63. - $mongo
  64. prime:
  65. - $mongo
  66. wekan:
  67. source: .
  68. plugin: nodejs
  69. node-engine: 8.11.1
  70. node-packages:
  71. - npm@6.0.1
  72. - node-gyp
  73. - node-pre-gyp
  74. - fibers@2.0.0
  75. build-packages:
  76. - ca-certificates
  77. - apt-utils
  78. - python
  79. - g++
  80. - capnproto
  81. - npm
  82. - curl
  83. - execstack
  84. stage-packages:
  85. - libfontconfig1
  86. override-build: |
  87. echo "Cleaning environment first"
  88. rm -rf ~/.meteor ~/.npm /usr/local/lib/node_modules
  89. # Node Fibers 100% CPU usage issue:
  90. # https://github.com/wekan/wekan-mongodb/issues/2#issuecomment-381453161
  91. # https://github.com/meteor/meteor/issues/9796#issuecomment-381676326
  92. # https://github.com/sandstorm-io/sandstorm/blob/0f1fec013fe7208ed0fd97eb88b31b77e3c61f42/shell/server/00-startup.js#L99-L129
  93. # Also see beginning of wekan/server/authentication.js
  94. # import Fiber from "fibers";
  95. # Fiber.poolSize = 1e9;
  96. # Download node version 8.11.1 that has fix included, node binary copied from Sandstorm
  97. # Description at https://releases.wekan.team/node.txt
  98. # SHA256SUM: 18c99d5e79e2fe91e75157a31be30e5420787213684d4048eb91e602e092725d
  99. echo "18c99d5e79e2fe91e75157a31be30e5420787213684d4048eb91e602e092725d node" >> node-SHASUMS256.txt.asc
  100. curl https://releases.wekan.team/node -o node
  101. # Verify Fibers patched node authenticity
  102. echo "Fibers 100% CPU issue patched node authenticity:"
  103. grep node node-SHASUMS256.txt.asc | shasum -a 256 -c -
  104. rm -f node-SHASUMS256.txt.asc
  105. chmod +x node
  106. mv node `which node`
  107. # DOES NOT WORK: paxctl fix.
  108. # Removed from build-packages: - paxctl
  109. #echo "Applying paxctl fix for alpine linux: https://github.com/wekan/wekan/issues/1303"
  110. #paxctl -mC `which node`
  111. echo "Installing meteor"
  112. curl https://install.meteor.com/ -o install_meteor.sh
  113. sed -i "s|RELEASE=.*|RELEASE=\"1.6.0.1\"|g" install_meteor.sh
  114. chmod +x install_meteor.sh
  115. sh install_meteor.sh
  116. rm install_meteor.sh
  117. mkdir packages
  118. cd packages
  119. git clone --depth 1 -b master https://github.com/wekan/flow-router.git kadira-flow-router
  120. git clone --depth 1 -b master https://github.com/meteor-useraccounts/core.git meteor-useraccounts-core
  121. sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' meteor-useraccounts-core/package.js
  122. cd ..
  123. rm -rf package-lock.json .build
  124. meteor add standard-minifier-js --allow-superuser
  125. meteor npm install --allow-superuser
  126. meteor build .build --directory --allow-superuser
  127. cp -f fix-download-unicode/cfs_access-point.txt .build/bundle/programs/server/packages/cfs_access-point.js
  128. cd .build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt
  129. rm -rf node_modules/bcrypt
  130. meteor npm install --save bcrypt
  131. # Change to directory .build/bundle/programs/server
  132. cd ../../../../
  133. npm install
  134. meteor npm install --save bcrypt
  135. # Change back to Wekan source directory
  136. cd ../../../..
  137. cp -r .build/bundle/* $SNAPCRAFT_PART_INSTALL/
  138. cp .build/bundle/.node_version.txt $SNAPCRAFT_PART_INSTALL/
  139. rm $SNAPCRAFT_PART_INSTALL/lib/node_modules/wekan
  140. execstack --clear-execstack $SNAPCRAFT_PART_INSTALL/programs/server/npm/node_modules/meteor/rajit_bootstrap3-datepicker/lib/bootstrap-datepicker/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
  141. organize:
  142. README: README.wekan
  143. prime:
  144. - -lib/node_modules/node-pre-gyp/node_modules/tar/lib/.unpack.js.swp
  145. helpers:
  146. source: snap-src
  147. plugin: dump
  148. caddy:
  149. plugin: dump
  150. source: https://caddyserver.com/download/linux/amd64?license=personal
  151. source-type: tar
  152. organize:
  153. caddy: bin/caddy
  154. CHANGES.txt: CADDY_CHANGES.txt
  155. EULA.txt: CADDY_EULA.txt
  156. LICENSES.txt: CADDY_LICENSES.txt
  157. README.txt: CADDY_README.txt
  158. stage:
  159. - -init