snapcraft.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. name: wekan
  2. adopt-info: wekan
  3. summary: The Open-Source kanban
  4. description: |
  5. Wekan is an open-source and collaborative kanban board application.
  6. 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.
  7. Depending on target environment, some configuration settings might need to be adjusted.
  8. For full list of configuration options call:
  9. $ wekan.help
  10. confinement: strict
  11. grade: stable
  12. architectures:
  13. - amd64
  14. plugs:
  15. mongodb-plug:
  16. interface: content
  17. target: $SNAP_DATA/shared
  18. hooks:
  19. configure:
  20. plugs:
  21. - network
  22. - network-bind
  23. slots:
  24. mongodb-slot:
  25. interface: content
  26. write:
  27. - $SNAP_DATA/share
  28. apps:
  29. wekan:
  30. command: wekan-control
  31. daemon: simple
  32. plugs: [network, network-bind]
  33. mongodb:
  34. command: mongodb-control
  35. daemon: simple
  36. plugs: [network, network-bind]
  37. caddy:
  38. command: caddy-control
  39. daemon: simple
  40. plugs: [network, network-bind]
  41. help:
  42. command: wekan-help
  43. database-backup:
  44. command: mongodb-backup
  45. plugs: [network, network-bind]
  46. database-list-backups:
  47. command: ls -al $SNAP_COMMON/db-backups/
  48. database-restore:
  49. command: mongodb-restore
  50. plugs: [network, network-bind]
  51. parts:
  52. mongodb:
  53. source: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.22.tgz
  54. plugin: dump
  55. stage-packages: [libssl1.0.0]
  56. filesets:
  57. mongo:
  58. - usr
  59. - bin
  60. - lib
  61. stage:
  62. - $mongo
  63. prime:
  64. - $mongo
  65. wekan:
  66. source: .
  67. plugin: nodejs
  68. node-engine: 8.16.1
  69. node-packages:
  70. - node-gyp
  71. - node-pre-gyp
  72. - fibers@2.0.0
  73. build-packages:
  74. - ca-certificates
  75. - apt-utils
  76. - python
  77. # - python3
  78. - g++
  79. - capnproto
  80. - curl
  81. - execstack
  82. - nodejs
  83. - npm
  84. stage-packages:
  85. - libfontconfig1
  86. override-build: |
  87. echo "Cleaning environment first"
  88. rm -rf ~/.meteor ~/.npm /usr/local/lib/node_modules
  89. # Create the OpenAPI specification
  90. rm -rf .build
  91. #mkdir -p .build/python
  92. #cd .build/python
  93. #git clone --depth 1 -b master https://github.com/Kronuz/esprima-python
  94. #cd esprima-python
  95. #python3 setup.py install
  96. #cd ../../..
  97. #mkdir -p ./public/api
  98. #python3 ./openapi/generate_openapi.py --release $(git describe --tags --abbrev=0) > ./public/api/wekan.yml
  99. # we temporary need api2html and mkdirp
  100. #npm install -g api2html@0.3.0
  101. #npm install -g mkdirp
  102. #api2html -c ./public/logo-header.png -o ./public/api/wekan.html ./public/api/wekan.yml
  103. #npm uninstall -g mkdirp
  104. #npm uninstall -g api2html
  105. # Node Fibers 100% CPU usage issue:
  106. # https://github.com/wekan/wekan-mongodb/issues/2#issuecomment-381453161
  107. # https://github.com/meteor/meteor/issues/9796#issuecomment-381676326
  108. # https://github.com/sandstorm-io/sandstorm/blob/0f1fec013fe7208ed0fd97eb88b31b77e3c61f42/shell/server/00-startup.js#L99-L129
  109. # Also see beginning of wekan/server/authentication.js
  110. # import Fiber from "fibers";
  111. # Fiber.poolSize = 1e9;
  112. # OLD: Download node version 8.12.0 prerelease build => Official node 8.12.0 has been released
  113. # Description at https://releases.wekan.team/node.txt
  114. ##echo "375bd8db50b9c692c0bbba6e96d4114cd29bee3770f901c1ff2249d1038f1348 node" >> node-SHASUMS256.txt.asc
  115. ##curl https://releases.wekan.team/node -o node
  116. # Verify Fibers patched node authenticity
  117. ##echo "Fibers 100% CPU issue patched node authenticity:"
  118. ##grep node node-SHASUMS256.txt.asc | shasum -a 256 -c -
  119. ##rm -f node-SHASUMS256.txt.asc
  120. ##chmod +x node
  121. ##mv node `which node`
  122. # DOES NOT WORK: paxctl fix.
  123. # Removed from build-packages: - paxctl
  124. #echo "Applying paxctl fix for alpine linux: https://github.com/wekan/wekan/issues/1303"
  125. #paxctl -mC `which node`
  126. #echo "Installing npm"
  127. #curl -L https://www.npmjs.com/install.sh | sh
  128. echo "Installing meteor"
  129. curl https://install.meteor.com/ -o install_meteor.sh
  130. #sed -i "s|RELEASE=.*|RELEASE=\"1.8.1-beta.0\"|g" install_meteor.sh
  131. chmod +x install_meteor.sh
  132. sh install_meteor.sh
  133. rm install_meteor.sh
  134. # REPOS BELOW ARE INCLUDED TO WEKAN REPO
  135. #if [ ! -d "packages" ]; then
  136. # mkdir packages
  137. #fi
  138. #if [ ! -d "packages/kadira-flow-router" ]; then
  139. # cd packages
  140. # git clone --depth 1 -b master https://github.com/wekan/flow-router.git kadira-flow-router
  141. # cd ..
  142. #fi
  143. #if [ ! -d "packages/meteor-useraccounts-core" ]; then
  144. # cd packages
  145. # git clone --depth 1 -b master https://github.com/meteor-useraccounts/core.git meteor-useraccounts-core
  146. # sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' meteor-useraccounts-core/package.js
  147. # cd ..
  148. #fi
  149. #if [ ! -d "packages/meteor-accounts-cas" ]; then
  150. # cd packages
  151. # git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-cas.git meteor-accounts-cas
  152. # cd ..
  153. #fi
  154. #if [ ! -d "packages/wekan-ldap" ]; then
  155. # cd packages
  156. # git clone --depth 1 -b master https://github.com/wekan/wekan-ldap.git
  157. # cd ..
  158. #fi
  159. #if [ ! -d "packages/wekan-scrollbar" ]; then
  160. # cd packages
  161. # git clone --depth 1 -b master https://github.com/wekan/wekan-scrollbar.git
  162. # cd ..
  163. #fi
  164. #if [ ! -d "packages/wekan_accounts-oidc" ]; then
  165. # cd packages
  166. # git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-oidc.git
  167. # mv meteor-accounts-oidc/packages/switch_accounts-oidc wekan-accounts-oidc
  168. # mv meteor-accounts-oidc/packages/switch_oidc wekan-oidc
  169. # rm -rf meteor-accounts-oidc
  170. # cd ..
  171. #fi
  172. #if [ ! -d "packages/markdown" ]; then
  173. # cd packages
  174. # git clone --depth 1 -b master --recurse-submodules https://github.com/wekan/markdown.git
  175. # cd ..
  176. #fi
  177. rm -rf .build
  178. meteor add standard-minifier-js --allow-superuser
  179. meteor npm install --allow-superuser
  180. meteor npm install --allow-superuser --save babel-runtime
  181. meteor build .build --directory --allow-superuser
  182. cp -f fix-download-unicode/cfs_access-point.txt .build/bundle/programs/server/packages/cfs_access-point.js
  183. #Removed binary version of bcrypt because of security vulnerability that is not fixed yet.
  184. #https://github.com/wekan/wekan/commit/4b2010213907c61b0e0482ab55abb06f6a668eac
  185. #https://github.com/wekan/wekan/commit/7eeabf14be3c63fae2226e561ef8a0c1390c8d3c
  186. #cd .build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt
  187. #rm -rf node_modules/bcrypt
  188. #meteor npm install --save bcrypt
  189. # Change from npm-bcrypt directory back to .build/bundle/programs/server directory.
  190. #cd ../../../../
  191. # Change to directory .build/bundle/programs/server
  192. cd .build/bundle/programs/server
  193. npm install
  194. npm install --allow-superuser --save babel-runtime
  195. #meteor npm install --save bcrypt
  196. # Change back to Wekan source directory
  197. cd ../../../..
  198. # Remove package-lock.json so that set-version below would not claim Wekan is dirty
  199. rm -f package-lock.json
  200. # Copy files to snap
  201. cp -r .build/bundle/* $SNAPCRAFT_PART_INSTALL/
  202. cp .build/bundle/.node_version.txt $SNAPCRAFT_PART_INSTALL/
  203. # Delete phantomjs
  204. rm -f $SNAPCRAFT_PART_INSTALL/programs/server/npm/node_modules/meteor/rajit_bootstrap3-datepicker/lib/bootstrap-datepicker/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
  205. rm -f $SNAPCRAFT_PART_INSTALL/programs/server/npm/node_modules/meteor/lucasantoniassi_accounts-lockout/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
  206. # Delete all .swp files at subdirectories
  207. #find $SNAPCRAFT_PART_INSTALL -name \*.swp -type f -delete
  208. # Delete each .swp file separately
  209. #rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/wekan
  210. rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/wekan/.build/bundle/programs/server/npm/node_modules/tar/lib/.mkdir.js.swp
  211. rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/wekan/.build/bundle/programs/server/node_modules/node-pre-gyp/node_modules/tar/lib/.mkdir.js.swp
  212. rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/wekan/node_modules/tar/lib/.mkdir.js.swp
  213. rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/node-pre-gyp/node_modules/tar/lib/.mkdir.js.swp
  214. rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/node-gyp/node_modules/tar/lib/.mkdir.js.swp
  215. rm -f $SNAPCRAFT_PART_INSTALL/programs/server/npm/node_modules/tar/lib/.mkdir.js.swp
  216. # Meteor 1.8.x additional .swp remove
  217. rm -f $SNAPCRAFT_PART_INSTALL/programs/server/node_modules/node-pre-gyp/node_modules/tar/lib/.mkdir.js.swp
  218. # Wekan version
  219. snapcraftctl set-version "$(git describe --dirty --tags | cut -c 2-)"
  220. snapcraftctl build
  221. organize:
  222. README: README.wekan
  223. prime:
  224. - -lib/node_modules/node-pre-gyp/node_modules/tar/lib/.unpack.js.swp
  225. helpers:
  226. source: snap-src
  227. plugin: dump
  228. caddy:
  229. plugin: dump
  230. source: https://caddyserver.com/download/linux/amd64?license=personal&telemetry=off
  231. source-type: tar
  232. organize:
  233. caddy: bin/caddy
  234. CHANGES.txt: CADDY_CHANGES.txt
  235. EULA.txt: CADDY_EULA.txt
  236. LICENSES.txt: CADDY_LICENSES.txt
  237. README.txt: CADDY_README.txt
  238. stage:
  239. - -init