2015-07-20 00:09:47 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
|
|
# This file can be used in Dockerfile
|
|
|
|
|
|
|
|
|
|
readonly container_files="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/container"
|
|
|
|
|
|
|
|
|
|
readonly CONFIG_DIR="/home/yellowtent/configs"
|
|
|
|
|
readonly DATA_DIR="/home/yellowtent/data"
|
|
|
|
|
|
|
|
|
|
########## create config directory
|
|
|
|
|
rm -rf "${CONFIG_DIR}"
|
|
|
|
|
sudo -u yellowtent mkdir "${CONFIG_DIR}"
|
|
|
|
|
|
2015-09-07 11:18:44 -07:00
|
|
|
########## systemd
|
|
|
|
|
cp -r "${container_files}/systemd/." /etc/systemd/system/
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
systemctl enable cloudron.target
|
2015-07-20 00:09:47 -07:00
|
|
|
|
|
|
|
|
########## sudoers
|
|
|
|
|
rm /etc/sudoers.d/*
|
|
|
|
|
cp "${container_files}/sudoers" /etc/sudoers.d/yellowtent
|
|
|
|
|
|
|
|
|
|
########## collectd
|
|
|
|
|
rm -rf /etc/collectd
|
|
|
|
|
ln -sfF "${DATA_DIR}/collectd" /etc/collectd
|
|
|
|
|
|
2015-09-21 10:48:46 -07:00
|
|
|
########## apparmor docker profile
|
|
|
|
|
cp "${container_files}/docker-cloudron-app.apparmor" /etc/apparmor.d/docker-cloudron-app
|
|
|
|
|
systemctl restart apparmor
|
|
|
|
|
|
2015-07-20 00:09:47 -07:00
|
|
|
########## nginx
|
|
|
|
|
# link nginx config to system config
|
|
|
|
|
unlink /etc/nginx 2>/dev/null || rm -rf /etc/nginx
|
|
|
|
|
ln -s "${DATA_DIR}/nginx" /etc/nginx
|
|
|
|
|
|
2015-08-13 13:47:18 -07:00
|
|
|
########## mysql
|
|
|
|
|
cp "${container_files}/mysql.cnf" /etc/mysql/mysql.cnf
|
|
|
|
|
|
2015-07-20 00:09:47 -07:00
|
|
|
########## Enable services
|
|
|
|
|
update-rc.d -f collectd defaults
|
|
|
|
|
|