moved mysql root password to env

This commit is contained in:
Wolfgang Steuer
2019-11-25 15:02:46 +01:00
parent 432d87faf4
commit 584c43f565
3 changed files with 12 additions and 9 deletions
+1
View File
@@ -1,6 +1,7 @@
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_ROOTPASSWORD= #only needed for install.sh for docker based installation
DB_SOCKET=
DB_USERNAME=
DB_PASSWORD=
+7 -6
View File
@@ -19,11 +19,12 @@ services:
- $PWD/docker/my.cnf:/etc/mysql/conf.d/newsnab-tmux.cnf
- $PWD/docker/mariadb-data:/var/lib/mysql
- $PWD:/var/www/NNTmux/
env_file: .env
environment:
MYSQL_ROOT_PASSWORD: ilmdvV8H
MYSQL_DATABASE: nntmux
MYSQL_USER: nntmux
MYSQL_PASSWORD: Nntmux!
MYSQL_ROOT_PASSWORD: ${DB_ROOTPASSWORD}
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
TZ: ${APP_TZ}
nn-tmux: &nn-tmux
build:
@@ -38,7 +39,7 @@ services:
ports:
- 127.0.0.1:8089:80
environment:
MYSQL_ROOT_PASSWORD: ilmdvV8H
MYSQL_ROOT_PASSWORD: ${DB_ROOTPASSWORD}
TZ: ${APP_TZ}
depends_on:
- mariadb
@@ -50,7 +51,7 @@ services:
stdin_open: true
tty: true
environment:
MYSQL_ROOT_PASSWORD: ilmdvV8H
MYSQL_ROOT_PASSWORD: ${DB_ROOTPASSWORD}
TZ: ${APP_TZ}
COLUMNS: "`tput cols`"
LINES: "`tput lines`"
+4 -3
View File
@@ -1,11 +1,12 @@
#!/bin/bash
mysql --host=$DB_HOST --user=root --password=$MYSQL_ROOT_PASSWORD -e "INSTALL SONAME 'ha_sphinx';"
mysql --host=$DB_HOST --user=root --password=$MYSQL_ROOT_PASSWORD -e "GRANT ALL PRIVILEGES ON *.* TO $DB_USERNAME@'%' WITH GRANT OPTION;"
mysqladmin ping --wait=30 --host=$DB_HOST --port=$DB_PORT --user=root --password=$DB_ROOTPASSWORD
mysql --host=$DB_HOST --user=root --password=$DB_ROOTPASSWORD -e "INSTALL SONAME 'ha_sphinx';"
mysql --host=$DB_HOST --user=root --password=$DB_ROOTPASSWORD -e "GRANT ALL PRIVILEGES ON *.* TO $DB_USERNAME@'%' WITH GRANT OPTION;"
sudo -E -u www-data php artisan nntmux:install
sudo -E -u www-data php /var/www/NNTmux/misc/sphinxsearch/create_se_tables.php $SPHINX_HOST 9312
sudo -E -u www-data php /var/www/NNTmux/misc/sphinxsearch/populate_rt_indexes.php releases_rt
sudo -E -u www-data php /var/www/NNTmux/misc/sphinxsearch/populate_rt_indexes.php predb_rt
read -p "Do you want to batch import predb now (this will take an hour or two)? (y/n)" yn
read -p "Do you want to batch import predb now (this will take an hour or two)? (y/n): " yn
case $yn in
[Yy]* ) sudo -E -u notroot php /var/www/NNTmux/cli/data/predb_import_daily_batch.php 0 remote false
esac