Default ASSET_URL to APP_URL - Fixes #284

This commit is contained in:
Bubka 2024-02-19 13:38:38 +01:00
parent 1e3cb32bc2
commit 406f0095ea
4 changed files with 15 additions and 11 deletions

View File

@ -36,10 +36,10 @@ APP_URL=http://localhost
# If you want to serve js assets from a CDN (like https://cdn.example.com),
# you need to set this custom URL here.
# Otherwise, this should be the exact same value as APP_URL.
# uncomment the following line and set this var with the CDN url.
# Otherwise, let this line commented.
ASSET_URL=http://localhost
# ASSET_URL=http://localhost
# The domain subdirectory from which you want to serve 2FAuth.

7
Dockerfile vendored
View File

@ -125,9 +125,10 @@ ENV \
# Webauthn won't work otherwise.
APP_URL=http://localhost \
# If you want to serve js assets from a CDN (like https://cdn.example.com),
# you need to set this custom URL here.
# Otherwise, this should be the exact same value as APP_URL.
ASSET_URL=http://localhost \
# uncomment the following line and set this var with the CDN url.
# Otherwise, let this line commented.
# ASSET_URL=http://localhost \
#
# Turn this to true if you want your app to react like a demo.
# The Demo mode reset the app content every hours and set a generic demo user.
IS_DEMO_APP=false \

View File

@ -3,6 +3,8 @@
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;
$appUrl = env('APP_URL', env('HEROKU_APP_NAME') ? 'https://' . env('HEROKU_APP_NAME') . '.herokuapp.com' : 'http://localhost');
return [
/*
@ -55,9 +57,9 @@
|
*/
'url' => env('APP_URL', env('HEROKU_APP_NAME') ? 'https://' . env('HEROKU_APP_NAME') . '.herokuapp.com' : 'http://localhost'),
'url' => $appUrl,
'asset_url' => env('ASSET_URL', null),
'asset_url' => env('ASSET_URL', $appUrl),
/*
|--------------------------------------------------------------------------

View File

@ -25,9 +25,10 @@ services:
# Webauthn won't work otherwise.
- APP_URL=http://localhost
# If you want to serve js assets from a CDN (like https://cdn.example.com),
# you need to set this custom URL here.
# Otherwise, this should be the exact same value as APP_URL.
- ASSET_URL=http://localhost
# uncomment the following line and set this var with the CDN url.
# Otherwise, let this line commented.
# - ASSET_URL=http://localhost
#
# Turn this to true if you want your app to react like a demo.
# The Demo mode reset the app content every hours and set a generic demo user.
- IS_DEMO_APP=false