Skip to content

Commit

Permalink
Merge pull request #1949 from RotherOSS/issue-#1917-mc
Browse files Browse the repository at this point in the history
Issue #1917 mc
  • Loading branch information
bschmalhofer authored Sep 19, 2022
2 parents 9228e17 + 95d850b commit 5c01a36
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 11 additions & 5 deletions bin/docker/quick_setup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions bin/docker/set_up_minio.sh
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
# --

# 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

0 comments on commit 5c01a36

Please sign in to comment.