Compare commits
2 Commits
v2026.2.1-
...
v2026.2.1-
| Author | SHA1 | Date | |
|---|---|---|---|
| eb345e17ca | |||
| c2693c4648 |
@@ -9,10 +9,11 @@ APP_NAME=mineseeker
|
|||||||
# APP_PUBLIC_HOSTNAME: The public hostname for your application (used for generating absolute URLs in emails)
|
# APP_PUBLIC_HOSTNAME: The public hostname for your application (used for generating absolute URLs in emails)
|
||||||
# For production, set this to your domain (e.g., mineseeker.com)
|
# For production, set this to your domain (e.g., mineseeker.com)
|
||||||
APP_PUBLIC_HOSTNAME=localhost
|
APP_PUBLIC_HOSTNAME=localhost
|
||||||
# TRUSTED_PROXIES: IPs/CIDRs of trusted reverse proxies (needed for correct URL scheme detection in emails)
|
# TRUSTED_PROXIES: Only needed for bare-metal dev behind a reverse proxy
|
||||||
# For Docker development, this is overridden in compose.override.yaml to "0.0.0.0/0"
|
# For Docker development, this is set in compose.override.yaml
|
||||||
# For production, set to your proxy's IP or Docker network CIDR (e.g., 172.18.0.0/16)
|
# For production, set in PROD_ENV_FILE Gitea secret (use 172.18.0.0/16 initially)
|
||||||
TRUSTED_PROXIES=127.0.0.1
|
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
|
||||||
|
#TRUSTED_HOSTS=localhost,example.com
|
||||||
###< symfony/framework-bundle ###
|
###< symfony/framework-bundle ###
|
||||||
|
|
||||||
###> doctrine/doctrine-bundle ###
|
###> doctrine/doctrine-bundle ###
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ framework:
|
|||||||
|
|
||||||
# Trust headers from reverse proxy (Caddy)
|
# Trust headers from reverse proxy (Caddy)
|
||||||
# This ensures absolute_url() uses HTTPS scheme when behind a reverse proxy
|
# This ensures absolute_url() uses HTTPS scheme when behind a reverse proxy
|
||||||
|
# Production: TRUSTED_PROXIES from .env (Gitea secret)
|
||||||
|
# Development: TRUSTED_PROXIES from compose.override.yaml
|
||||||
trusted_proxies: '%env(TRUSTED_PROXIES)%'
|
trusted_proxies: '%env(TRUSTED_PROXIES)%'
|
||||||
trusted_headers: ['x-forwarded-for', 'x-forwarded-proto', 'x-forwarded-host', 'x-forwarded-port']
|
trusted_headers: ['x-forwarded-for', 'x-forwarded-proto', 'x-forwarded-host', 'x-forwarded-port']
|
||||||
|
|
||||||
|
|||||||
8
config/packages/prod/framework.yaml
Normal file
8
config/packages/prod/framework.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
framework:
|
||||||
|
# In production with FrankenPHP, the reverse proxy (Caddy) is in the same container
|
||||||
|
# Requests come from 127.0.0.1, so we must trust that IP to process X-Forwarded-Proto headers
|
||||||
|
# TRUSTED_PROXIES is set in the .env file (stored in Gitea secrets)
|
||||||
|
# Typical value for Docker: 172.18.0.0/16 (or the specific Docker network CIDR)
|
||||||
|
# This must be provided by the PROD_ENV_FILE secret in Gitea
|
||||||
|
trusted_proxies: '%env(TRUSTED_PROXIES)%'
|
||||||
|
trusted_headers: ['x-forwarded-for', 'x-forwarded-proto', 'x-forwarded-host', 'x-forwarded-port']
|
||||||
@@ -92,6 +92,11 @@ class SecurityController extends AbstractController
|
|||||||
UrlGeneratorInterface::ABSOLUTE_URL,
|
UrlGeneratorInterface::ABSOLUTE_URL,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Ensure HTTPS scheme in production
|
||||||
|
if ($this->getParameter('kernel.environment') === 'prod') {
|
||||||
|
$activationUrl = str_replace('http://', 'https://', $activationUrl);
|
||||||
|
}
|
||||||
|
|
||||||
$mailer->send(
|
$mailer->send(
|
||||||
new TemplatedEmail()
|
new TemplatedEmail()
|
||||||
->from('noreply@mineseeker.hu')
|
->from('noreply@mineseeker.hu')
|
||||||
@@ -143,6 +148,11 @@ class SecurityController extends AbstractController
|
|||||||
UrlGeneratorInterface::ABSOLUTE_URL,
|
UrlGeneratorInterface::ABSOLUTE_URL,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Ensure HTTPS scheme in production
|
||||||
|
if ($this->getParameter('kernel.environment') === 'prod') {
|
||||||
|
$resetUrl = str_replace('http://', 'https://', $resetUrl);
|
||||||
|
}
|
||||||
|
|
||||||
$mailer->send(
|
$mailer->send(
|
||||||
new TemplatedEmail()
|
new TemplatedEmail()
|
||||||
->from('noreply@mineseeker.hu')
|
->from('noreply@mineseeker.hu')
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<img src="{{ absolute_url(asset('images/mine-logo-txt.png')) }}" alt="MineSeeker"/>
|
<img src="{{ absolute_url(asset('images/mine-logo-txt.png')) | replace({'http://': 'https://'}) }}" alt="MineSeeker"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h1>One step to go</h1>
|
<h1>One step to go</h1>
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<img src="{{ absolute_url(asset('images/mine-logo-txt.png')) }}" alt="MineSeeker"/>
|
<img src="{{ absolute_url(asset('images/mine-logo-txt.png')) | replace({'http://': 'https://'}) }}" alt="MineSeeker"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h1>Reset your password</h1>
|
<h1>Reset your password</h1>
|
||||||
|
|||||||
Reference in New Issue
Block a user