8 Commits

5 changed files with 34 additions and 10 deletions

View File

@@ -31,7 +31,7 @@ DB_DATABASE=captcha
DB_USERNAME=captcha
DB_PASSWORD=captcha_pass
BROADCAST_DRIVER=log
BROADCAST_DRIVER=reverb
CACHE_DRIVER=redis
FILESYSTEM_DISK=local
QUEUE_CONNECTION=redis

View File

@@ -29,13 +29,21 @@ final class CreatedCaptchaLog implements ShouldBroadcast
$link = route('captcha-tokens.edit', ['captcha_token' => $captchaLog->captcha->captcha_token_id], false);
$title = $captchaLog->captcha->captchaToken->title;
}
$ip = $captchaLog->ip;
$userAgent = $captchaLog->user_agent;
if (Helpers::isDemoMode()) {
$ip = __('Demo Mode');
$userAgent = __('Demo Mode');
}
$this->captchaLog = [
'created_at' => $captchaLog->created_at->format("d.m.Y H:i:s"),
'link' => $link,
'title' => $title,
'type' => $captchaLog->type->getTitle(),
'ip' => $captchaLog->ip,
'user_agent' => $captchaLog->user_agent,
'ip' => $ip,
'user_agent' => $userAgent,
'referer' => $captchaLog->referer,
];
}

View File

@@ -25,8 +25,20 @@
<p><strong>{{ $item->type->getTitle() }}</strong></p>
</td>
<td>
<p><strong>IP:</strong> {{ $item->ip }}</p>
<p><strong>User Agent:</strong> {{ $item->user_agent }}</p>
<p><strong>IP:</strong>
@demo
<span style="border: 1px solid #ff1810; color: #ff1810; font-weight: bold; font-size: 18px; padding: 7px; text-align: center;">{{ __('Demo Mode') }}</span>
@else
{{ $item->ip }}
@endif
</p>
<p><strong>User Agent:</strong>
@demo
<span style="border: 1px solid #ff1810; color: #ff1810; font-weight: bold; font-size: 18px; padding: 7px; text-align: center;">{{ __('Demo Mode') }}</span>
@else
{{ $item->user_agent }}
@endif
</p>
<p><strong>referer:</strong> {{ $item->referer }}</p>
</td>
</tr>

View File

@@ -5,6 +5,7 @@ set -euo pipefail
WAITLOOPS=5
SLEEPSEC=1
unitd="unitd"
role=${CONTAINER_ROLE:-app}
curl_put()
{
@@ -22,7 +23,7 @@ curl_put()
return 0
}
if [ "$unitd" = "unitd" ] || [ "$unitd" = "unitd-debug" ]; then
if [ "$role" = "app" ]; then
echo "$0: Launching Unit daemon to perform initial configuration..."
/usr/sbin/$unitd --control unix:/var/run/control.unit.sock
for i in $(/usr/bin/seq $WAITLOOPS); do
@@ -61,7 +62,7 @@ if [ "$unitd" = "unitd" ] || [ "$unitd" = "unitd-debug" ]; then
if [ ! -z ${UNIT_SOURCE+x} ]
then
echo "[${UNIT_SOURCE}]" > /docker-entrypoint.d/unit_source.json
echo $UNIT_SOURCE > /docker-entrypoint.d/unit_source.json
curl_put "/docker-entrypoint.d/unit_source.json" "config/listeners/*:9000/forwarded/source"
fi

View File

@@ -5,6 +5,7 @@ set -euo pipefail
WAITLOOPS=5
SLEEPSEC=1
unitd="unitd"
role=${CONTAINER_ROLE:-app}
curl_put()
{
@@ -22,7 +23,7 @@ curl_put()
return 0
}
if [ "$unitd" = "unitd" ] || [ "$unitd" = "unitd-debug" ]; then
if [ "$role" = "app" ]; then
echo "$0: Launching Unit daemon to perform initial configuration..."
/usr/sbin/$unitd --control unix:/var/run/control.unit.sock
for i in $(/usr/bin/seq $WAITLOOPS); do
@@ -61,7 +62,7 @@ if [ "$unitd" = "unitd" ] || [ "$unitd" = "unitd-debug" ]; then
if [ ! -z ${UNIT_SOURCE+x} ]
then
echo "[${UNIT_SOURCE}]" > /docker-entrypoint.d/unit_source.json
echo $UNIT_SOURCE > /docker-entrypoint.d/unit_source.json
curl_put "/docker-entrypoint.d/unit_source.json" "config/listeners/*:9000/forwarded/source"
fi
@@ -102,7 +103,9 @@ php artisan config:cache
php artisan event:cache
php artisan route:cache
php artisan view:cache
php artisan migrate --force
if [ "$role" = "app" ]; then
php artisan migrate --force
fi
chown -R unit:unit /var/www/html
chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache