snapcraft.yaml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. name: wekan
  2. version: 0
  3. version-script: git describe --dirty --tags | cut -c 2-
  4. summary: The open-source 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 -al $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.22.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.15.0
  70. node-packages:
  71. - node-gyp
  72. - node-pre-gyp
  73. - fibers@2.0.0
  74. build-packages:
  75. - ca-certificates
  76. - apt-utils
  77. - python
  78. - g++
  79. - capnproto
  80. - curl
  81. - execstack
  82. stage-packages:
  83. - libfontconfig1
  84. override-build: |
  85. echo "Cleaning environment first"
  86. rm -rf ~/.meteor ~/.npm /usr/local/lib/node_modules
  87. # Node Fibers 100% CPU usage issue:
  88. # https://github.com/wekan/wekan-mongodb/issues/2#issuecomment-381453161
  89. # https://github.com/meteor/meteor/issues/9796#issuecomment-381676326
  90. # https://github.com/sandstorm-io/sandstorm/blob/0f1fec013fe7208ed0fd97eb88b31b77e3c61f42/shell/server/00-startup.js#L99-L129
  91. # Also see beginning of wekan/server/authentication.js
  92. # import Fiber from "fibers";
  93. # Fiber.poolSize = 1e9;
  94. # OLD: Download node version 8.12.0 prerelease build => Official node 8.12.0 has been released
  95. # Description at https://releases.wekan.team/node.txt
  96. ##echo "375bd8db50b9c692c0bbba6e96d4114cd29bee3770f901c1ff2249d1038f1348 node" >> node-SHASUMS256.txt.asc
  97. ##curl https://releases.wekan.team/node -o node
  98. # Verify Fibers patched node authenticity
  99. ##echo "Fibers 100% CPU issue patched node authenticity:"
  100. ##grep node node-SHASUMS256.txt.asc | shasum -a 256 -c -
  101. ##rm -f node-SHASUMS256.txt.asc
  102. ##chmod +x node
  103. ##mv node `which node`
  104. # DOES NOT WORK: paxctl fix.
  105. # Removed from build-packages: - paxctl
  106. #echo "Applying paxctl fix for alpine linux: https://github.com/wekan/wekan/issues/1303"
  107. #paxctl -mC `which node`
  108. #echo "Installing npm"
  109. #curl -L https://www.npmjs.com/install.sh | sh
  110. echo "Installing meteor"
  111. curl https://install.meteor.com/ -o install_meteor.sh
  112. #sed -i "s|RELEASE=.*|RELEASE=\"1.8.1-beta.0\"|g" install_meteor.sh
  113. chmod +x install_meteor.sh
  114. sh install_meteor.sh
  115. rm install_meteor.sh
  116. if [ ! -d "packages" ]; then
  117. mkdir packages
  118. fi
  119. if [ ! -d "packages/kadira-flow-router" ]; then
  120. cd packages
  121. git clone --depth 1 -b master https://github.com/wekan/flow-router.git kadira-flow-router
  122. cd ..
  123. fi
  124. if [ ! -d "packages/meteor-useraccounts-core" ]; then
  125. cd packages
  126. git clone --depth 1 -b master https://github.com/meteor-useraccounts/core.git meteor-useraccounts-core
  127. sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' meteor-useraccounts-core/package.js
  128. cd ..
  129. fi
  130. if [ ! -d "packages/meteor-accounts-cas" ]; then
  131. cd packages
  132. git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-cas.git meteor-accounts-cas
  133. cd ..
  134. fi
  135. if [ ! -d "packages/wekan-ldap" ]; then
  136. cd packages
  137. git clone --depth 1 -b master https://github.com/wekan/wekan-ldap.git
  138. cd ..
  139. fi
  140. if [ ! -d "packages/wekan-scrollbar" ]; then
  141. cd packages
  142. git clone --depth 1 -b master https://github.com/wekan/wekan-scrollbar.git
  143. cd ..
  144. fi
  145. rm -rf package-lock.json .build
  146. meteor add standard-minifier-js --allow-superuser
  147. meteor npm install --allow-superuser
  148. meteor build .build --directory --allow-superuser
  149. cp -f fix-download-unicode/cfs_access-point.txt .build/bundle/programs/server/packages/cfs_access-point.js
  150. #Removed binary version of bcrypt because of security vulnerability that is not fixed yet.
  151. #https://github.com/wekan/wekan/commit/4b2010213907c61b0e0482ab55abb06f6a668eac
  152. #https://github.com/wekan/wekan/commit/7eeabf14be3c63fae2226e561ef8a0c1390c8d3c
  153. #cd .build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt
  154. #rm -rf node_modules/bcrypt
  155. #meteor npm install --save bcrypt
  156. # Change from npm-bcrypt directory back to .build/bundle/programs/server directory.
  157. #cd ../../../../
  158. # Change to directory .build/bundle/programs/server
  159. cd .build/bundle/programs/server
  160. npm install
  161. #meteor npm install --save bcrypt
  162. # Change back to Wekan source directory
  163. cd ../../../..
  164. cp -r .build/bundle/* $SNAPCRAFT_PART_INSTALL/
  165. cp .build/bundle/.node_version.txt $SNAPCRAFT_PART_INSTALL/
  166. rm $SNAPCRAFT_PART_INSTALL/lib/node_modules/wekan
  167. 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
  168. organize:
  169. README: README.wekan
  170. prime:
  171. - -lib/node_modules/node-pre-gyp/node_modules/tar/lib/.unpack.js.swp
  172. helpers:
  173. source: snap-src
  174. plugin: dump
  175. caddy:
  176. plugin: dump
  177. source: https://caddyserver.com/download/linux/amd64?plugins=http.filter,http.ipfilter,http.realip&license=personal&telemetry=off
  178. source-type: tar
  179. organize:
  180. caddy: bin/caddy
  181. CHANGES.txt: CADDY_CHANGES.txt
  182. EULA.txt: CADDY_EULA.txt
  183. LICENSES.txt: CADDY_LICENSES.txt
  184. README.txt: CADDY_README.txt
  185. stage:
  186. - -init