snapcraft.yaml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. name: wekan
  2. version: '8.14'
  3. base: core24
  4. summary: 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. # Metadata fields
  14. title: Wekan
  15. contact: https://github.com/wekan/wekan/issues
  16. license: MIT
  17. donation: https://wekan.fi/commercial-support/
  18. issues: https://github.com/wekan/wekan/issues
  19. source-code: https://github.com/wekan/wekan
  20. website: https://wekan.fi
  21. # Use platforms instead of architectures for core24 base
  22. platforms:
  23. amd64:
  24. build-on: amd64
  25. build-for: amd64
  26. plugs:
  27. mongodb-plug:
  28. interface: content
  29. target: $SNAP_DATA/shared
  30. hooks:
  31. configure:
  32. plugs:
  33. - network
  34. - network-bind
  35. slots:
  36. mongodb-slot:
  37. interface: content
  38. write:
  39. - $SNAP_DATA/share
  40. apps:
  41. wekan:
  42. command: ./bin/wekan-control
  43. daemon: simple
  44. plugs: [network, network-bind]
  45. mongodb:
  46. command: ./bin/mongodb-control
  47. daemon: simple
  48. plugs: [network, network-bind]
  49. caddy:
  50. command: ./bin/caddy-control
  51. daemon: simple
  52. plugs: [network, network-bind]
  53. help:
  54. command: ./bin/wekan-help
  55. database-backup:
  56. command: ./bin/mongodb-backup
  57. plugs: [network, network-bind]
  58. database-list-backups:
  59. command: ./bin/database-list-backups
  60. database-restore:
  61. command: ./bin/mongodb-restore
  62. plugs: [network, network-bind]
  63. parts:
  64. mongodb:
  65. source: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.25.tgz
  66. plugin: dump
  67. stage-packages:
  68. - libssl3
  69. - libcurl4
  70. - libstemmer0d
  71. - zlib1g
  72. - libsnappy1v5
  73. - libyaml-cpp0.8
  74. - libpcre3
  75. - libpcrecpp0v5
  76. - libboost-system1.74.0
  77. - libboost-iostreams1.74.0
  78. - libboost-filesystem1.74.0
  79. - libboost-program-options1.74.0
  80. - libgoogle-perftools4
  81. stage:
  82. - bin
  83. - usr
  84. prime:
  85. - bin
  86. - usr
  87. mongosh:
  88. source: https://downloads.mongodb.com/compass/mongosh-2.5.3-linux-x64.tgz
  89. plugin: dump
  90. mongotools:
  91. source: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2404-x86_64-100.12.2.tgz
  92. plugin: dump
  93. wekan:
  94. source: .
  95. plugin: npm
  96. npm-node-version: 14.21.3
  97. npm-include-node: true
  98. build-packages:
  99. - build-essential
  100. - ca-certificates
  101. - apt-utils
  102. - python3
  103. - g++
  104. - capnproto
  105. - curl
  106. - wget
  107. - unzip
  108. - execstack
  109. - nodejs
  110. - npm
  111. stage-packages:
  112. - libfontconfig1
  113. override-build: |
  114. echo "Cleaning environment first"
  115. #rm -rf ~/.meteor ~/.npm /usr/local/lib/node_modules
  116. rm -rf .build
  117. #echo "Using http npm packages so speedup install process https://stackoverflow.com/questions/39760113/callback-called-more-than-once-while-running-npm-install"
  118. #echo "registry=http://registry.npmjs.org/" > ~/.npmrc
  119. #echo "Installing npm, node-gyp, node-pre-gyp, fibers"
  120. #npm -g install n --unsafe-perm
  121. #n 14.21.4
  122. #npm -g install node-gyp --unsafe-perm
  123. #npm -g install node-pre-gyp --unsafe-perm
  124. #npm -g install fibers --unsafe-perm
  125. ##echo "Installing meteor"
  126. ##curl https://install.meteor.com/ -o install_meteor.sh
  127. ##chmod +x install_meteor.sh
  128. ##sh install_meteor.sh
  129. ##rm install_meteor.sh
  130. #npm -g install meteor --unsafe-perm --allow-superuser
  131. #rm -rf .build
  132. ##chmod u+w *.json
  133. #npm install --unsafe-perm
  134. ##npm install
  135. ##meteor build .build --directory --allow-superuser
  136. # Remove legacy webbroser bundle, so that Wekan works also at Android Firefox, iOS Safari, etc.
  137. ##rm -rf .build/bundle/programs/web.browser.legacy
  138. # Change to directory .build/bundle/programs/server
  139. ##cd .build/bundle/programs/server
  140. ##chmod u+w *.json
  141. #npm install --unsafe-perm
  142. ##npm install
  143. ##cd node_modules/fibers
  144. ##node build.js
  145. ##cd ../../../../../..
  146. # Cleanup
  147. mkdir .build
  148. cd .build
  149. wget https://github.com/wekan/wekan/releases/download/v8.14/wekan-8.14-amd64.zip
  150. unzip wekan-8.14-amd64.zip
  151. rm wekan-8.14-amd64.zip
  152. cd ..
  153. ##cd .build/bundle
  154. ##find . -type d -name '*-garbage*' | xargs rm -rf
  155. ##find . -name '*phantom*' | xargs rm -rf
  156. ##find . -name '.*.swp' | xargs rm -f
  157. ##find . -name '*.swp' | xargs rm -f
  158. ##cd ../..
  159. # Add fibers multi arch
  160. #cd .build/bundle/programs/server/node_modules/fibers/bin
  161. #curl https://releases.wekan.team/fibers-multi.7z -o fibers-multi.7z
  162. #7z x fibers-multi.7z
  163. #rm fibers-multi.7z
  164. #cd ../../../../../../..
  165. # Copy to Snap
  166. wget https://github.com/wekan/node-v14-esm/releases/download/v14.21.4/node-v14.21.4-linux-x64.tar.xz
  167. tar -xf node-v14.21.4-linux-x64.tar.xz node-v14.21.4-linux-x64/bin/node
  168. rm node-v14.21.4-linux-x64.tar.xz
  169. mkdir $SNAPCRAFT_PART_INSTALL/bin
  170. cp -p node-v14.21.4-linux-x64/bin/node $SNAPCRAFT_PART_INSTALL/bin/
  171. rm -rf node-v14.21.4-linux-x64
  172. cp -r .build/bundle/* $SNAPCRAFT_PART_INSTALL/
  173. cp .build/bundle/.node_version.txt $SNAPCRAFT_PART_INSTALL/
  174. rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/wekan
  175. # Delete phantomjs that is in accounts-lockout
  176. #rm -rf $SNAPCRAFT_PART_INSTALL/programs/server/npm/node_modules/meteor/lucasantoniassi_accounts-lockout/node_modules/phantomjs-prebuilt
  177. # Delete temporary files
  178. #rm -f $SNAPCRAFT_PART_INSTALL/programs/server/npm/node_modules/tar/lib/.mkdir.js.swp
  179. #rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/node-pre-gyp/node_modules/tar/lib/.mkdir.js.swp
  180. #rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/node-gyp/node_modules/tar/lib/.mkdir.js.swp
  181. # Meteor 1.8.x additional .swp remove
  182. #rm -f $SNAPCRAFT_PART_INSTALL/programs/server/node_modules/node-pre-gyp/node_modules/tar/lib/.mkdir.js.swp
  183. # Delete fibers for other archs
  184. #rm -rf $SNAPCRAFT_PART_INSTALL/programs/server/node_modules/fibers/bin/linux-ia32*
  185. # ostrio tmp remove
  186. #rm -rf $SNAPCRAFT_PART_INSTALL/programs/server/npm/node_modules/meteor/ostrio_files/node_modules/request-libcurl/.node_modules-garbage*
  187. organize:
  188. README: README.wekan
  189. prime:
  190. - -lib/node_modules/node-pre-gyp/node_modules/tar/lib/.unpack.js.swp
  191. - -lib/node_modules/weka*
  192. helpers:
  193. source: snap-src
  194. plugin: dump
  195. caddy:
  196. plugin: nil
  197. build-packages:
  198. - debian-keyring
  199. - debian-archive-keyring
  200. - apt-transport-https
  201. - gnupg
  202. - curl
  203. override-build: |
  204. # Add Caddy repository
  205. echo "Installing Caddy 2 from the official repository..."
  206. curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /tmp/caddy-stable-archive-keyring.gpg
  207. mkdir -p /etc/apt/keyrings
  208. cp /tmp/caddy-stable-archive-keyring.gpg /etc/apt/keyrings/
  209. echo "deb [signed-by=/etc/apt/keyrings/caddy-stable-archive-keyring.gpg] https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version main" > /etc/apt/sources.list.d/caddy-stable.list
  210. apt update
  211. apt -y install caddy
  212. # Display installed Caddy version for confirmation
  213. echo "Installed Caddy version:"
  214. /usr/bin/caddy version
  215. # Create directory structure in the snap
  216. mkdir -p $SNAPCRAFT_PART_INSTALL/bin
  217. # Copy Caddy binary
  218. cp /usr/bin/caddy $SNAPCRAFT_PART_INSTALL/bin/
  219. chmod +x $SNAPCRAFT_PART_INSTALL/bin/caddy
  220. # Create license files manually since they don't exist in the package
  221. mkdir -p $SNAPCRAFT_PART_INSTALL/license
  222. echo "Caddy is licensed under the Apache License 2.0. See https://github.com/caddyserver/caddy/blob/master/LICENSE" > $SNAPCRAFT_PART_INSTALL/license/CADDY_LICENSE
  223. # Create a basic default Caddyfile for the snap
  224. mkdir -p $SNAPCRAFT_PART_INSTALL/etc
  225. cat > $SNAPCRAFT_PART_INSTALL/etc/Caddyfile << 'EOF'
  226. # Default Caddyfile for Wekan
  227. # This is loaded by caddy-control script if no other config is provided
  228. :8080 {
  229. reverse_proxy localhost:3000
  230. }
  231. EOF
  232. stage:
  233. - bin/caddy
  234. - license/CADDY_LICENSE
  235. - etc/Caddyfile