-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomize
executable file
·52 lines (36 loc) · 1.34 KB
/
customize
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
#!/usr/bin/bash
set -o errexit
PATH=/opt/local/gnu/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin
PIXELFED_VERSION='v0.12.4'
# Munin plugins
MUNIN_PLUGINS="
"
echo "* Configuring image specific packages."
mkdir -p /opt/pixelfed
echo "* Download and extract pixelfed to /opt/pixelfed"
curl -L "https://github.com/pixelfed/pixelfed/archive/${PIXELFED_VERSION}.tar.gz" | gtar xz -C /opt/pixelfed --strip-components=1
echo "* Add pixelfed user"
useradd -d /opt/pixelfed -c "pixelfed user" -s /bin/bash -g www pixelfed
echo "* Install dependencies"
cd /opt/pixelfed &&
export COMPOSER_HOME=/opt/pixelfed &&
composer install --no-ansi --no-interaction --optimize-autoloader
echo "* Backup storage skel folder"
mv /opt/pixelfed/storage /opt/pixelfed/storage.skel
mkdir /opt/pixelfed/storage
echo "* Patch file system permissions"
cd /opt/pixelfed/config &&
patch </tmp/filesystems.php.diff
echo "* Setup permissions for pixelfed folder"
chown -R pixelfed:www /opt/pixelfed
echo "* Remove php-fpm www pool configuration"
rm /opt/local/etc/php-fpm.d/www.conf
echo "* Remove unused mysql stuff from base"
rm -rf /var/mysql/*
echo "* Activate munin plugins"
/opt/core/bin/munin-node-plugins "${MUNIN_PLUGINS}"
echo "* Cleanup home/admin because of delegate dataset usage"
rm -rf /home/admin/.[^.]*
echo "* Cleaning up."
rm -rf /root/*
sm-prepare-image -y