snapcraft.yaml 9.7 KB

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