diff options
author | Dennis Eriksen <d@ennis.no> | 2019-10-19 10:39:17 +0200 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2019-10-19 10:39:17 +0200 |
commit | a95f7ea28b1d4fc5195d3b59892c5cba63b92556 (patch) | |
tree | 897b726583204a0a5f73a72e01f37974b3bd9231 | |
download | mkosi-kanboard-a95f7ea28b1d4fc5195d3b59892c5cba63b92556.tar.gz |
initial commit
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | mkosi.default | 32 | ||||
-rw-r--r-- | mkosi.nspawn | 16 | ||||
-rwxr-xr-x | mkosi.postinst | 31 | ||||
-rw-r--r-- | mkosi.skeleton/root/apache2.kanboard.conf | 24 | ||||
-rw-r--r-- | mkosi.skeleton/root/apache2.mpm_prefork.conf | 16 | ||||
-rw-r--r-- | mkosi.skeleton/root/apache2.ports.conf | 4 |
7 files changed, 125 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3dff6a2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# mkosi cache +mkosi.cache/* diff --git a/mkosi.default b/mkosi.default new file mode 100644 index 0000000..a0ff7f7 --- /dev/null +++ b/mkosi.default @@ -0,0 +1,32 @@ +[Distribution] +Distribution=ubuntu +Release=bionic +Repositories=main,universe +Mirror=http://no.archive.ubuntu.com + +[Output] +Format=directory +Output=/var/lib/machines/kanboard + +[Packages] +WithNetwork=yes +Packages= + iputils-ping + vim + curl + iproute2 + dnsutils + net-tools + ca-certificates + locales + openssl + apache2 + libapache2-mod-php + php + php-gd + php-json + php-mbstring + php-pgsql + php-xml + vim + wget diff --git a/mkosi.nspawn b/mkosi.nspawn new file mode 100644 index 0000000..9d73174 --- /dev/null +++ b/mkosi.nspawn @@ -0,0 +1,16 @@ +[Exec] +Hostname=kanboard +ResolvConf=copy-host +Timezone=copy +PrivateUsers=pick +NoNewPrivileges=yes + +[Files] +PrivateUsersChown=yes +Bind=/var/local/kanboard/data:/var/www/kanboard/data +Bind=/var/local/kanboard/plugins:/var/www/kanboard/plugins +BindReadOnly=/etc/kanboard/config.php:/var/www/kanboard/config.php + +[Network] +VirtualEthernet=no + diff --git a/mkosi.postinst b/mkosi.postinst new file mode 100755 index 0000000..48f384f --- /dev/null +++ b/mkosi.postinst @@ -0,0 +1,31 @@ +#!/bin/sh +set -ex + +export DEBIAN_FRONTEND=noninteractive + +# locales +sed -i 's/# en_IE.UTF-8 UTF-8/en_IE.UTF-8 UTF-8/' /etc/locale.gen +locale-gen + +# get kanboard +url='https://github.com/kanboard/kanboard/archive/v1.2.10.tar.gz' + +TMP=$(mktemp -d) +cd $TMP +wget "${url}" +tar xf $(basename "${url}" ) +mv $(basename $(tar tf $(basename "${url}") | head -n1)) /var/www/kanboard +cd / && rm -r $TMP + +chown -R www-data: /var/www/kanboard +rm -r /var/www/kanboard/data +rm -r /var/www/kanboard/plugins + + +mv /root/apache2.ports.conf /etc/apache2/ports.conf +mv /root/apache2.kanboard.conf /etc/apache2/sites-available/kanboard.conf +mv /root/apache2.mpm_prefork.conf /etc/apache2/mods-available/mpm_prefork.conf + +a2dissite 000-default.conf +a2enmod rewrite +a2ensite kanboard.conf diff --git a/mkosi.skeleton/root/apache2.kanboard.conf b/mkosi.skeleton/root/apache2.kanboard.conf new file mode 100644 index 0000000..12af95f --- /dev/null +++ b/mkosi.skeleton/root/apache2.kanboard.conf @@ -0,0 +1,24 @@ +<VirtualHost *:8302> + + ServerName kanboard.dnns.no + UseCanonicalName on + + DocumentRoot /var/www/kanboard + DirectoryIndex index.php index.html + + # To cirkumvent phps $_SERVER['HTTPS']-check + SetEnv HTTPS "on" + + AcceptPathInfo On + + # Trust the remote user forwarded by nginx + SetEnvIf X-Forwarded-User (.*) REMOTE_USER=$1 + + <Directory /var/www/kanboard/> + AllowOverride FileInfo Options=All,MultiViews AuthConfig + </Directory> + +</VirtualHost> + + + diff --git a/mkosi.skeleton/root/apache2.mpm_prefork.conf b/mkosi.skeleton/root/apache2.mpm_prefork.conf new file mode 100644 index 0000000..73ceafc --- /dev/null +++ b/mkosi.skeleton/root/apache2.mpm_prefork.conf @@ -0,0 +1,16 @@ +# prefork MPM +# StartServers: number of server processes to start +# MinSpareServers: minimum number of server processes which are kept spare +# MaxSpareServers: maximum number of server processes which are kept spare +# MaxRequestWorkers: maximum number of server processes allowed to start +# MaxConnectionsPerChild: maximum number of requests a server process serves + +<IfModule mpm_prefork_module> + StartServers 1 + MinSpareServers 1 + MaxSpareServers 10 + MaxRequestWorkers 75 + MaxConnectionsPerChild 0 +</IfModule> + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/mkosi.skeleton/root/apache2.ports.conf b/mkosi.skeleton/root/apache2.ports.conf new file mode 100644 index 0000000..b750446 --- /dev/null +++ b/mkosi.skeleton/root/apache2.ports.conf @@ -0,0 +1,4 @@ +Listen 127.0.0.1:8302 +Listen [::1]:8302 + +# vim: syntax=apache ts=4 sw=4 sr noet |