Skip to content

Commit 56447c9

Browse files
committed
Fix loading forwarding and oauth configs
1 parent 0ce6b89 commit 56447c9

3 files changed

Lines changed: 43 additions & 30 deletions

File tree

config/bootstrap.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,22 @@
9696
Configure::load('app_local', 'default');
9797
}
9898

99+
/*
100+
* Load a local configuration file to provide more configurations.
101+
* Notice: For security reasons forwarding.php **should not** be included in your git repo.
102+
*/
103+
if (file_exists(CONFIG . 'forwarding.php')) {
104+
Configure::load('forwarding', 'default');
105+
}
106+
107+
/*
108+
* Load a local configuration file to provide more configurations.
109+
* Notice: For security reasons oauth.php **should not** be included in your git repo.
110+
*/
111+
if (file_exists(CONFIG . 'oauth.php')) {
112+
Configure::load('oauth', 'default');
113+
}
114+
99115
/*
100116
* When debug = true the metadata cache should only last for a short time.
101117
*/

config/forwarding_example.php

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@
66
* Configures forwarding reports to Sentry
77
*/
88

9-
namespace App\Config;
10-
11-
use Cake\Core\Configure;
12-
13-
Configure::write('Forwarding.Sentry', [
14-
'base_url' => 'https://sentry.domain.tld',// Without the last /
15-
'project_id' => 2,// Settings > Security headers (can be found in the URL: api/{project_id}/security)
16-
'key' => 'xxxxxxxxxxxxxxxxxx',// Settings > Security headers
17-
'secret' => 'xxxxxxxxxxxxxxxxxxxx',// Settings > Client Keys > DSN (deprecated, use password value of the http basic auth)
18-
// Used to send user feedback
19-
'dsn_url' => 'https://[email protected]/{project_id}',// Settings > Client Keys > DSN
20-
]);
21-
22-
// Remove this line or the forwarding will be disabled
23-
Configure::write('Forwarding.Sentry', null);
9+
return [
10+
'Forwarding.Sentry' => [
11+
'base_url' => 'https://sentry.domain.tld',// Without the last /
12+
'project_id' => 2,// Settings > Security headers (can be found in the URL: api/{project_id}/security)
13+
'key' => 'xxxxxxxxxxxxxxxxxx',// Settings > Security headers
14+
'secret' => 'xxxxxxxxxxxxxxxxxxxx',// Settings > Client Keys > DSN (deprecated, use password value of the http basic auth)
15+
// Used to send user feedback
16+
'dsn_url' => 'https://[email protected]/{project_id}',// Settings > Client Keys > DSN
17+
],
18+
];

config/oauth_example.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
/**
36
* Configures github application details for authentication. You can get them
47
* from the application configuration page on github.
58
*/
69

7-
namespace App\Config;
10+
return [
11+
'GithubConfig' => [
12+
'client_id' => '<application-client-id>',
13+
'client_secret' => '<application-client-secret>',
14+
],
815

9-
use Cake\Core\Configure;
16+
/**
17+
* Configures the github repo to check commit access for
18+
*/
19+
'GithubRepoPath' => 'phpmyadmin/phpmyadmin',
1020

11-
Configure::write('GithubConfig', [
12-
'client_id' => '<application-client-id>',
13-
'client_secret' => '<application-client-secret>',
14-
]);
21+
/**
22+
* Access token for syncing Github issue states
23+
*/
24+
'GithubAccessToken' => '<access-token>',
1525

16-
/**
17-
* Configures the github repo to check commit access for
18-
*/
19-
Configure::write('GithubRepoPath', 'phpmyadmin/phpmyadmin');
20-
21-
/**
22-
* Access token for syncing Github issue states
23-
*/
24-
Configure::write('GithubAccessToken', '<access-token>');
26+
];

0 commit comments

Comments
 (0)