diff --git a/.dockerignore b/.dockerignore index e9587b884a..6f23f589ba 100644 --- a/.dockerignore +++ b/.dockerignore @@ -56,6 +56,7 @@ var/tmp/ # ignore files that are only needed only for building the docker image bin/docker/build_docker_images.sh bin/docker/lint_docker_files.sh +bin/docker/set_up_minio.sh bin/devel # ignore Config files that might have been added during development and testing diff --git a/bin/docker/quick_setup.pl b/bin/docker/quick_setup.pl index 62659b9ea1..8fccb8944a 100755 --- a/bin/docker/quick_setup.pl +++ b/bin/docker/quick_setup.pl @@ -31,16 +31,22 @@ =head1 SYNOPSIS bin/docker/quick_setup.pl --db-password 'some-pass' --http-port 81 # also activate Elasticsearch - bin/docker/quick_setup.pl --db-password 'some-pass' --http-port 81 --activate-elasticsearch + bin/docker/quick_setup.pl --db-password 'some-pass' --activate-elasticsearch -It's convenient the call this script via an alias. + # create an initial customer user + bin/docker/quick_setup.pl --db-password 'some-pass' --add-customer-user - alias otobo_docker_quick_setup='docker exec -t otobo_web_1 bash -c "date ; hostname ; rm -f Kernel/Config/Files/ZZZAAuto.pm ; bin/docker/quick_setup.pl --db-password otobo_root --http-port 81 --activate-elasticsearch"' + # add a calendar + bin/docker/quick_setup.pl --db-password 'some-pass' --add-calendar + +It might be convenient the call this script via an alias. + + alias otobo_docker_quick_setup='docker exec -t otobo_web_1 bash -c "date ; hostname ; rm -f Kernel/Config/Files/ZZZAAuto.pm ; bin/docker/quick_setup.pl --db-password otobo_root --http-port 81 --activate-elasticsearch --add-customer-user --add-calendar"' =head1 DESCRIPTION -Quickly creating a running system is useful for development and for continous integration. But please note that this scripts -is not meant as an replacement for the OTOBO installer. +Quickly create a running system that is useful for development and for continous integration. +But please note that this script is not meant as an replacement for the OTOBO installer. =head1 OPTIONS diff --git a/bin/docker/set_up_minio.sh b/bin/docker/set_up_minio.sh new file mode 100755 index 0000000000..d53c9a6b98 --- /dev/null +++ b/bin/docker/set_up_minio.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# -- +# OTOBO is a web-based ticketing system for service organisations. +# -- +# Copyright (C) 2019-2022 Rother OSS GmbH, https://otobo.de/ +# -- +# This program is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later version. +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# -- + +# Set up MinIO starting from a virgin state. It is expected that the executable mc is +# in the path and that the MinIO alias otobo_minio is set up. + +# settings +config_file=$( dirname -- "${BASH_SOURCE[0]}" )/../../Kernel/Config.pm.docker.dist +alias=otobo_minio + +# sanity check +which mc + +# create user with readwrite privileges +user=$(sed -n -e "s/.*'Storage::S3::AccessKey'.*'\(.*\)'.*/\1/p" $config_file) +password=$(sed -n -e "s/.*'Storage::S3::SecretKey'.*'\(.*\)'.*/\1/p" $config_file) +mc admin user add $alias $user $password +mc admin policy set $alias readwrite user=$user + +# create a bucket +bucket=$(sed -n -e "s/.*'Storage::S3::Bucket'.*'\(.*\)'.*/\1/p" $config_file) +mc mb $alias/$bucket