Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.48.0 #221

Merged
merged 5 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/CallBackery.pm
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ use CallBackery::Plugin::Doc;
use CallBackery::Database;
use CallBackery::User;

our $VERSION = '0.48.1';

our $VERSION = '0.48.2';

=head2 config

Expand Down
10 changes: 6 additions & 4 deletions lib/CallBackery/Model/ConfigJsonSchema.pm
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,21 @@ $walker = sub ($data, $cb, $path='' ) {

a hash containing the data from the config file. If the environment
variable CM_CB_OVERRIDE_... is set, the value from the config file is
overridden with the value from the environment.
overridden with the value from the environment. All config key characters
outside of [0-9a-zA-Z] are replaced with _. Note that you can only
override settings that exist in the config file, you can not create new settings.

Example config file:

BACKEND:
cfg_db: 'dbi:SQLite:dbname=/opt/running/cb.db'
cfg-db: 'dbi:SQLite:dbname=/opt/running/cb.db'
LIST:
- hello
- world

Example environment override:

export CB_CFG_OVERRIDE_BACKEND_CFG_DB='dbi:SQLite:dbname=/tmp/cb.db'
export CB_CFG_OVERRIDE_BACKEND_cfg_db='dbi:SQLite:dbname=/tmp/cb.db'
export CB_CFG_OVERRIDE_LIST_0='goodbye'

=cut
Expand All @@ -82,7 +84,7 @@ has cfgHash => sub ($self) {
}
my $cfg = $walker->($cfgRaw, sub ($path,$data) {
my $env = 'CB_CFG_OVERRIDE'.$path;
$env =~ s/\//_/g;
$env =~ s/[^0-9a-zA-Z]/_/g;
if (exists $ENV{$env} and my $override = $ENV{$env}) {
$self->log->debug("overriding cfg $path ($data) with ENV \$$env ($override)");
return $override;
Expand Down
Loading