Merge pull request #96 from nupplaphil/bug/95-mysql_port_not_set

Fix $MYSQL_PORT default fallback & Removes the packed binary
This commit is contained in:
Hypolite Petovan 2020-01-02 17:25:39 -05:00 committed by GitHub
commit c37e773016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 14 additions and 352 deletions

View File

@ -1,47 +0,0 @@
#!/usr/local/bin/php
<?php
/**
* This script tries to connect to a database for a given interval
* Useful in case of installation e.g. to wait for the database to not generate unnecessary errors
*
* Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}]
*/
$timeout = 60;
switch ($argc) {
case 4:
$timeout = (float)$argv[3];
case 3:
$host = $argv[1];
$port = (int)$argv[2];
break;
default:
fwrite(STDERR, 'Usage: '.$argv[0].' host port [timeout]'."\n");
exit(2);
}
if ($timeout < 0) {
fwrite(STDERR, 'Timeout must be greater than zero'."\n");
exit(2);
}
if ($port < 1) {
fwrite(STDERR, 'Port must be an integer greater than zero'."\n");
exit(2);
}
$socketTimeout = (float)ini_get('default_socket_timeout');
if ($socketTimeout > $timeout) {
$socketTimeout = $timeout;
}
$stopTime = time() + $timeout;
do {
$sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout);
if ($sock !== false) {
fclose($sock);
fwrite(STDOUT, "\n");
exit(0);
}
sleep(1);
fwrite(STDOUT, '.');
} while (time() < $stopTime);
fwrite(STDOUT, "\n");
exit(1);

View File

@ -140,7 +140,6 @@ RUN set -ex; \
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/friendica/config/
COPY bin/* /usr/local/bin/
ENTRYPOINT ["/entrypoint.sh"]
CMD ["apache2-foreground"]

View File

@ -1,47 +0,0 @@
#!/usr/local/bin/php
<?php
/**
* This script tries to connect to a database for a given interval
* Useful in case of installation e.g. to wait for the database to not generate unnecessary errors
*
* Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}]
*/
$timeout = 60;
switch ($argc) {
case 4:
$timeout = (float)$argv[3];
case 3:
$host = $argv[1];
$port = (int)$argv[2];
break;
default:
fwrite(STDERR, 'Usage: '.$argv[0].' host port [timeout]'."\n");
exit(2);
}
if ($timeout < 0) {
fwrite(STDERR, 'Timeout must be greater than zero'."\n");
exit(2);
}
if ($port < 1) {
fwrite(STDERR, 'Port must be an integer greater than zero'."\n");
exit(2);
}
$socketTimeout = (float)ini_get('default_socket_timeout');
if ($socketTimeout > $timeout) {
$socketTimeout = $timeout;
}
$stopTime = time() + $timeout;
do {
$sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout);
if ($sock !== false) {
fclose($sock);
fwrite(STDOUT, "\n");
exit(0);
}
sleep(1);
fwrite(STDOUT, '.');
} while (time() < $stopTime);
fwrite(STDOUT, "\n");
exit(1);

View File

@ -6,7 +6,7 @@ while [ ! -f /var/www/html/bin/daemon.php ]; do
done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
exec php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2

View File

@ -117,7 +117,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ "$install" = true ]; then
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
echo "Starting Friendica installation ..."
run_as "php /var/www/html/bin/console.php autoinstall $install_options"

View File

@ -116,7 +116,6 @@ RUN set -ex; \
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/friendica/config/
COPY bin/* /usr/local/bin/
ENTRYPOINT ["/entrypoint.sh"]
CMD ["php-fpm"]

View File

@ -1,47 +0,0 @@
#!/usr/local/bin/php
<?php
/**
* This script tries to connect to a database for a given interval
* Useful in case of installation e.g. to wait for the database to not generate unnecessary errors
*
* Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}]
*/
$timeout = 60;
switch ($argc) {
case 4:
$timeout = (float)$argv[3];
case 3:
$host = $argv[1];
$port = (int)$argv[2];
break;
default:
fwrite(STDERR, 'Usage: '.$argv[0].' host port [timeout]'."\n");
exit(2);
}
if ($timeout < 0) {
fwrite(STDERR, 'Timeout must be greater than zero'."\n");
exit(2);
}
if ($port < 1) {
fwrite(STDERR, 'Port must be an integer greater than zero'."\n");
exit(2);
}
$socketTimeout = (float)ini_get('default_socket_timeout');
if ($socketTimeout > $timeout) {
$socketTimeout = $timeout;
}
$stopTime = time() + $timeout;
do {
$sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout);
if ($sock !== false) {
fclose($sock);
fwrite(STDOUT, "\n");
exit(0);
}
sleep(1);
fwrite(STDOUT, '.');
} while (time() < $stopTime);
fwrite(STDOUT, "\n");
exit(1);

View File

@ -6,7 +6,7 @@ while [ ! -f /var/www/html/bin/daemon.php ]; do
done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
exec php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2

View File

@ -117,7 +117,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ "$install" = true ]; then
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
echo "Starting Friendica installation ..."
run_as "php /var/www/html/bin/console.php autoinstall $install_options"

View File

@ -131,7 +131,6 @@ RUN set -ex; \
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/friendica/config/
COPY bin/* /usr/local/bin/
ENTRYPOINT ["/entrypoint.sh"]
CMD ["php-fpm"]

View File

@ -1,47 +0,0 @@
#!/usr/local/bin/php
<?php
/**
* This script tries to connect to a database for a given interval
* Useful in case of installation e.g. to wait for the database to not generate unnecessary errors
*
* Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}]
*/
$timeout = 60;
switch ($argc) {
case 4:
$timeout = (float)$argv[3];
case 3:
$host = $argv[1];
$port = (int)$argv[2];
break;
default:
fwrite(STDERR, 'Usage: '.$argv[0].' host port [timeout]'."\n");
exit(2);
}
if ($timeout < 0) {
fwrite(STDERR, 'Timeout must be greater than zero'."\n");
exit(2);
}
if ($port < 1) {
fwrite(STDERR, 'Port must be an integer greater than zero'."\n");
exit(2);
}
$socketTimeout = (float)ini_get('default_socket_timeout');
if ($socketTimeout > $timeout) {
$socketTimeout = $timeout;
}
$stopTime = time() + $timeout;
do {
$sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout);
if ($sock !== false) {
fclose($sock);
fwrite(STDOUT, "\n");
exit(0);
}
sleep(1);
fwrite(STDOUT, '.');
} while (time() < $stopTime);
fwrite(STDOUT, "\n");
exit(1);

View File

@ -6,7 +6,7 @@ while [ ! -f /var/www/html/bin/daemon.php ]; do
done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
exec php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2

View File

@ -117,7 +117,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ "$install" = true ]; then
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
echo "Starting Friendica installation ..."
run_as "php /var/www/html/bin/console.php autoinstall $install_options"

View File

@ -126,7 +126,6 @@ ENV FRIENDICA_ADDONS 2020.03-dev
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/friendica/config/
COPY bin/* /usr/local/bin/
ENTRYPOINT ["/entrypoint-dev.sh"]
CMD ["apache2-foreground"]

View File

@ -1,47 +0,0 @@
#!/usr/local/bin/php
<?php
/**
* This script tries to connect to a database for a given interval
* Useful in case of installation e.g. to wait for the database to not generate unnecessary errors
*
* Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}]
*/
$timeout = 60;
switch ($argc) {
case 4:
$timeout = (float)$argv[3];
case 3:
$host = $argv[1];
$port = (int)$argv[2];
break;
default:
fwrite(STDERR, 'Usage: '.$argv[0].' host port [timeout]'."\n");
exit(2);
}
if ($timeout < 0) {
fwrite(STDERR, 'Timeout must be greater than zero'."\n");
exit(2);
}
if ($port < 1) {
fwrite(STDERR, 'Port must be an integer greater than zero'."\n");
exit(2);
}
$socketTimeout = (float)ini_get('default_socket_timeout');
if ($socketTimeout > $timeout) {
$socketTimeout = $timeout;
}
$stopTime = time() + $timeout;
do {
$sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout);
if ($sock !== false) {
fclose($sock);
fwrite(STDOUT, "\n");
exit(0);
}
sleep(1);
fwrite(STDOUT, '.');
} while (time() < $stopTime);
fwrite(STDOUT, "\n");
exit(1);

View File

@ -6,7 +6,7 @@ while [ ! -f /var/www/html/bin/daemon.php ]; do
done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
exec php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2

View File

@ -117,7 +117,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ "$install" = true ]; then
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
echo "Starting Friendica installation ..."
run_as "php /var/www/html/bin/console.php autoinstall $install_options"

View File

@ -102,7 +102,6 @@ ENV FRIENDICA_ADDONS 2020.03-dev
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/friendica/config/
COPY bin/* /usr/local/bin/
ENTRYPOINT ["/entrypoint-dev.sh"]
CMD ["php-fpm"]

View File

@ -1,47 +0,0 @@
#!/usr/local/bin/php
<?php
/**
* This script tries to connect to a database for a given interval
* Useful in case of installation e.g. to wait for the database to not generate unnecessary errors
*
* Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}]
*/
$timeout = 60;
switch ($argc) {
case 4:
$timeout = (float)$argv[3];
case 3:
$host = $argv[1];
$port = (int)$argv[2];
break;
default:
fwrite(STDERR, 'Usage: '.$argv[0].' host port [timeout]'."\n");
exit(2);
}
if ($timeout < 0) {
fwrite(STDERR, 'Timeout must be greater than zero'."\n");
exit(2);
}
if ($port < 1) {
fwrite(STDERR, 'Port must be an integer greater than zero'."\n");
exit(2);
}
$socketTimeout = (float)ini_get('default_socket_timeout');
if ($socketTimeout > $timeout) {
$socketTimeout = $timeout;
}
$stopTime = time() + $timeout;
do {
$sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout);
if ($sock !== false) {
fclose($sock);
fwrite(STDOUT, "\n");
exit(0);
}
sleep(1);
fwrite(STDOUT, '.');
} while (time() < $stopTime);
fwrite(STDOUT, "\n");
exit(1);

View File

@ -6,7 +6,7 @@ while [ ! -f /var/www/html/bin/daemon.php ]; do
done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
exec php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2

View File

@ -117,7 +117,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ "$install" = true ]; then
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
echo "Starting Friendica installation ..."
run_as "php /var/www/html/bin/console.php autoinstall $install_options"

View File

@ -117,7 +117,6 @@ ENV FRIENDICA_ADDONS 2020.03-dev
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/friendica/config/
COPY bin/* /usr/local/bin/
ENTRYPOINT ["/entrypoint-dev.sh"]
CMD ["php-fpm"]

View File

@ -1,47 +0,0 @@
#!/usr/local/bin/php
<?php
/**
* This script tries to connect to a database for a given interval
* Useful in case of installation e.g. to wait for the database to not generate unnecessary errors
*
* Usage: php bin/wait-for-connection {HOST} {PORT} [{TIMEOUT}]
*/
$timeout = 60;
switch ($argc) {
case 4:
$timeout = (float)$argv[3];
case 3:
$host = $argv[1];
$port = (int)$argv[2];
break;
default:
fwrite(STDERR, 'Usage: '.$argv[0].' host port [timeout]'."\n");
exit(2);
}
if ($timeout < 0) {
fwrite(STDERR, 'Timeout must be greater than zero'."\n");
exit(2);
}
if ($port < 1) {
fwrite(STDERR, 'Port must be an integer greater than zero'."\n");
exit(2);
}
$socketTimeout = (float)ini_get('default_socket_timeout');
if ($socketTimeout > $timeout) {
$socketTimeout = $timeout;
}
$stopTime = time() + $timeout;
do {
$sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout);
if ($sock !== false) {
fclose($sock);
fwrite(STDOUT, "\n");
exit(0);
}
sleep(1);
fwrite(STDOUT, '.');
} while (time() < $stopTime);
fwrite(STDOUT, "\n");
exit(1);

View File

@ -6,7 +6,7 @@ while [ ! -f /var/www/html/bin/daemon.php ]; do
done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
exec php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2

View File

@ -117,7 +117,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ "$install" = true ]; then
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
echo "Starting Friendica installation ..."
run_as "php /var/www/html/bin/console.php autoinstall $install_options"

View File

@ -101,7 +101,6 @@ ENV FRIENDICA_ADDONS %%VERSION%%
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/friendica/config/
COPY bin/* /usr/local/bin/
ENTRYPOINT ["/%%ENTRYPOINT%%"]
CMD ["%%CMD%%"]

View File

@ -116,7 +116,6 @@ ENV FRIENDICA_ADDONS %%VERSION%%
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/friendica/config/
COPY bin/* /usr/local/bin/
ENTRYPOINT ["/%%ENTRYPOINT%%"]
CMD ["%%CMD%%"]

View File

@ -6,7 +6,7 @@ while [ ! -f /var/www/html/bin/daemon.php ]; do
done
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
exec php /var/www/html/bin/daemon.php -f start
else
echo "[ERROR] Waited 300 seconds, no response" >&2

View File

@ -117,7 +117,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then
if [ "$install" = true ]; then
echo "Waiting for MySQL $MYSQL_HOST initialization..."
if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then
if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
echo "Starting Friendica installation ..."
run_as "php /var/www/html/bin/console.php autoinstall $install_options"

View File

@ -135,7 +135,6 @@ function create_variant() {
cp upgrade.exclude "$dir/"
cp -rT .config "$dir/config"
cp -rT .bin "$dir/bin"
travisEnvAmd64='\n - env: VERSION='"$dockerName"' VARIANT='"$variant"' ARCH=amd64'"$travisEnvAmd64"
for arch in i386 amd64; do