Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Castopod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ad Aures
Castopod
Commits
7d1460b8
Commit
7d1460b8
authored
6 months ago
by
Yassine Doghri
Browse files
Options
Downloads
Patches
Plain Diff
fix: allow passing json to app.proxyIPs config to set it
parent
a2af32ab
No related branches found
No related tags found
No related merge requests found
Pipeline
#18857
passed
6 months ago
Stage: prepare
Stage: quality
Stage: release
Stage: deploy
Stage: build
Pipeline: Castopod
#18862
Pipeline: castopod.org
#18861
Pipeline: Castopod
#18860
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/Config/App.php
+34
-2
34 additions, 2 deletions
app/Config/App.php
with
34 additions
and
2 deletions
app/Config/App.php
+
34
−
2
View file @
7d1460b8
...
...
@@ -192,9 +192,9 @@ class App extends BaseConfig
* '192.168.5.0/24' => 'X-Real-IP',
* ]
*
* @var array<string, string>
* @var array<string, string>
|string
*/
public
array
$proxyIPs
=
[];
public
$proxyIPs
=
[];
/**
* --------------------------------------------------------------------------
...
...
@@ -249,4 +249,36 @@ class App extends BaseConfig
public
?int
$bandwidthLimit
=
null
;
public
?string
$legalNoticeURL
=
null
;
/**
* AuthToken Config Constructor
*/
public
function
__construct
()
{
parent
::
__construct
();
if
(
is_string
(
$this
->
proxyIPs
))
{
$array
=
json_decode
(
$this
->
proxyIPs
,
true
);
if
(
is_array
(
$array
))
{
$this
->
proxyIPs
=
$array
;
}
}
}
/**
* Override parent initEnvValue() to allow for direct setting to array properties values from ENV
*
* In order to set array properties via ENV vars we need to set the property to a string value first.
*
* @param mixed $property
*/
protected
function
initEnvValue
(
&
$property
,
string
$name
,
string
$prefix
,
string
$shortPrefix
)
:
void
{
// if attempting to set property from ENV, first set to empty string
if
(
$name
===
'proxyIPs'
&&
$this
->
getEnvValue
(
$name
,
$prefix
,
$shortPrefix
)
!==
null
)
{
$property
=
''
;
}
parent
::
initEnvValue
(
$property
,
$name
,
$prefix
,
$shortPrefix
);
}
}
This diff is collapsed.
Click to expand it.
semantic-release
@project_2_bot_32962a2c5cc3c849d9c86ab486de37b4
mentioned in commit
696250f0
·
6 months ago
mentioned in commit
696250f0
mentioned in commit 696250f041202974a4fd49aabcec5465b9def039
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment