Skip to content

Commit

Permalink
Fixes: Plugin UpdateShell could not be found Fixes: Insecure Bind add…
Browse files Browse the repository at this point in the history
…ress 0.0.0.0 -> Fixed Local IP
  • Loading branch information
b23prodtm committed Apr 25, 2020
1 parent 19ffd50 commit 7e96a71
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
branch = 2.x
[submodule "app/Plugin/UpdateShell"]
path = app/Plugin/UpdateShell
url = https://github.com/mcurry/update.git
url = https://github.com/b23prodtm/update.git
2 changes: 2 additions & 0 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ RUN a2enmod rewrite \

# Install all PHP dependencies
WORKDIR /var/www/html/

RUN git submodule update --init
RUN ./configure.sh --openshift -c -h -p=pass -s=word --development
# RUN [ "cross-build-end" ]
ENTRYPOINT [ "/bin/bash", "-c", "./migrate-database.sh -u -o -i --test-sql-password=${MYSQL_PASSWORD}"]
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ RUN a2enmod rewrite \

# Install all PHP dependencies
WORKDIR /var/www/html/

RUN git submodule update --init
RUN ./configure.sh --openshift -c -h -p=pass -s=word --development
# RUN [ "cross-build-end" ]
ENTRYPOINT [ "/bin/bash", "-c", "./migrate-database.sh -u -o -i --test-sql-password=${MYSQL_PASSWORD}"]
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ RUN a2enmod rewrite \

# Install all PHP dependencies
WORKDIR /var/www/html/

RUN git submodule update --init
RUN ./configure.sh --openshift -c -h -p=pass -s=word --development
# RUN [ "cross-build-end" ]
ENTRYPOINT [ "/bin/bash", "-c", "./migrate-database.sh -u -o -i --test-sql-password=${MYSQL_PASSWORD}"]
Expand Down
2 changes: 1 addition & 1 deletion app/Plugin/UpdateShell
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"extra": {
"installer-paths": {
"app/Plugin/Markdown": ["b23prodtm/markdown-plugin"],
"app/Plugin/DebugKit": ["cakephp/debug_kit"]
"app/Plugin/DebugKit": ["cakephp/debug_kit"],
"app/Plugin/UpdateShell": ["mcurry/update"]
}
},
"config": {
Expand Down
1 change: 1 addition & 0 deletions deployment/images/secondary/Dockerfile.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ARG MYSQL_ROOT_HOST
ENV MYSQL_ROOT_HOST ${MYSQL_ROOT_HOST:-%}
ARG MYSQL_HOST
ENV MYSQL_HOST ${MYSQL_HOST:-127.0.0.1}
ENV TZ ${TZ:-'Europe/Paris'}
# Optional
ARG MYSQL_DATABASE
ENV MYSQL_DATABASE ${MYSQL_DATABASE:-'foo_db'}
Expand Down
8 changes: 7 additions & 1 deletion docker-compose.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
dockerfile: Dockerfile.x86_64
args:
MYSQL_ROOT_HOST: "%"
# bind-address = "127.0.0.1"
MYSQL_HOST: "127.0.0.1"
MYSQL_DATABASE: "foo_db"
MYSQL_ROOT_PASSWORD: "foo_pass"
Expand All @@ -14,6 +15,7 @@ services:
image: betothreeprod/mariadb-intel-nuc
volumes:
- db-data:/config
- db-socket:/var/run/mysqld
restart: unless-stopped
networks:
- cake
Expand All @@ -29,7 +31,8 @@ services:
args:
DEBUG: "1"
MYSQL_ROOT_HOST: "%"
MYSQL_HOST: "127.0.0.1"
# mysql -h "localhost" uses db-socket
MYSQL_HOST: "localhost"
MYSQL_DATABASE: "foo_db"
MYSQL_ROOT_PASSWORD: "foo_pass"
MYSQL_USER: "dummy_foo"
Expand All @@ -40,6 +43,7 @@ services:
io.balena.features.dbus: "1"
volumes:
- data:/var/www/html
- db-socket:/var/run/mysqld
ports:
#Dockerfile's exposed 80 (through apache2), forward 8000 as of CakePHP default port setting
- "80:8000"
Expand All @@ -61,6 +65,8 @@ volumes:
external: false
db-data:
external: false
db-socket:
external: false
networks:
cake:
external: false
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
dockerfile: Dockerfile.template
args:
MYSQL_ROOT_HOST: "%"
# bind-address = "127.0.0.1"
MYSQL_HOST: "127.0.0.1"
MYSQL_DATABASE: "foo_db"
MYSQL_ROOT_PASSWORD: "foo_pass"
Expand All @@ -30,7 +31,8 @@ services:
args:
DEBUG: "1"
MYSQL_ROOT_HOST: "%"
MYSQL_HOST: "127.0.0.1"
# mysql -h "localhost" uses db-socket
MYSQL_HOST: "localhost"
MYSQL_DATABASE: "foo_db"
MYSQL_ROOT_PASSWORD: "foo_pass"
MYSQL_USER: "dummy_foo"
Expand Down
2 changes: 1 addition & 1 deletion migrate-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ grant all PRIVILEGES on ${TEST_DATABASE_NAME}.* to '${MYSQL_USER}'@'${test_mysql
grant all PRIVILEGES on ${TEST_DATABASE_NAME}2.* to '${MYSQL_USER}'@'${test_mysql_host}';
grant all PRIVILEGES on ${TEST_DATABASE_NAME}3.* to '${MYSQL_USER}'@'${test_mysql_host}';
use ${MYSQL_DATABASE};
select * from user where user = '${MYSQL_USER}';
select * from mysql.user where user = '${MYSQL_USER}';
EOF
bash -c "echo \"source ${identities}\" | ${sql_connect} ${sql_connect_test_host} \
${mysql_connect_args} -u ${DATABASE_USER} --password=${MYSQL_ROOT_PASSWORD} \
Expand Down
2 changes: 1 addition & 1 deletion mysqldb/conf.d/my.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ socket = /var/run/mysqld/mysqld.sock

# TCP Socket settings (making 127.0.0.1 work)
port = 3306
#bind-address = 127.0.0.1
bind-address = 127.0.0.1

0 comments on commit 7e96a71

Please sign in to comment.