-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnapcraft-core26.yaml
More file actions
406 lines (371 loc) · 18.2 KB
/
Copy pathsnapcraft-core26.yaml
File metadata and controls
406 lines (371 loc) · 18.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# ─────────────────────────────────────────────────────────────────────────────
# snapcraft-core26.yaml — WeKan snap on the NEXT base, `base: core26`.
#
# This is NOT the default build, and it is not what any release job builds. The
# default is snapcraft.yaml (base: core24, grade: stable), which publishes to all
# four channels — stable, candidate, beta, edge. core26 is still experimental: it
# requires `build-base: devel`, which forces `grade: devel`, and a devel-grade
# snap is refused by the stable and candidate channels, so it can only go to beta
# and edge. That is why the release stays on core24. It is otherwise the SAME newest WeKan
# (Meteor 3.5, Node.js 24, FerretDB v1, MongoDB 7, Caddy 2) as snapcraft.yaml.
#
# To build it: `cp snapcraft-core26.yaml snapcraft.yaml && snapcraft ...`.
# Keep it in sync with snapcraft.yaml — the only intended differences are:
# base: core26 (not core24) · build-base: devel · grade: devel
# ─────────────────────────────────────────────────────────────────────────────
name: wekan-ondra
version: '9.85'
base: core26
build-base: devel
confinement: strict
grade: devel
compression: lzo
summary: Open Source kanban
description: |
WeKan ® is an Open Source and collaborative kanban board application.
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.
Depending on target environment, some configuration settings might need to be adjusted.
For full list of configuration options call:
$ wekan.help
# Metadata fields
title: Wekan Ondra
contact: https://github.com/wekan/wekan/issues
license: MIT
donation: https://wekan.fi/commercial-support/
issues: https://github.com/wekan/wekan/issues
source-code: https://github.com/wekan/wekan-ondra
website: https://wekan.fi
environment:
SNAP_DATA: "/var/snap/$SNAP_INSTANCE_NAME/$SNAP_REVISION"
SNAP_COMMON: "/var/snap/$SNAP_INSTANCE_NAME/common"
SNAP: "/snap/$SNAP_INSTANCE_NAME/$SNAP_REVISION"
# Use platforms instead of architectures for core26 base
platforms:
amd64:
build-on: amd64
build-for: amd64
arm64:
build-on: arm64
build-for: arm64
# FerretDB-only arches (no MongoDB server): mongod is not built, new installs
# default to FerretDB v1. See snap/hooks/install and the mongodb part below.
s390x:
build-on: s390x
build-for: s390x
ppc64el:
build-on: ppc64el
build-for: ppc64el
riscv64:
build-on: riscv64
build-for: riscv64
# 32-bit ARM, FerretDB-only for the same reason as the three above: MongoDB
# ships no server for it. armhf's Node.js comes from the bundle like every
# other arch's does - the wekan-armhf.zip carries the right one already, built
# by wekan/node-patches, which is the only one of WeKan's three Node.js
# sources that builds 32-bit ARM.
#
# It is here because THIS FILE IS THE NEXT BASE. snapcraft.yaml (core24) has
# all six architectures; this one had five, and the missing one does not
# announce itself - the day core26 becomes the base, armhf would simply stop
# being published and the store column would go stale exactly like
# wekan-ondra's did. tests/releaseSnapArches.test.cjs now requires the two
# files to declare the same set.
#
# There is NO i386 entry here either: no modern base has an i386 port, and
# `build-on: i386` is a PARSE error that fails every architecture's build, not
# only i386's. i386 users are served by the .deb and the AppImage.
armhf:
build-on: armhf
build-for: armhf
plugs:
mongodb-plug:
interface: content
target: $SNAP_DATA/shared
hooks:
configure:
plugs:
- network
- network-bind
slots:
mongodb-slot:
interface: content
write:
- $SNAP_DATA/share
apps:
wekan:
command: ./bin/wekan-control
daemon: simple
plugs: [network, network-bind]
after: [mongodb, ferretdb]
mongodb:
command: ./bin/mongodb-control
daemon: simple
plugs: [network, network-bind]
# The database WeKan runs on: FerretDB v1 (the wekan/FerretDB fork) with its
# embedded SQLite backend. The mongodb service beside it runs only while a
# migration is still owed - it is the source that is READ - and
# bin/database-role says which of the two that is, from the data. Both bind
# the same port, so one runs at a time. The ferretdb binary is shipped inside
# the WeKan bundle (staged to $SNAP/ferretdb by the wekan part).
ferretdb:
command: ./bin/ferretdb-control
daemon: simple
plugs: [network, network-bind]
caddy:
command: ./bin/caddy-control
daemon: simple
plugs: [network, network-bind]
after: [mongodb]
help:
command: ./bin/wekan-help
database-backup:
command: ./bin/mongodb-backup
plugs: [network, network-bind]
database-list-backups:
command: ./bin/database-list-backups
# #6583/#6585: two copies of the data, and the snap serving the older one.
# compare says what each holds (changing nothing); merge inserts the missing
# documents into the copy WeKan serves.
database-compare:
command: ./bin/database-compare
plugs: [network, network-bind]
database-merge:
command: ./bin/database-merge
plugs: [network, network-bind]
database-restore:
command: ./bin/mongodb-restore
plugs: [network, network-bind]
migrate:
command: ./bin/wekan-force-migrate
plugs: [network, network-bind]
# #6473: incremental attachment/avatar repair (runs automatically in the
# background on every start; this command is for running it by hand, e.g.
# after deleting $SNAP_COMMON/.attachments-files-v2-done).
repair-attachments:
command: ./bin/attachment-repair
plugs: [network, network-bind]
maintenance:
command: ./bin/wekan-maintenance
plugs: [network, network-bind]
parts:
mongodb:
plugin: nil
#source: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.34.tgz
# The t64 names, exactly as in snapcraft.yaml - see the long note there
# for why. Short version: Ubuntu's 64-bit time_t transition renamed
# these, the 64-bit architectures kept a compatibility Provides so the
# old spelling still resolves, and armhf did NOT - so the old names fail
# on armhf alone, which is the architecture added to this file above.
stage-packages:
- libssl3t64
- libcurl4t64
- libstemmer0d
- zlib1g
- libsnappy1v5
- libyaml-cpp0.8
- libpcre2-8-0
- libpcre2-posix3
- libboost-system1.83.0
- libboost-iostreams1.83.0
- libboost-filesystem1.83.0
- libboost-program-options1.83.0
- libgoogle-perftools4t64
override-build: |
set -eu
case "${CRAFT_ARCH_BUILD_FOR}" in
amd64) MONGO_ARCH="x86_64" ;;
arm64) MONGO_ARCH="aarch64" ;;
# FerretDB-only arches: MongoDB ships no server, so build no mongod.
# New installs default to FerretDB v1 (snap/hooks/install), and
# mongodb-control disables the mongodb service when database=ferretdb.
*) echo "No MongoDB server for ${CRAFT_ARCH_BUILD_FOR}; FerretDB-only arch, skipping mongod."; exit 0 ;;
esac
MONGO_URL="https://fastdl.mongodb.org/linux/mongodb-linux-${MONGO_ARCH}-ubuntu2204-7.0.34.tgz"
wget -O mongodb.tgz "$MONGO_URL"
tar -xzf mongodb.tgz --strip-components=1
mkdir -p "$SNAPCRAFT_PART_INSTALL/bin"
cp -a bin/* "$SNAPCRAFT_PART_INSTALL/bin/"
stage:
- bin
- usr
prime:
- bin
- usr
# No mongosh part: WeKan no longer bundles the MongoDB Shell. All scripted DB
# access (readiness, replica-set init, schema migration) uses the bundled
# Node.js 24 + the `mongodb` driver via $SNAP/bin/db-eval (see snap-src/bin).
# No separate mongotools part: the per-arch MongoDB Database Tools are already
# embedded in the wekan-<arch>.zip bundle (built from wekan/mongo-tools-patches by
# release-all.yml) and the wekan part above moves them from the bundle into
# $SNAP/bin. This keeps the snap bundle-centric — every binary comes from the
# one wekan-<arch>.zip — and avoids downloading the tools twice.
# migratemongo: the WeKan 6.09 MongoDB 3.2 binaries (bin/), the old libraries
# they need (lib/x86_64-linux-gnu: libssl/libcrypto.so.1.0.0, libpng12,
# libexpat) and the AVX QEMU wrappers (avx/), from
# https://github.com/wekan/migratemongo . Staged at $SNAP/migratemongo — which
# mongodb-control / mongodb-backup / mongodb-restore already reference via
# $SNAP/migratemongo/avx, and which migration-control uses to read the 6.09
# MongoDB 3.2 data during the one-time migration to FerretDB (it runs
# $SNAP/migratemongo/bin/mongod with LD_LIBRARY_PATH set to the lib dir above,
# and the legacy $SNAP/migratemongo/bin/mongo shell for readiness — mongosh
# cannot talk to MongoDB 3.2).
#
# amd64 only: these are x86_64 MongoDB 3.2 binaries. arm64 snaps run newest
# WeKan on MongoDB 7, whose data mongod 7 reads directly.
migratemongo:
plugin: nil
build-packages:
- git
override-build: |
set -eu
case "${CRAFT_ARCH_BUILD_FOR}" in
amd64)
git clone --depth 1 https://github.com/wekan/migratemongo.git "$SNAPCRAFT_PART_INSTALL/migratemongo"
rm -rf "$SNAPCRAFT_PART_INSTALL/migratemongo/.git"
chmod +x "$SNAPCRAFT_PART_INSTALL/migratemongo/bin/"* \
"$SNAPCRAFT_PART_INSTALL/migratemongo/avx/"* 2>/dev/null || true
;;
*)
echo "migratemongo (MongoDB 3.2, x86_64) not staged for ${CRAFT_ARCH_BUILD_FOR}; arm64 uses MongoDB 7, other arches use FerretDB v1."
;;
esac
wekan:
source: .
# The release bundle is already rebuilt for this architecture, pruned,
# and carries its own Node.js. Launchpad used to delete its completed
# node_modules tree and repeat npm install on the slow exotic builder.
plugin: nil
build-packages:
- ca-certificates
- wget
- unzip
stage-packages:
- libfontconfig1
override-build: |
set -eu
case "${CRAFT_ARCH_BUILD_FOR}" in
amd64) WEKAN_ARCH="amd64" ;;
arm64) WEKAN_ARCH="arm64" ;;
s390x) WEKAN_ARCH="s390x" ;;
ppc64el) WEKAN_ARCH="ppc64le" ;;
riscv64) WEKAN_ARCH="riscv64" ;;
*) echo "Unsupported architecture: ${CRAFT_ARCH_BUILD_FOR}"; exit 1 ;;
esac
WEKAN_ZIP="wekan-9.85-${WEKAN_ARCH}.zip"
echo "Cleaning environment first"
rm -rf .build
mkdir .build
cd .build
#wget https://github.com/wekan/wekan/releases/download/v9.85/wekan-9.85-amd64.zip
wget "https://github.com/wekan/wekan/releases/download/v9.85/${WEKAN_ZIP}"
unzip "${WEKAN_ZIP}"
rm "${WEKAN_ZIP}"
# Copy to Snap. Use the bundle's OWN arch-correct Node.js: the
# wekan-<arch>.zip already ships the right node for this platform
# (nodejs.org for amd64/arm64/s390x/ppc64le, unofficial-builds.nodejs.org
# for riscv64/loong64, wekan/node-patches for the 32-bit ones nobody
# else builds), so the snap needs no separate node download and works
# on every arch the bundle is built for - and only on those, since an
# arch with no Node.js anywhere has no bundle to take one from.
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
cp -p bundle/node $SNAPCRAFT_PART_INSTALL/bin/node
chmod +x $SNAPCRAFT_PART_INSTALL/bin/node
cp -r bundle/* $SNAPCRAFT_PART_INSTALL/
cp bundle/.node_version.txt $SNAPCRAFT_PART_INSTALL/
rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/wekan
# The snap uses its own bin/node (copied from the bundle above) and
# wekan-control, so drop the bundle's root-level node + self-contained
# launchers. Keep the bundle's ferretdb (ferretdb-control runs
# $SNAP/ferretdb) and move the bundle's per-arch MongoDB Database Tools
# into bin/ so the backup/restore scripts (which use $SNAP/bin) find them.
rm -f $SNAPCRAFT_PART_INSTALL/node \
$SNAPCRAFT_PART_INSTALL/start-wekan.sh \
$SNAPCRAFT_PART_INSTALL/start-wekan.bat
for t in bsondump mongodump mongoexport mongofiles mongoimport mongorestore mongostat mongotop; do
[ -f "$SNAPCRAFT_PART_INSTALL/$t" ] && mv -f "$SNAPCRAFT_PART_INSTALL/$t" "$SNAPCRAFT_PART_INSTALL/bin/$t" || true
done
# Bundle the MongoDB -> FerretDB migrator (run by migration-control on
# first boot when upgrading from an old MongoDB-based snap).
# override-build is currently inside .build, so the repository's
# releases directory is one level up.
cp ../releases/migrate-mongodb-to-ferretdb.mjs $SNAPCRAFT_PART_INSTALL/bin/
organize:
README: README.wekan
#prime:
# - -lib/node_modules/node-pre-gyp/node_modules/tar/lib/.unpack.js.swp
# - -lib/node_modules/weka*
helpers:
source: snap-src
plugin: dump
caddy:
plugin: nil
build-packages:
- curl
override-build: |
set -eu
# Download the official prebuilt Caddy static binary from GitHub
# releases. WeKan uses only built-in Caddy directives (reverse_proxy,
# header, tls, redir, handle) — no third-party modules — so vanilla
# Caddy is sufficient and xcaddy is NOT needed. Fetched from GitHub
# because the Launchpad remote builders cannot reach the Cloudsmith
# apt repo (their network is restricted to a fetch proxy).
# Tracks the latest stable Caddy with a pinned fallback; set
# CADDY_VERSION explicitly for fully reproducible builds.
CADDY_VERSION="$(curl -fsSL https://api.github.com/repos/caddyserver/caddy/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p' | head -1)"
[ -n "${CADDY_VERSION}" ] || CADDY_VERSION="2.8.4"
case "${CRAFT_ARCH_BUILD_FOR}" in
amd64) CADDY_ARCH=amd64 ;;
arm64) CADDY_ARCH=arm64 ;;
s390x) CADDY_ARCH=s390x ;;
ppc64el) CADDY_ARCH=ppc64le ;; # Caddy uses ppc64le, not Debian's ppc64el
riscv64) CADDY_ARCH=riscv64 ;;
# Caddy is built by Go and its release assets carry GO's names,
# not Debian's: there is no linux_armhf archive, the 32-bit ARM
# ones are armv5, armv6 and armv7. The identical gap in
# snapcraft.yaml failed the whole armhf snap with a 404, and
# armhf is a platform of this file too now, so this branch is
# reached rather than merely prepared.
# armv7, not armv6: Debian armhf's baseline is ARMv7-A with
# VFPv3-D16, which is exactly Go's GOARM=7.
armhf) CADDY_ARCH=armv7 ;;
*)
# Not a guess. Passing the Debian name straight through
# builds a URL that cannot exist, and the 404 then reads as
# Caddy having dropped the architecture.
echo "caddy: no Caddy architecture is mapped for '${CRAFT_ARCH_BUILD_FOR}'." >&2
echo " Caddy publishes linux_amd64, linux_arm64, linux_armv5, linux_armv6," >&2
echo " linux_armv7, linux_ppc64le, linux_riscv64 and linux_s390x - Go's names," >&2
echo " not Debian's. Add a branch above rather than guessing here." >&2
exit 1
;;
esac
echo "Downloading Caddy ${CADDY_VERSION} (linux/${CADDY_ARCH}) from GitHub releases..."
curl -fsSL -o /tmp/caddy.tar.gz \
"https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}/caddy_${CADDY_VERSION}_linux_${CADDY_ARCH}.tar.gz"
mkdir -p /tmp/caddy-extract
tar -xzf /tmp/caddy.tar.gz -C /tmp/caddy-extract caddy
# Install the Caddy binary into the snap
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
install -m 0755 /tmp/caddy-extract/caddy $SNAPCRAFT_PART_INSTALL/bin/caddy
# Display installed Caddy version for confirmation
echo "Installed Caddy version:"
$SNAPCRAFT_PART_INSTALL/bin/caddy version
# Create license files manually since they don't exist in the package
mkdir -p $SNAPCRAFT_PART_INSTALL/license
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
# Create a basic default Caddyfile for the snap
mkdir -p $SNAPCRAFT_PART_INSTALL/etc
cat > $SNAPCRAFT_PART_INSTALL/etc/Caddyfile << 'EOF'
# Default Caddyfile for Wekan
# This is loaded by caddy-control script if no other config is provided
:8080 {
reverse_proxy localhost:3000
}
EOF
stage:
- bin/caddy
- license/CADDY_LICENSE
- etc/Caddyfile