Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
7 contributors

Users who have contributed to this file

@kyrofa @pachulo @JamesBream @bn4t @kesselb @popey @adhami03
391 lines (346 sloc) 9.98 KB
name: nextcloud
version: git
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: httpd-wrapper -k stop
daemon: simple
restart-condition: always
plugs: [network, network-bind, removable-media]
# 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: run-mysql
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: on-failure
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]
import:
command: import-data
plugs: [network, network-bind, removable-media]
export:
command: export-data
plugs: [network, network-bind, removable-media]
# Service for automatically fixing Nextcloud indices, etc.
nextcloud-fixer:
command: nextcloud-fixer
daemon: simple
restart-condition: on-failure
plugs: [network, network-bind, removable-media]
hooks:
configure:
plugs: [network, network-bind, removable-media]
pre-refresh:
plugs: [network, network-bind, removable-media]
parts:
apache:
plugin: apache
source: http://ftp.wayne.edu/apache/httpd/httpd-2.4.41.tar.bz2
source-checksum: sha256/133d48298fe5315ae9366a0ec66282fa4040efa5d566174481077ade7d18ea40
override-pull: |
snapcraftctl pull
# For some reason, all directories in (and after) 2.4.32 are setgid.
# Reported as https://bz.apache.org/bugzilla/show_bug.cgi?id=62298
# Work around by unsetting setgid. FIXME: Remove when bug is fixed.
find . -perm -g+s -exec chmod g-s {} \;
# 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: dump
source: src/apache/
nextcloud:
plugin: dump
source: https://download.nextcloud.com/server/releases/nextcloud-17.0.5.tar.bz2
source-checksum: sha256/d503eaf998e652554a27c14382f2b42c307e7fc9d6afa05f2829b547eb733161
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: https://php.net/get/php-7.3.16.tar.bz2/from/this/mirror
source-checksum: sha256/b8072d526a283182963b03960b7982392daa43cb31131eca4cf0b996764a042e
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
- --enable-exif
- --enable-intl
- --enable-pcntl
- --with-jpeg-dir=/usr/lib
- --with-freetype-dir=/usr/lib
- --disable-rpath
- --enable-ftp
# Enable ldap
- --with-libdir=lib/$SNAPCRAFT_ARCH_TRIPLET
- --with-ldap
# Enable gmp
- --with-gmp
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
- libldap2-dev
- libfreetype6-dev
- libgmp-dev
- libzip-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/5.1.1.tar.gz
source-checksum: sha256/6b054e1c944f0c415a3489cf6ac94d5423b2b506d8c36ac7a8cdd965a1c07cf9
redis:
plugin: redis
source: http://download.redis.io/releases/redis-5.0.8.tar.gz
source-checksum: sha256/f3c7eac42f433326a8d981b50dba0169fdfaf46abb23fcda2f933a7552ee4ed7
redis-customizations:
plugin: dump
source: src/redis/
organize:
config/*: config/redis/
# Copy over our PHP configuration file.
php-customizations:
plugin: dump
source: src/php/
organize:
config/*: config/php/
stage-packages: [mawk]
# Copy over our Nextcloud configuration files
nextcloud-customizations:
plugin: dump
source: src/nextcloud/
organize:
config/: htdocs/config/
stage-packages: [jq]
# Download the boost headers for MySQL. Note that the version used may need to
# be updated if the version of MySQL changes.
boost:
plugin: dump
source: https://github.com/kyrofa/boost_tarball/raw/master/boost_1_59_0.tar.gz
source-checksum: sha1/5123209db194d66d69a9cfa5af8ff473d5941d97
# When building MySQL, the headers in the source directory 'boost/' are
# required. Previously, using the 'copy' plugin, the whole archive was put
# under 'boost/', making the headers reside in 'boost/boost/'. Due to a bug,
# we now only stage the 'boost/' directory without moving it.
#
# Bug: https://bugs.launchpad.net/snapcraft/+bug/1757093
stage:
- boost/
prime:
- -*
mysql:
plugin: cmake
source: https://github.com/mysql/mysql-server.git
source-tag: mysql-5.7.29
source-depth: 1
override-pull: |
snapcraftctl pull
git apply $SNAPCRAFT_STAGE/mysql-support-compile-time-disabling-of-setpriority.patch
after: [boost, patches]
configflags:
- -DWITH_BOOST=$SNAPCRAFT_STAGE
- -DWITH_INNODB_PAGE_CLEANER_PRIORITY=OFF
- -DCMAKE_INSTALL_PREFIX=/
- -DBUILD_CONFIG=mysql_release
- -DWITH_UNIT_TESTS=OFF
- -DWITH_EMBEDDED_SERVER=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
- -COPYING
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: dump
source: src/mysql/
patches:
source: src/patches
plugin: dump
prime:
- -*
mdns-publisher:
plugin: godeps
source: https://github.com/kyrofa/mdns-publisher.git
go-importpath: github.com/kyrofa/mdns-publisher
delay-on-failure:
plugin: dump
source: src/delay-on-failure/
certbot:
plugin: python
python-version: python2
source: src/https/
requirements: requirements.txt
build-packages: [libffi-dev]
after: [patches]
override-build: |
snapcraftctl build
patch -p1 -d $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/certbot < $SNAPCRAFT_STAGE/certbot-remove-default-config-files.patch
patch -p1 -d $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/certbot < $SNAPCRAFT_STAGE/certbot-remove-storage-chown.patch
setup-https:
plugin: dump
source: src/https/
stage-packages: [openssl]
stage: [-etc/ssl, -requirements.txt]
import-export:
plugin: dump
source: src/import-export
stage-packages: [rsync]
common:
plugin: dump
source: src/common/
hooks:
plugin: dump
source: src/hooks/
organize:
bin/: snap/hooks/
You can’t perform that action at this time.