Skip to content

Commit

Permalink
Issue #1672: minimize the differences
Browse files Browse the repository at this point in the history
between Config.pm.docker.dist and Config.pm.dist
  • Loading branch information
bschmalhofer committed Feb 11, 2023
1 parent 56f9909 commit bca4c0b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 46 deletions.
53 changes: 7 additions & 46 deletions Kernel/Config.pm.docker.dist
Original file line number Diff line number Diff line change
Expand Up @@ -125,54 +125,15 @@ sub Load {
$Self->{Home} = '/opt/otobo';

# ---------------------------------------------------- #
# setting for running OTOBO under Docker, see the POD #
# default settings for OTOBO with an S3 backend #
# deativated per default #
# ---------------------------------------------------- #
#$Self->LoadS3Defaults;

# These settings are for the S3 backend.
if ( 0 ) {
#if ( 1 ) {
$Self->{'Storage::S3::Active'} = 1;
$Self->{'Storage::S3::Region'} = 'eu-central-1';
$Self->{'Storage::S3::Bucket'} = 'otobo-bucket-20220907a';
$Self->{'Storage::S3::HomePrefix'} = 'OTOBO';
$Self->{'Storage::S3::AccessKey'} = 'minio-otobo';
$Self->{'Storage::S3::SecretKey'} = 'minio-otobo'; # more than 8 chars
$Self->{'Storage::S3::MetadataPrefix'} = 'x-amz-meta-';
$Self->{'Storage::S3::Delimiter'} = '/'; # do not change this, as OTOBO relies on the delimiter being '/'

# Some settings are specific for localstack and MinIO.
if ( 1 ) {

# MinIO
$Self->{'Storage::S3::Scheme'} = 'http';
$Self->{'Storage::S3::Host'} = 'minio:9000';
$Self->{'Storage::S3::DeleteMultipleObjectIsSupported'} = 0;
}
else {

# localstack
$Self->{'Storage::S3::Scheme'} = 'https';
$Self->{'Storage::S3::Host'} = 'localstack:4566';
$Self->{'Storage::S3::DeleteMultipleObjectIsSupported'} = 1;
}
}

$Self->{'LogModule'} = 'Kernel::System::Log::File';
$Self->{'LogModule::LogFile'} = '/opt/otobo/var/log/otobo.log';
$Self->{'Cache::Module'} = 'Kernel::System::Cache::Redis';
$Self->{'Cache::Redis'}->{'RedisFast'} = 1;
$Self->{'Cache::Redis'}->{'Server'} = 'redis:6379';
$Self->{'Cache::Redis'}->{'Server'} = 'redis:6379';
$Self->{'TestHTTPHostname'} = 'web:5000';

# activate Selenium tests if the the host is available
$Self->{'SeleniumTestsConfig'} = {
remote_server_addr => 'selenium-chrome',
check_server_addr => 1, # skip test when remote_server_addr can't be resolved via DNS
port => '4444',
browser_name => 'chrome',
platform => 'ANY',
};
# ---------------------------------------------------- #
# settings for running OTOBO under Docker #
# ---------------------------------------------------- #
$Self->LoadDockerSpecificDefaults;

# ---------------------------------------------------- #
# insert your own config settings "here" #
Expand Down
49 changes: 49 additions & 0 deletions Kernel/Config/Defaults.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2544,4 +2544,53 @@ sub SyncWithS3 {
return 1;
}

# Activate S3 and provide settings for the most common case
sub LoadS3Defaults {
my ($Self) = @_;

$Self->{'Storage::S3::Active'} = 1;
$Self->{'Storage::S3::Region'} = 'eu-central-1';
$Self->{'Storage::S3::Bucket'} = 'otobo-bucket-20230211a'; # random name
$Self->{'Storage::S3::HomePrefix'} = 'OTOBO';
$Self->{'Storage::S3::AccessKey'} = 'minio-otobo';
$Self->{'Storage::S3::SecretKey'} = 'minio-otobo'; # more than 8 chars
$Self->{'Storage::S3::MetadataPrefix'} = 'x-amz-meta-';
$Self->{'Storage::S3::Delimiter'} = '/'; # do not change this, as OTOBO relies on the delimiter being '/'
$Self->{'Storage::S3::Scheme'} = 'http';
$Self->{'Storage::S3::Host'} = 'minio:9000';
$Self->{'Storage::S3::DeleteMultipleObjectIsSupported'} = 0;

# The default S3 setting can be overriden in _Kernel/Config.pm_.
# An example is using localstack as the S3 compatible backend
#$Self->{'Storage::S3::Scheme'} = 'https';
#$Self->{'Storage::S3::Host'} = 'localstack:4566';
#$Self->{'Storage::S3::DeleteMultipleObjectIsSupported'} = 1;

return;
}

# Settings that are set for OTOBO running under Docker
sub LoadDockerSpecificDefaults {
my ($Self) = @_;

$Self->{'LogModule'} = 'Kernel::System::Log::File';
$Self->{'LogModule::LogFile'} = '/opt/otobo/var/log/otobo.log';
$Self->{'Cache::Module'} = 'Kernel::System::Cache::Redis';
$Self->{'Cache::Redis'}->{'RedisFast'} = 1;
$Self->{'Cache::Redis'}->{'Server'} = 'redis:6379';
$Self->{'Cache::Redis'}->{'Server'} = 'redis:6379';
$Self->{'TestHTTPHostname'} = 'web:5000';

# activate Selenium tests if the the host is available
$Self->{'SeleniumTestsConfig'} = {
remote_server_addr => 'selenium-chrome',
check_server_addr => 1, # skip test when remote_server_addr can't be resolved via DNS
port => '4444',
browser_name => 'chrome',
platform => 'ANY',
};

return;
}

1;

0 comments on commit bca4c0b

Please sign in to comment.