mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 00:41:59 +01:00
docker fixes
This commit is contained in:
parent
fda29dd180
commit
c37f565a17
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
HOSTNAME=`hostname -f`
|
HOSTNAME=`hostname -f`
|
||||||
PILER_HOST_IP="127.0.0.1"
|
PILER_HOST_IP=`ip addr show | grep inet\ | grep -v 127.0.0.1 | awk '{print $2}' | cut -f1 -d '/'`
|
||||||
SMARTHOST=""
|
SMARTHOST=""
|
||||||
PILERUSER="piler"
|
PILERUSER="piler"
|
||||||
MYSQL_HOSTNAME="localhost"
|
MYSQL_HOSTNAME="localhost"
|
||||||
@ -14,9 +14,7 @@ KEYTMPFILE="key.tmp"
|
|||||||
DOCROOT="/var/www/piler"
|
DOCROOT="/var/www/piler"
|
||||||
WWWGROUP="www-data"
|
WWWGROUP="www-data"
|
||||||
SSL_CERT_DATA="/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com"
|
SSL_CERT_DATA="/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com"
|
||||||
|
SPHINX_PILER_CONFIG="/usr/local/etc/sphinx.conf"
|
||||||
NGINX_PILER_CONFIG_DEBIAN="/etc/nginx/sites-available/piler.conf"
|
|
||||||
SPHINX_PILER_CONFIG_DEBIAN="/usr/local/etc/sphinx.conf"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -191,8 +189,6 @@ show_install_parameters() {
|
|||||||
echo
|
echo
|
||||||
echo "Hostname: $HOSTNAME"
|
echo "Hostname: $HOSTNAME"
|
||||||
echo "IP-address: $PILER_HOST_IP"
|
echo "IP-address: $PILER_HOST_IP"
|
||||||
echo "Netmask: $NETMASK"
|
|
||||||
echo "Gateway: $GATEWAY"
|
|
||||||
echo "Smarthost: $SMARTHOST"
|
echo "Smarthost: $SMARTHOST"
|
||||||
echo "Documentroot: $DOCROOT"
|
echo "Documentroot: $DOCROOT"
|
||||||
echo "Webserver user: $WWWGROUP"
|
echo "Webserver user: $WWWGROUP"
|
||||||
@ -228,7 +224,7 @@ debug=0
|
|||||||
default_retention_days=2557
|
default_retention_days=2557
|
||||||
encrypt_messages=1
|
encrypt_messages=1
|
||||||
extra_to_field=X-Envelope-To:
|
extra_to_field=X-Envelope-To:
|
||||||
hostid=HOSTNAME
|
hostid=$HOSTNAME
|
||||||
iv=
|
iv=
|
||||||
listen_addr=0.0.0.0
|
listen_addr=0.0.0.0
|
||||||
listen_port=25
|
listen_port=25
|
||||||
@ -241,9 +237,9 @@ min_word_len=1
|
|||||||
mysqlhost=
|
mysqlhost=
|
||||||
mysqlport=0
|
mysqlport=0
|
||||||
mysqlsocket=/var/run/mysqld/mysqld.sock
|
mysqlsocket=/var/run/mysqld/mysqld.sock
|
||||||
mysqluser=MYSQL_USERNAME
|
mysqluser=$MYSQL_USERNAME
|
||||||
mysqlpwd=MYSQL_PASSWORD
|
mysqlpwd=$MYSQL_PASSWORD
|
||||||
mysqldb=MYSQL_DATABASE
|
mysqldb=$MYSQL_DATABASE
|
||||||
mysql_connect_timeout=2
|
mysql_connect_timeout=2
|
||||||
number_of_worker_processes=10
|
number_of_worker_processes=10
|
||||||
pemfile=/usr/local/etc/piler.pem
|
pemfile=/usr/local/etc/piler.pem
|
||||||
@ -264,6 +260,8 @@ PILERCONF
|
|||||||
|
|
||||||
piler_postinstall() {
|
piler_postinstall() {
|
||||||
|
|
||||||
|
cd /tmp/jsuto-piler-*
|
||||||
|
|
||||||
echo -n "Creating mysql database... ";
|
echo -n "Creating mysql database... ";
|
||||||
sed -e "s%MYSQL_HOSTNAME%$MYSQL_HOSTNAMEg%" -e "s%MYSQL_DATABASE%$MYSQL_DATABASE%g" -e "s%MYSQL_USERNAME%$MYSQL_USERNAME%g" -e "s%MYSQL_PASSWORD%$MYSQL_PASSWORD%g" util/db-mysql-root.sql.in | mysql -h $MYSQL_HOSTNAME -u root --password=$MYSQL_ROOT_PASSWORD
|
sed -e "s%MYSQL_HOSTNAME%$MYSQL_HOSTNAMEg%" -e "s%MYSQL_DATABASE%$MYSQL_DATABASE%g" -e "s%MYSQL_USERNAME%$MYSQL_USERNAME%g" -e "s%MYSQL_PASSWORD%$MYSQL_PASSWORD%g" util/db-mysql-root.sql.in | mysql -h $MYSQL_HOSTNAME -u root --password=$MYSQL_ROOT_PASSWORD
|
||||||
mysql -h $MYSQL_HOSTNAME -u $MYSQL_USERNAME --password=$MYSQL_PASSWORD $MYSQL_DATABASE < util/db-mysql.sql
|
mysql -h $MYSQL_HOSTNAME -u $MYSQL_USERNAME --password=$MYSQL_PASSWORD $MYSQL_DATABASE < util/db-mysql.sql
|
||||||
@ -287,16 +285,17 @@ rm 1.cert
|
|||||||
|
|
||||||
|
|
||||||
echo -n "installing keyfile ($KEYTMPFILE) to $KEYFILE... "
|
echo -n "installing keyfile ($KEYTMPFILE) to $KEYFILE... "
|
||||||
|
dd if=/dev/urandom bs=56 count=1 of=$KEYTMPFILE
|
||||||
cp $KEYTMPFILE $KEYFILE
|
cp $KEYTMPFILE $KEYFILE
|
||||||
chgrp $PILERUSER $KEYFILE
|
chgrp $PILERUSER $KEYFILE
|
||||||
chmod 640 $KEYFILE
|
chmod 640 $KEYFILE
|
||||||
rm -f $KEYTMPFILE
|
rm -f $KEYTMPFILE
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
|
||||||
sed -e "s%HOSTNAME%$HOSTNAME%" contrib/webserver/piler-nginx.conf > /etc/nginx/sites-enabled/piler.conf
|
sed -e "s%HOSTNAME%$HOSTNAME%" contrib/webserver/piler-nginx.conf > /usr/local/etc/nginx-piler.conf
|
||||||
|
|
||||||
|
|
||||||
cat <<CONFIGSITE > $DOCROOT/config-site.php
|
cat <<CONFIGSITE > /usr/local/etc/config-site.php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
\$config['SITE_NAME'] = '$HOSTNAME';
|
\$config['SITE_NAME'] = '$HOSTNAME';
|
||||||
|
@ -4,11 +4,7 @@ server {
|
|||||||
|
|
||||||
root /var/www/piler;
|
root /var/www/piler;
|
||||||
|
|
||||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
access_log /var/log/nginx/HOSTNAME-access.log;
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
||||||
|
|
||||||
access_log /var/log/nginx/HOSTNAME-access.log main;
|
|
||||||
error_log /var/log/nginx/HOSTNAME-error.log;
|
error_log /var/log/nginx/HOSTNAME-error.log;
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
@ -32,7 +28,7 @@ server {
|
|||||||
return 404;
|
return 404;
|
||||||
}
|
}
|
||||||
|
|
||||||
fastcgi_pass 127.0.0.1:9000;
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user