-
-
Notifications
You must be signed in to change notification settings - Fork 215
/
snapcraft.yaml
338 lines (303 loc) · 8.54 KB
/
snapcraft.yaml
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
name: nextcloud
version: 11.0.5snap2
summary: Nextcloud Server - A safe home for all your data
description: |
Access, share and protect your files, calendars, contacts, communication and
more at home and in your enterprise.
grade: stable
confinement: strict
apps:
# Apache daemon
apache:
command: run-httpd -k start -DFOREGROUND
stop-command: run-httpd -k stop
daemon: simple
restart-condition: always
plugs: [network, network-bind]
# MySQL daemon
mysql:
command: start_mysql
stop-command: support-files/mysql.server stop
daemon: simple
restart-condition: always
plugs: [network, network-bind]
# PHP FPM daemon
php-fpm:
command: start-php-fpm
daemon: simple
restart-condition: always
plugs: [network, network-bind, removable-media]
# redis server daemon
redis-server:
command: start-redis-server
daemon: simple
restart-condition: always
plugs: [network, network-bind]
# mDNS daemon
mdns-publisher:
command: delay-on-failure mdns-publisher nextcloud
daemon: simple
restart-condition: always
plugs: [network, network-bind]
# MySQL client
mysql-client:
command: mysql --defaults-file=$SNAP_DATA/mysql/root.ini
plugs: [network, network-bind]
mysqldump:
command: mysqldump --defaults-file=$SNAP_DATA/mysql/root.ini --lock-tables nextcloud
plugs: [network, network-bind]
# Nextcloud occ command
occ:
command: occ
plugs: [network, network-bind, removable-media]
enable-https:
command: enable-https
plugs: [network, network-bind]
disable-https:
command: disable-https
plugs: [network, network-bind]
renew-certs:
command: renew-certs
daemon: simple
restart-condition: always
plugs: [network, network-bind]
nextcloud-cron:
command: nextcloud-cron
daemon: simple
restart-condition: always
plugs: [network, network-bind, removable-media]
# Command for manually installing instead of visiting site to create admin.
manual-install:
command: manual-install
plugs: [network, network-bind, removable-media]
hooks:
configure:
plugs: [network, network-bind]
parts:
apache:
plugin: apache
source: http://ftp.wayne.edu/apache/httpd/httpd-2.4.28.tar.bz2
source-checksum: sha256/c1197a3a62a4ab5c584ab89b249af38cf28b4adee9c0106b62999fd29f920666
# The built-in Apache modules to enable
modules:
- headers
- proxy
- proxy_fcgi
- setenvif
- env
- rewrite
- mime
- dir
- authz_core
- unixd
- alias
- ssl
- socache_shmcb
filesets:
exclude:
- -man
- -manual
- -htdocs
- -include
- -build
- -conf/httpd.conf
- -conf/magic
- -conf/original
- -conf/extra
- -bin/apachectl
- -bin/envvars*
stage:
- $exclude
prime:
- $exclude
apache-customizations:
plugin: copy
files:
src/apache/scripts/*: bin/
src/apache/conf/*: conf/
src/apache/utilities/*: utilities/
nextcloud:
plugin: dump
source: https://download.nextcloud.com/server/releases/nextcloud-12.0.4.tar.bz2
source-checksum: sha256/654161a74ceaf9a60c7731d7d6702e6710a972633a97955d16f01abeb09d09b6
organize:
'*': htdocs/
'.htaccess': htdocs/.htaccess
'.user.ini': htdocs/.user.ini
# This snap automatically updates. No need to include the updater to nag
# users. This does not result in an integrity check failure.
prime:
- -htdocs/apps/updatenotification
php:
plugin: php
source: http://us2.php.net/get/php-7.0.25.tar.bz2/from/this/mirror
source-checksum: sha256/95a24d96d126a196e1550e394182b43a6460cdd2026f1a77bef01e422415cc25
source-type: tar
install-via: prefix
configflags:
- --enable-fpm
- --disable-cgi
- --disable-phar
- --disable-phpdbg
- --enable-ctype
- --enable-mbstring
- --enable-zip
- --with-pdo-mysql
- --with-zlib
- --with-gd
- --with-curl
- --with-openssl
- --with-bz2
- --with-mcrypt
- --enable-exif
- --enable-intl
- --with-jpeg-dir=/usr/lib
- --disable-rpath
stage-packages:
# These are only included here until the OS snap stabilizes
- libxml2
- libpng12-0
build-packages:
- libxml2-dev
- libcurl4-openssl-dev
- libpng12-dev
- libjpeg9-dev
- libbz2-dev
- libmcrypt-dev
prime:
- -sbin/
- -etc/
organize:
# Put php-fpm in bin with everything else, not sbin.
sbin/php-fpm: bin/php-fpm
extensions:
# Build the redis PHP module
- source: https://github.com/phpredis/phpredis/archive/3.1.4.tar.gz
source-checksum: sha256/656cab2eb93bd30f30701c1280707c60e5736c5420212d5d547ebe0d3f4baf71
redis:
plugin: redis
source: http://download.redis.io/releases/redis-4.0.2.tar.gz
source-checksum: sha256/b1a0915dbc91b979d06df1977fe594c3fa9b189f1f3d38743a2948c9f7634813
redis-customizations:
plugin: copy
files:
src/redis/config/*: config/redis/
src/redis/scripts/*: bin/
src/redis/utilities/*: utilities/
# Copy over our PHP configuration file.
php-customizations:
plugin: copy
files:
src/php/config/*: config/php/
src/php/scripts/*: bin/
src/php/utilities/*: utilities/
stage-packages: [mawk]
# Copy over our Nextcloud configuration files
nextcloud-customizations:
plugin: copy
files:
src/nextcloud/config/*: htdocs/config/
src/nextcloud/scripts/*: bin/
src/nextcloud/utilities/*: utilities/
# Download the boost headers for MySQL. Note that the version used may need to
# be updated if the version of MySQL changes.
boost:
plugin: copy
source: https://github.com/kyrofa/boost_tarball/raw/master/boost_1_59_0.tar.gz
source-checksum: sha1/5123209db194d66d69a9cfa5af8ff473d5941d97
files:
'*': boost/
prime:
- -*
mysql:
plugin: cmake
source: https://github.com/kyrofa/mysql-server.git
source-type: git
source-branch: mysql-5.7.18_support_no_setpriority
after: [boost]
configflags:
- -DWITH_BOOST=$SNAPCRAFT_STAGE/boost
- -DWITH_INNODB_PAGE_CLEANER_PRIORITY=OFF
- -DCMAKE_INSTALL_PREFIX=/
- -DBUILD_CONFIG=mysql_release
- -DWITH_UNIT_TESTS=OFF
- -DWITH_EMBEDDED_SERVER=OFF
- -DWITH_EMBEDDED_SHARED_LIBRARY=OFF
- -DWITH_ARCHIVE_STORAGE_ENGINE=OFF
- -DWITH_BLACKHOLE_STORAGE_ENGINE=OFF
- -DWITH_FEDERATED_STORAGE_ENGINE=OFF
- -DWITH_PARTITION_STORAGE_ENGINE=OFF
- -DINSTALL_MYSQLTESTDIR=
build-packages:
- wget
- g++
- cmake
- bison
- libncurses5-dev
- libaio-dev
stage:
# Remove scripts that we'll be replacing with our own
- -support-files/mysql.server
prime:
# Remove scripts that we'll be replacing with our own
- -support-files/mysql.server
# Remove unused binaries that waste space
- -bin/innochecksum
- -bin/lz4_decompress
- -bin/myisam*
- -bin/mysqladmin
- -bin/mysqlbinlog
- -bin/mysql_client_test
- -bin/mysql_config*
- -bin/mysqld_multi
- -bin/mysqlimport
- -bin/mysql_install_db
- -bin/mysql_plugin
- -bin/mysqlpump
- -bin/mysql_secure_installation
- -bin/mysqlshow
- -bin/mysqlslap
- -bin/mysql_ssl_rsa_setup
- -bin/mysqltest
- -bin/mysql_tzinfo_to_sql
- -bin/perror
- -bin/replace
- -bin/resolveip
- -bin/resolve_stack_dump
- -bin/zlib_decompress
# Copy over our MySQL scripts
mysql-customizations:
plugin: copy
files:
# This one is what creates the initial database and account for Nextcloud.
src/mysql/start_mysql: bin/
src/mysql/my.cnf: my.cnf
src/mysql/mysql.server: support-files/
src/mysql/utilities/*: utilities/
mdns-publisher:
plugin: godeps
source: https://github.com/kyrofa/mdns-publisher.git
go-importpath: github.com/kyrofa/mdns-publisher
delay-on-failure:
plugin: copy
files:
src/delay-on-failure/delay-on-failure: bin/
certbot-nextcloud-plugin:
plugin: python
python-version: python2
source: src/https/
build-packages: [python-dev, libffi-dev]
python-packages: [cffi]
setup-https:
plugin: copy
files:
src/https/scripts/*: bin/
src/https/utilities/*: utilities/
stage-packages: [openssl]
stage: [-etc/ssl]
prime: [-etc/ssl]
hooks:
plugin: dump
source: src/hooks
organize:
'bin/': snap/hooks/