├── .github └── ISSUE_TEMPLATE │ ├── config.yml │ ├── question.yml │ ├── feature_request.yml │ └── bug_report.yml ├── migrator ├── volumes ├── web_gui │ └── nginx │ │ ├── certs │ │ └── README │ │ └── htpasswd │ │ └── README.md ├── core │ └── config │ │ └── oracle │ │ ├── wallet │ │ └── README │ │ └── network │ │ └── admin │ │ ├── templates │ │ ├── sqlnet.ora │ │ └── tnsnames.ora │ │ └── README └── core_db │ └── initdb.sh ├── src ├── commands.down.sh ├── commands.logs.sh ├── commands.configure.sh ├── runtime.sh ├── images.load.sh ├── util.sh ├── images.pull.sh ├── commands.upgrade.sh ├── console.sh ├── commands.configure.edition.sh ├── runtime.docker.sh ├── constants.sh ├── commands.upgrade.online.sh ├── tls.sh ├── patches.sh ├── commands.configure.tls.sh ├── runtime.podman.sh ├── commands.upgrade.offline.sh ├── _index.sh ├── commands.help.sh ├── commands.up.sh ├── env.sh └── commands.install.sh ├── helm ├── enterprise-edition │ ├── templates │ │ ├── secrets.yaml │ │ ├── svc.yaml │ │ ├── pvc.yaml │ │ ├── app.yaml │ │ └── configmaps.yaml │ ├── Chart.yaml │ ├── .helmignore │ ├── values.yaml │ └── README-Wallet-Setup.md └── professional-edition │ ├── templates │ ├── secrets.yaml │ ├── svc.yaml │ ├── pvc.yaml │ ├── app.yaml │ └── configmaps.yaml │ ├── Chart.yaml │ ├── .helmignore │ ├── values.yaml │ └── README-Wallet-Setup.md ├── .gitignore ├── docker-compose.yml ├── README.md └── docs └── pictures └── migrator-logo.svg /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /migrator: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | ./src/_index.sh "$@" 7 | -------------------------------------------------------------------------------- /volumes/web_gui/nginx/certs/README: -------------------------------------------------------------------------------- 1 | This is the directory for NGINX to look for the certificate files. The provided 2 | configuration expects to find following files: 3 | - nginx.crt: certificate 4 | - nginx.key: certificate private key 5 | -------------------------------------------------------------------------------- /src/commands.down.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./runtime.sh 7 | 8 | command_down() { 9 | runtime_down 10 | } 11 | -------------------------------------------------------------------------------- /src/commands.logs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./runtime.sh 7 | 8 | command_logs() { 9 | runtime_logs "$1" 10 | } 11 | -------------------------------------------------------------------------------- /volumes/core/config/oracle/wallet/README: -------------------------------------------------------------------------------- 1 | Copy the files for the Oracle wallet store (client) into this directory. 2 | 3 | Since the Migrator core acts as client to the database servers the wallet store 4 | contains the certificates to connect to the database servers via TLS (TCPS 5 | protocol). 6 | -------------------------------------------------------------------------------- /helm/enterprise-edition/templates/secrets.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: migrator.postgres.core.db 5 | namespace: {{ .Release.Namespace }} 6 | data: 7 | username: {{ .Values.migrator.db.init.username }} 8 | password: {{ .Values.migrator.db.init.password }} 9 | 10 | -------------------------------------------------------------------------------- /helm/professional-edition/templates/secrets.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: migrator.postgres.core.db 5 | namespace: {{ .Release.Namespace }} 6 | data: 7 | username: {{ .Values.migrator.db.init.username }} 8 | password: {{ .Values.migrator.db.init.password }} 9 | 10 | -------------------------------------------------------------------------------- /helm/enterprise-edition/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: cybertec-migrator 3 | description: A Helm chart for Kubernetes/Openshift to install the sophisticated cybertec-migrator 4 | 5 | type: application 6 | icon: "https://www.cybertec-postgresql.com/wp-content/uploads/2018/03/Migrator_neu-1024x270.png" 7 | version: 1.0.3 8 | appVersion: "3.19.0" 9 | -------------------------------------------------------------------------------- /helm/professional-edition/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: cybertec-migrator 3 | description: A Helm chart for Kubernetes/Openshift to install the sophisticated cybertec-migrator 4 | 5 | type: application 6 | icon: "https://www.cybertec-postgresql.com/wp-content/uploads/2018/03/Migrator_neu-1024x270.png" 7 | version: 1.0.3 8 | appVersion: "3.19.0" 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | .meta-inf 3 | .edition 4 | .version 5 | .idea 6 | images/ 7 | volumes/core/config/oracle/network/admin/*.ora 8 | volumes/core/config/oracle/network/admin/tnsnames.ora 9 | volumes/core/config/oracle/wallet/*.lck 10 | volumes/core/config/oracle/wallet/*.p12 11 | volumes/core/config/oracle/wallet/*.sso 12 | volumes/web_gui/nginx/certs/nginx.* 13 | volumes/web_gui/nginx/htpasswd/.htpasswd 14 | -------------------------------------------------------------------------------- /volumes/core/config/oracle/network/admin/templates/sqlnet.ora: -------------------------------------------------------------------------------- 1 | NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) 2 | 3 | # Don't forget to adjust the 'volumes' configuration in the docker-compose.yml in 4 | # case you change the location of the wallet. 5 | 6 | WALLET_LOCATION = 7 | (SOURCE = 8 | (METHOD = FILE) 9 | (METHOD_DATA = 10 | (DIRECTORY = /app/config/oracle/wallet) 11 | ) 12 | ) 13 | -------------------------------------------------------------------------------- /helm/enterprise-edition/templates/svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cybertec-migrator 5 | labels: 6 | app: cybertec-migrator-app 7 | namespace: {{ .Release.Namespace }} 8 | spec: 9 | ports: 10 | - name: https 11 | port: 8080 12 | protocol: TCP 13 | targetPort: 8080 14 | selector: 15 | app: {{ .Release.Name }}-app 16 | type: {{ .Values.migrator.ui.serviceType }} 17 | -------------------------------------------------------------------------------- /helm/professional-edition/templates/svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cybertec-migrator 5 | labels: 6 | app: cybertec-migrator-app 7 | namespace: {{ .Release.Namespace }} 8 | spec: 9 | ports: 10 | - name: https 11 | port: 8080 12 | protocol: TCP 13 | targetPort: 8080 14 | selector: 15 | app: {{ .Release.Name }}-app 16 | type: {{ .Values.migrator.ui.serviceType }} 17 | -------------------------------------------------------------------------------- /volumes/core_db/initdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022 CYBERTEC PostgreSQL International GmbH 5 | 6 | set -e 7 | 8 | DATABASE="migrator" 9 | SCHEMA="cybertec_migrator" 10 | 11 | psql -v ON_ERROR_STOP=1 <<-EOF 12 | CREATE DATABASE ${DATABASE}; 13 | EOF 14 | 15 | psql -v ON_ERROR_STOP=1 --dbname "${DATABASE}" <<-EOF 16 | CREATE SCHEMA ${SCHEMA}; 17 | EOF 18 | -------------------------------------------------------------------------------- /helm/enterprise-edition/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /helm/professional-edition/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /volumes/core/config/oracle/network/admin/README: -------------------------------------------------------------------------------- 1 | ============================================================================ 2 | This is the default directory for Oracle Network and Oracle Client 3 | configuration files. You can place files such as tnsnames.ora, sqlnet.ora 4 | in this directory. 5 | NOTE: 6 | The content of this directory has to be provided to the Migrator 'core' with 7 | the help of the environment variable TNS_ADMIN. 8 | ============================================================================ 9 | -------------------------------------------------------------------------------- /src/commands.configure.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./commands.configure.edition.sh 7 | source ./commands.configure.tls.sh 8 | source ./console.sh 9 | 10 | command_configure() { 11 | case "${2}" in 12 | --edition) 13 | command_configure_edition "${3}" 14 | ;; 15 | --tls) 16 | command_configure_tls "${3}" 17 | ;; 18 | *) 19 | error "Unexpected usage" 20 | esac 21 | } 22 | -------------------------------------------------------------------------------- /volumes/core/config/oracle/network/admin/templates/tnsnames.ora: -------------------------------------------------------------------------------- 1 | # Template file to define TNS names using TCPS (secure data transfer using TLS) 2 | # Check sqlnet.ora for the location of the wallet file. 3 | 4 | # Identifiers enclosed with ## have to adjusted to your needs. 5 | 6 | # ##net_service_name## = 7 | # (DESCRIPTION = 8 | # (ADDRESS = (PROTOCOL = TCPS)(HOST = ##host_name_or_ip_address##)(PORT = 2484)) 9 | # (CONNECT_DATA = 10 | # (SERVER = DEDICATED) 11 | # (SERVICE_NAME = ##service_name##) 12 | # ) 13 | # ) 14 | -------------------------------------------------------------------------------- /src/runtime.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./env.sh 7 | source ./console.sh 8 | 9 | if env_file_exists; then 10 | v3_20_0_add_arch_and_container_runtime 11 | case "$(print_env 'CONTAINER_RUNTIME')" in 12 | docker) source ./runtime.docker.sh ;; 13 | podman) source ./runtime.podman.sh ;; 14 | *) error "$(print_env 'CONTAINER_RUNTIME') container runtime is not supported" ;; 15 | esac 16 | fi 17 | -------------------------------------------------------------------------------- /src/images.load.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./constants.sh 7 | source ./runtime.sh 8 | 9 | load_images_from_path() { 10 | local path="${1}" 11 | 12 | info 'Loading container images' 13 | 14 | [ -d "${path}" ] || error "Archive file corrupted - '${path}' directory with container images missing" 15 | 16 | for image in ${path}/*.tar; do 17 | runtime_load "${image}" > /dev/null 18 | done 19 | } 20 | -------------------------------------------------------------------------------- /src/util.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./constants.sh 7 | 8 | generate_random() { 9 | local PASSWORD_CHARSET="$1" 10 | local PASSWORD_LENGTH=$2 11 | LC_ALL=C tr -dc "${PASSWORD_CHARSET}" 5 | 6 | source ./constants.sh 7 | source ./runtime.sh 8 | 9 | pull_images() { 10 | local edition="$(print_env 'EDITION')" 11 | local version="$(print_env 'VERSION')" 12 | 13 | info "Pulling container images for $(highlight "${edition}:${version}")" 14 | 15 | if pull_error=$(runtime_pull); then 16 | return 17 | else 18 | error "Failed to pull container images\n${pull_error}" 19 | fi 20 | } 21 | -------------------------------------------------------------------------------- /volumes/web_gui/nginx/htpasswd/README.md: -------------------------------------------------------------------------------- 1 | # Basic Authentication 2 | 3 | To enable HTTP Basic Auth, create a new file `.htpasswd`: 4 | 5 | ```shell 6 | touch .htpasswd 7 | ``` 8 | 9 | To add a new user, start by adding a username (replace the example with your own username): 10 | ```shell 11 | sh -c "echo -n 'john-doe:' >> ./.htpasswd" 12 | ``` 13 | 14 | Finish the process by generating a password: 15 | ```shell 16 | sh -c "openssl passwd -apr1 >> ./.htpasswd" 17 | ``` 18 | 19 | Restart the migrator for the new users to come into effect: 20 | ```shell 21 | # Within the repository root 22 | ./migrator up 23 | ``` 24 | -------------------------------------------------------------------------------- /src/commands.upgrade.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./commands.upgrade.offline.sh 7 | source ./commands.upgrade.online.sh 8 | source ./env.sh 9 | source ./runtime.sh 10 | 11 | command_upgrade() { 12 | if [ -z "${2}" ]; then 13 | command_upgrade_online 14 | elif [ "${2}" = '--archive' ]; then 15 | command_upgrade_offline "${3}" 16 | else 17 | error 'Unexpected usage' 18 | fi 19 | 20 | git checkout --quiet "$(print_env 'VERSION')" 21 | 22 | ok "Upgrade finished. To restart the CYBERTEC Migrator, run $(highlight "./migrator up")" 23 | } 24 | -------------------------------------------------------------------------------- /src/console.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | # Color codes 7 | RED='\033[1;31m' 8 | GREEN='\033[1;32m' 9 | YELLOW='\033[1;33m' 10 | WHITE='\033[1;37m' 11 | LIGHT_GREY='\033[1;37m' 12 | NC='\033[0m' 13 | 14 | print() { 15 | printf "${1}\n" 16 | } 17 | 18 | highlight() { 19 | echo "${LIGHT_GREY}${1}${NC}" 20 | } 21 | 22 | error() { 23 | >&2 printf "[${RED}ERROR${NC}] ${1}\n" 24 | return ${2-1} 25 | } 26 | 27 | warn() { 28 | printf "[${YELLOW}WARN${NC}] ${1}\n" 29 | } 30 | 31 | info() { 32 | printf "[${WHITE}INFO${NC}] ${1}\n" 33 | } 34 | 35 | ok() { 36 | printf "[${GREEN}OK${NC}] ${1}\n" 37 | } 38 | -------------------------------------------------------------------------------- /src/commands.configure.edition.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./console.sh 7 | source ./env.sh 8 | 9 | command_configure_edition() { 10 | edition=$(echo "${1}" | tr '[:upper:]' '[:lower:]') 11 | verify_edition "$edition" 12 | set_env_file_variable "EDITION" "$edition" 13 | } 14 | 15 | verify_edition() { 16 | edition="${1}" 17 | if [ "$edition" != "assessment" ] \ 18 | && [ "$edition" != "trial" ] \ 19 | && [ "$edition" != "professional" ] \ 20 | && [ "$edition" != "enterprise" ]; then 21 | error "Edition $(highlight "'$edition'") is invalid. Possible values: assessment,trial,professional,enterprise" 22 | fi 23 | } -------------------------------------------------------------------------------- /helm/enterprise-edition/values.yaml: -------------------------------------------------------------------------------- 1 | # Values file for the CYBERTEC-Migrator Helm-Chart 2 | 3 | image: 4 | repository: containers.cybertec.at/cybertec_migrator_enterprise 5 | pullPolicy: IfNotPresent 6 | release: "v3.20.3" 7 | 8 | imagePullSecrets: 9 | - name: "containers.cybertec.at" 10 | 11 | migrator: 12 | ui: 13 | # Typical NodePort or LoadBalancer | is used for the k8s service type 14 | serviceType: NodePort 15 | db: 16 | init: 17 | username: postgres 18 | password: postgres 19 | storage: 20 | core_db: 21 | size: 5Gi 22 | storageClass: standard 23 | core_log: 24 | size: 5Gi 25 | storageClass: standard 26 | core_config: 27 | size: 5Gi 28 | storageClass: standard 29 | 30 | postgres: 31 | image: docker.io/postgres:13-alpine -------------------------------------------------------------------------------- /helm/professional-edition/values.yaml: -------------------------------------------------------------------------------- 1 | # Values file for the CYBERTEC-Migrator Helm-Chart 2 | 3 | image: 4 | repository: containers.cybertec.at/cybertec_migrator_professional 5 | pullPolicy: IfNotPresent 6 | release: "v3.20.3" 7 | 8 | imagePullSecrets: 9 | - name: "containers.cybertec.at" 10 | 11 | migrator: 12 | ui: 13 | # Typical NodePort or LoadBalancer | is used for the k8s service type 14 | serviceType: NodePort 15 | db: 16 | init: 17 | username: postgres 18 | password: postgres 19 | storage: 20 | core_db: 21 | size: 5Gi 22 | storageClass: standard 23 | core_log: 24 | size: 5Gi 25 | storageClass: standard 26 | core_config: 27 | size: 5Gi 28 | storageClass: standard 29 | 30 | postgres: 31 | image: docker.io/postgres:13-alpine 32 | -------------------------------------------------------------------------------- /src/runtime.docker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | runtime_up() { 7 | docker compose --env-file ../.env up -d 8 | } 9 | 10 | runtime_down() { 11 | docker compose --env-file ../.env down 12 | } 13 | 14 | runtime_pull() { 15 | docker compose --env-file ../.env pull 2>&1 > /dev/null 16 | } 17 | 18 | runtime_logs() { 19 | docker compose --env-file ../.env logs --timestamps --tail='all' $1 20 | } 21 | 22 | runtime_load() { 23 | docker load < "${1}" 24 | } 25 | 26 | runtime_run() { 27 | local image="${1}" 28 | local cmd="${2}" 29 | local mount="${3}" 30 | 31 | if [ -n "${mount}" ]; then 32 | mount="--volume ${mount}" 33 | fi 34 | 35 | eval "docker run ${mount} ${image} bash -c \"${cmd}\"" 36 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.yml: -------------------------------------------------------------------------------- 1 | name: "❔ Question" 2 | description: "Ask us anything related to the CYBERTEC Migrator!" 3 | labels: ["question"] 4 | body: 5 | - type: textarea 6 | validations: 7 | required: true 8 | attributes: 9 | label: "📝 Description" 10 | description: "Short but concise" 11 | 12 | - type: input 13 | attributes: 14 | label: "Migrator version" 15 | description: | 16 | Which version of the CYBERTEC Migrator are you using? 17 | placeholder: "3.10.0" 18 | 19 | - type: textarea 20 | attributes: 21 | label: "Other" 22 | description: | 23 | Anything else that could be relevant? e.g.: Logs, OS version, Browser version, etc... 24 | **Tip:** You can attach images, recordings or log files by clicking this area to highlight it and then dragging files in it 25 | -------------------------------------------------------------------------------- /src/constants.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | HTTPS_PORT_DEFAULT=443 7 | 8 | # Temporary directory 9 | TEMP_TEMPLATE='migrator.XXXXXX' 10 | 11 | # Directory name in archive 12 | ARCHIVE_DIR='./cybertec_migrator' 13 | 14 | # Environment configuration files 15 | ENV_FILE='../.env' 16 | 17 | # Directory where we save container images provided from offline installation packages 18 | IMAGE_PATH='images' 19 | 20 | # These files exist only if the directory was provided by on offline installation package 21 | EDITION_FILE='.edition' 22 | VERSION_FILE='.version' 23 | 24 | # TLS/SSL file on host (local bind mounts) 25 | HOST_SSL_CERTIFICATE="../volumes/web_gui/nginx/certs/nginx.crt" 26 | HOST_SSL_CERTIFICATE_KEY="../volumes/web_gui/nginx/certs/nginx.key" 27 | -------------------------------------------------------------------------------- /src/commands.upgrade.online.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./images.pull.sh 7 | source ./util.sh 8 | 9 | command_upgrade_online() { 10 | info 'Updating release information' 11 | git fetch || error 'Could not fetch versions' 12 | 13 | local arch=$(print_env 'ARCH') 14 | local version="$(git tag --list --sort=-v:refname "*-${arch}" | head -n 1)" 15 | info "Upgrading to version $(highlight "${version}")" 16 | set_env_file_variable 'VERSION' "${version}" 17 | 18 | if pull_error=$(pull_images); then 19 | return 20 | else 21 | error "Failed to pull container images\n${pull_error}" || true 22 | if installed_from_archive; then 23 | info "Migrator was installed from an archive: run $(highlight "'./migrator upgrade --archive '") instead" 24 | fi 25 | exit 2 26 | fi 27 | } 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: "🌟 Feature Request" 2 | description: "I have a suggestion!" 3 | labels: ["feature request"] 4 | body: 5 | - type: textarea 6 | validations: 7 | required: true 8 | attributes: 9 | label: "Is your feature request related to a problem? Please describe it" 10 | description: "A clear and concise description of what the problem is" 11 | placeholder: | 12 | I have an issue when ... 13 | 14 | - type: textarea 15 | validations: 16 | required: true 17 | attributes: 18 | label: "Describe the solution you would like" 19 | description: "A clear and concise description of what you want to happen. Add any considered drawbacks" 20 | 21 | - type: textarea 22 | validations: 23 | required: true 24 | attributes: 25 | label: "What is the motivation / use case for changing the behavior?" 26 | description: "Describe the motivation or the concrete use case" 27 | -------------------------------------------------------------------------------- /helm/enterprise-edition/README-Wallet-Setup.md: -------------------------------------------------------------------------------- 1 | # Oracle Wallet Support 2 | 3 | To use Wallet Encrypted Oracle Databases you have to provide the following files: 4 | - sqlnet.ora 5 | - tnsnames.ora 6 | - cwallet.sso 7 | - ewallet.p12 8 | 9 | To do this we added a third Volume `core-config`, mounted into `/volumes` 10 | 11 | 12 | These files must be stored in the `core` container in the directory `/volumes` 13 | ``` 14 | volumes 15 | ├── core 16 | │   └── config 17 | │   └── oracle 18 | │   ├── network 19 | │   │   └── admin 20 | │   │   ├── sqlnet.ora 21 | │   │   └── tnsnames.ora 22 | │   └── wallet 23 | │   ├── README 24 | │   ├── cwallet.sso 25 | │   ├── cwallet.sso.lck 26 | │   ├── ewallet.p12 27 | │   └── ewallet.p12.lck 28 | ``` 29 | 30 | The easiest way to copy the files is ` oc rsync --container core /myPath/migrator/volumes/core/config/ :/volumes/core/config ` 31 | -------------------------------------------------------------------------------- /helm/professional-edition/README-Wallet-Setup.md: -------------------------------------------------------------------------------- 1 | # Oracle Wallet Support 2 | 3 | To use Wallet Encrypted Oracle Databases you have to provide the following files: 4 | - sqlnet.ora 5 | - tnsnames.ora 6 | - cwallet.sso 7 | - ewallet.p12 8 | 9 | To do this we added a third Volume `core-config`, mounted into `/volumes` 10 | 11 | 12 | These files must be stored in the `core` container in the directory `/volumes` 13 | ``` 14 | volumes 15 | ├── core 16 | │   └── config 17 | │   └── oracle 18 | │   ├── network 19 | │   │   └── admin 20 | │   │   ├── sqlnet.ora 21 | │   │   └── tnsnames.ora 22 | │   └── wallet 23 | │   ├── README 24 | │   ├── cwallet.sso 25 | │   ├── cwallet.sso.lck 26 | │   ├── ewallet.p12 27 | │   └── ewallet.p12.lck 28 | ``` 29 | 30 | The easiest way to copy the files is ` oc rsync --container core /myPath/migrator/volumes/core/config/ :/volumes/core/config ` 31 | -------------------------------------------------------------------------------- /src/tls.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./console.sh 7 | source ./runtime.sh 8 | source ./util.sh 9 | 10 | generate_self_signed_certificate() { 11 | info "Generating self-signed TLS/SSL certificate" 12 | 13 | local edition=$(print_env 'EDITION') 14 | local version=$(print_env 'VERSION') 15 | local image="containers.cybertec.at/cybertec_migrator_${edition}/web_gui:${version}" 16 | 17 | runtime_run ${image} "openssl genrsa -out /tmp/nginx.key 4096 && cat /tmp/nginx.key" \ 18 | > ../volumes/web_gui/nginx/certs/nginx.key 19 | 20 | runtime_run ${image} \ 21 | "openssl req -new -key /tmp/nginx.key -x509 -out /tmp/nginx.crt -days 3650 -subj \\\"/C=AT/ST=Lower Austria/L=Wöllersdorf/O=CYBERTEC PostgreSQL International GmbH/OU=Development/CN=cybertec.at\\\" && cat /tmp/nginx.crt" \ 22 | "$(pwd)/../volumes/web_gui/nginx/certs/nginx.key:/tmp/nginx.key:Z" \ 23 | > ../volumes/web_gui/nginx/certs/nginx.crt 24 | } 25 | -------------------------------------------------------------------------------- /src/patches.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./constants.sh 7 | source ./util.sh 8 | 9 | v3_20_0_add_arch_and_container_runtime() { 10 | if [ -z "$(print_env 'ARCH')" ]; then 11 | local architecture="" 12 | case $(uname -m) in 13 | x86_64) architecture="amd64" ;; 14 | aarch64|arm64) architecture="arm64" ;; 15 | *) 16 | error "Unable to detect architecture $(highlight "$(uname -m)")" 17 | error "Please file a ticket so we may resolve this issue:" 18 | error " Public: https://github.com/cybertec-postgresql/cybertec_migrator/issues/new/choose" 19 | error " Customers: https://cybertec.atlassian.net/servicedesk/customer/portal/3/group/4/create/23" 20 | exit 1 21 | ;; 22 | esac 23 | set_env_file_variable "ARCH" "$architecture" 24 | fi 25 | 26 | if [ -z "$(print_env 'CONTAINER_RUNTIME')" ]; then 27 | set_env_file_variable "CONTAINER_RUNTIME" "docker" 28 | fi 29 | } 30 | -------------------------------------------------------------------------------- /src/commands.configure.tls.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./tls.sh 7 | 8 | command_configure_tls() { 9 | local tls_sub_command=$(echo "${1}" | cut --delimiter=":" --fields=1) 10 | local tls_file_location=$(echo "${1}" | cut --delimiter=":" --fields=2) 11 | case ${tls_sub_command} in 12 | "") 13 | error "Missing argument for option '--tls'" 14 | ;; 15 | self-signed-cert) 16 | generate_self_signed_certificate 17 | ;; 18 | key) 19 | exec_error=$(cp "${tls_file_location}" "${HOST_SSL_CERTIFICATE_KEY}" 2>&1 > /dev/null) || \ 20 | error "Failed to install TLS/SSL certificate key\n${exec_error}" 21 | ok "Installed TLS/SSL certificate key" 22 | ;; 23 | cert) 24 | exec_error=$(cp "${tls_file_location}" "${HOST_SSL_CERTIFICATE}" 2>&1 > /dev/null) || \ 25 | error "Failed to install TLS/SSL certificate\n${exec_error}" 26 | ok "Installed TLS/SSL certificate" 27 | ;; 28 | *) 29 | error "Unknown argument '${2} ${3}'" 30 | ;; 31 | esac 32 | } 33 | -------------------------------------------------------------------------------- /src/runtime.podman.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./constants.sh 7 | 8 | runtime_up() { 9 | ( cd .. ; podman-compose up -d ) 10 | } 11 | 12 | runtime_down() { 13 | ( cd .. ; podman-compose down ) 14 | } 15 | 16 | runtime_pull() { 17 | ( cd .. ; podman-compose pull 2>&1 > /dev/null ) 18 | } 19 | 20 | runtime_logs() { 21 | ( cd .. ; podman-compose logs --timestamps --tail='all' $1 ) 22 | } 23 | 24 | runtime_load() { 25 | local image_reference=$(podman load --quiet < "${1}") 26 | # Podman prefixes images with localhost/ 27 | # We have to re-tag the image to start with docker.io/ 28 | image_reference="${image_reference#*localhost/}" 29 | podman tag "localhost/${image_reference}" "containers.cybertec.at/${image_reference}" 30 | podman image rm "localhost/${image_reference}" 31 | } 32 | 33 | runtime_run() { 34 | local image="${1}" 35 | local cmd="${2}" 36 | local mount="${3}" 37 | 38 | if [ -n "${mount}" ]; then 39 | mount="--volume ${mount}" 40 | fi 41 | 42 | eval "podman run ${mount} ${image} bash -c \"${cmd}\"" 43 | } 44 | -------------------------------------------------------------------------------- /helm/enterprise-edition/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: cybertec-migrator-core-db-pvc 5 | namespace: {{ .Release.Namespace }} 6 | spec: 7 | volumeMode: Filesystem 8 | accessModes: 9 | - ReadWriteOnce 10 | resources: 11 | requests: 12 | storage: {{ .Values.migrator.storage.core_db.size }} 13 | storageClassName: {{ .Values.migrator.storage.core_db.storageClass }} 14 | --- 15 | apiVersion: v1 16 | kind: PersistentVolumeClaim 17 | metadata: 18 | name: cybertec-migrator-core-log-pvc 19 | namespace: {{ .Release.Namespace }} 20 | spec: 21 | accessModes: 22 | - ReadWriteOnce 23 | resources: 24 | requests: 25 | storage: {{ .Values.migrator.storage.core_log.size }} 26 | storageClassName: {{ .Values.migrator.storage.core_log.storageClass }} 27 | --- 28 | apiVersion: v1 29 | kind: PersistentVolumeClaim 30 | metadata: 31 | name: cybertec-migrator-core-config-pvc 32 | namespace: {{ .Release.Namespace }} 33 | spec: 34 | accessModes: 35 | - ReadWriteOnce 36 | resources: 37 | requests: 38 | storage: {{ .Values.migrator.storage.core_config.size }} 39 | storageClassName: {{ .Values.migrator.storage.core_config.storageClass }} -------------------------------------------------------------------------------- /helm/professional-edition/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: cybertec-migrator-core-db-pvc 5 | namespace: {{ .Release.Namespace }} 6 | spec: 7 | volumeMode: Filesystem 8 | accessModes: 9 | - ReadWriteOnce 10 | resources: 11 | requests: 12 | storage: {{ .Values.migrator.storage.core_db.size }} 13 | storageClassName: {{ .Values.migrator.storage.core_db.storageClass }} 14 | --- 15 | apiVersion: v1 16 | kind: PersistentVolumeClaim 17 | metadata: 18 | name: cybertec-migrator-core-log-pvc 19 | namespace: {{ .Release.Namespace }} 20 | spec: 21 | accessModes: 22 | - ReadWriteOnce 23 | resources: 24 | requests: 25 | storage: {{ .Values.migrator.storage.core_log.size }} 26 | storageClassName: {{ .Values.migrator.storage.core_log.storageClass }} 27 | --- 28 | apiVersion: v1 29 | kind: PersistentVolumeClaim 30 | metadata: 31 | name: cybertec-migrator-core-config-pvc 32 | namespace: {{ .Release.Namespace }} 33 | spec: 34 | accessModes: 35 | - ReadWriteOnce 36 | resources: 37 | requests: 38 | storage: {{ .Values.migrator.storage.core_config.size }} 39 | storageClassName: {{ .Values.migrator.storage.core_config.storageClass }} -------------------------------------------------------------------------------- /src/commands.upgrade.offline.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./constants.sh 7 | source ./env.sh 8 | source ./images.load.sh 9 | source ./runtime.sh 10 | source ./util.sh 11 | 12 | command_upgrade_offline() { 13 | local archive="${1}" 14 | 15 | info "Extracting archive" 16 | temp_dir="$(mktemp -t "${TEMP_TEMPLATE}" -d)" 17 | trap 'rm -rf -- "${temp_dir}"' EXIT 18 | extraction_error=$(tar -xf "${archive}" --strip-components=2 --directory "${temp_dir}" 2>&1 > /dev/null) || true 19 | if [ ! -z "${extraction_error}" ]; then 20 | error "Failed to extract archive file:\n$extraction_error" 21 | fi 22 | 23 | info "Updating release information" 24 | git fetch --quiet --tags "${temp_dir}/.git" 1>/dev/null 25 | 26 | local archive_image_path="${temp_dir}/${IMAGE_PATH}" 27 | load_images_from_path "${archive_image_path}" 28 | 29 | info 'Archiving container images' 30 | mkdir -p "../${IMAGE_PATH}" 31 | mv ${archive_image_path}/*.tar "../${IMAGE_PATH}" 32 | 33 | set_env_file_variable EDITION "$(cat "${temp_dir}/${EDITION_FILE}")" 34 | set_env_file_variable VERSION "$(cat "${temp_dir}/${VERSION_FILE}")" 35 | } 36 | -------------------------------------------------------------------------------- /src/_index.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | set -e 7 | shopt -s nullglob 8 | 9 | # Change working directory to script directory 10 | cd "${0%/*}" 11 | 12 | source ./commands.configure.sh 13 | source ./commands.down.sh 14 | source ./commands.help.sh 15 | source ./commands.install.sh 16 | source ./commands.logs.sh 17 | source ./commands.up.sh 18 | source ./commands.upgrade.sh 19 | source ./console.sh 20 | source ./env.sh 21 | 22 | case "${1}" in 23 | install) 24 | command_install 25 | ;; 26 | upgrade) 27 | env_barrier 28 | command_upgrade "$@" 29 | ;; 30 | up) 31 | env_barrier 32 | command_up 33 | ;; 34 | down) 35 | env_barrier 36 | command_down 37 | ;; 38 | logs) 39 | env_barrier 40 | command_logs "$2" 41 | ;; 42 | configure) 43 | env_barrier 44 | command_configure "$@" 45 | ;; 46 | edition) 47 | env_barrier 48 | print_env 'EDITION' 49 | ;; 50 | version) 51 | env_barrier 52 | print_env 'VERSION' 53 | ;; 54 | help) 55 | command_help 56 | exit 0 57 | ;; 58 | *) 59 | error "Unknown command [${1}]" || true 60 | command_help 61 | exit 0 62 | ;; 63 | esac -------------------------------------------------------------------------------- /src/commands.help.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./console.sh 7 | 8 | command_help() { 9 | print "$(cat < Upgrade to version contained in archive 19 | 20 | $(highlight "configure --edition ") Set CYBERTEC Migrator edition. Must be one of (assessment,trial,professional,enterprise) 21 | $(highlight "configure --tls self-signed-cert") Generate self-signed TLS/SSL certificate 22 | $(highlight "configure --tls cert:") Install TLS/SSL certificate (the path has to be absolute) 23 | $(highlight "configure --tls key:") Install private key of TLS/SSL certificate (the path has to be absolute) 24 | 25 | $(highlight "help") Display this help text 26 | EOF 27 | )" 28 | } -------------------------------------------------------------------------------- /src/commands.up.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./runtime.sh 7 | 8 | command_up() { 9 | tls_barrier 10 | fix_encryption_key 11 | 12 | runtime_up 13 | print_url 14 | } 15 | 16 | tls_barrier() { 17 | if [ ! -f "${HOST_SSL_CERTIFICATE}" ] && [ ! -f "${HOST_SSL_CERTIFICATE_KEY}" ]; then 18 | error "Could not find TLS/SSL certificate" || true 19 | info "Run $(highlight "'./migrator configure --tls self-signed-cert'") to generate a self-signed TLS/SSL certificate" 20 | exit 3 21 | fi 22 | } 23 | 24 | fix_encryption_key() { 25 | # With v3.19.0, all passwords within the database are encrypted 26 | # TODO: remove after a couple of releases 27 | if [ -z "$(print_env 'CORE_ENCRYPTION_KEY')" ]; then 28 | encryption_key="$(generate_random 'A-Za-z0-9' 32)" 29 | encryption_iv="$(generate_random 'A-Za-z0-9' 16)" 30 | 31 | echo "CORE_ENCRYPTION_KEY=\"${encryption_key}\"" >> "${ENV_FILE}" 32 | echo "CORE_ENCRYPTION_IV=\"${encryption_iv}\"" >> "${ENV_FILE}" 33 | info "Generated encryption key and IV" 34 | fi 35 | } 36 | 37 | print_url() { 38 | ip_addr="$(get_hostname)" 39 | if [ ! -z "${ip_addr}" ]; then 40 | port=":$(print_env 'EXTERNAL_HTTP_PORT')" 41 | if [ "${port}" = ":${HTTPS_PORT_DEFAULT}" ]; then 42 | port='' 43 | fi 44 | 45 | ok "Started on $(highlight "'https://${ip_addr}${port}'")" 46 | fi 47 | } 48 | 49 | get_hostname() { 50 | # BSD `hostname` doesn't understand the `-I` flag 51 | (hostname --all-ip-addresses 2> /dev/null || hostname) | awk '{ print $1 }' 52 | } -------------------------------------------------------------------------------- /src/env.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./constants.sh 7 | source ./util.sh 8 | source ./patches.sh 9 | 10 | env_file_exists() { 11 | [ -f "${ENV_FILE}" ] 12 | } 13 | 14 | env_barrier() { 15 | if ! env_file_exists; then 16 | error "Initial configuration outstanding (run $(highlight "'./migrator install'"))" 17 | fi 18 | 19 | v3_20_0_add_arch_and_container_runtime 20 | } 21 | 22 | print_env() { 23 | env -i "${BASH}" -c "set -a; . "${ENV_FILE}"; set +a; echo \${${1}};" 24 | } 25 | 26 | set_env_file_variable() { 27 | if grep "^$1=.*$" "${ENV_FILE}" &>/dev/null; then 28 | # Replace the value 29 | sed -i.bak -e "s/^$1=.*$/$1=$2/" "${ENV_FILE}" 30 | else 31 | # Insert the value in the second line of the env file 32 | cp "${ENV_FILE}" "${ENV_FILE}.bak" 33 | awk "NR==1{print; print \"$1=$2\"} NR!=1" "${ENV_FILE}.bak" > "${ENV_FILE}" 34 | fi 35 | rm "${ENV_FILE}.bak" 36 | } 37 | 38 | generate_env_file() { 39 | # If file exists return false 40 | ! env_file_exists || return 41 | 42 | info 'Generating environment file' 43 | 44 | # File doesn't exist, so generate it 45 | password="$(generate_random 'A-Za-z0-9!&()*+,-./:;<=>?@{|}~' 32)" 46 | encryption_key="$(generate_random 'A-Za-z0-9' 32)" 47 | encryption_iv="$(generate_random 'A-Za-z0-9' 16)" 48 | 49 | version="" 50 | if installed_from_archive; then 51 | version="$(cat "../${VERSION_FILE}")" 52 | else 53 | version="$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1)" 54 | fi 55 | 56 | cat < "${ENV_FILE}" 57 | # —— User configurable —— 58 | EXTERNAL_HTTP_PORT=${HTTPS_PORT_DEFAULT} 59 | VERSION=${version} 60 | EDITION=trial 61 | CONTAINER_RUNTIME=docker 62 | 63 | # —— Internal ⚠ —— 64 | CORE_DB_PASSWORD="${password}" 65 | CORE_ENCRYPTION_KEY=${encryption_key} 66 | CORE_ENCRYPTION_IV=${encryption_iv} 67 | EOF 68 | 69 | chmod 600 "${ENV_FILE}" 70 | } -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: MIT 2 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 3 | services: 4 | # Single page application served via nginx web server 5 | web_gui: 6 | image: containers.cybertec.at/cybertec_migrator_${EDITION}/web_gui:${VERSION} 7 | depends_on: 8 | core: 9 | condition: service_started 10 | environment: 11 | - FRONTEND_BASE_URL=${FRONTEND_BASE_URL:-} 12 | volumes: 13 | - ./volumes/web_gui/nginx/htpasswd:/etc/nginx/htpasswd:Z 14 | - ./volumes/web_gui/nginx/certs:/etc/nginx/certs:Z 15 | networks: 16 | - common 17 | ports: 18 | - ${EXTERNAL_HTTP_PORT}:8443 19 | 20 | # Migrator core exposed as REST service API 21 | core: 22 | image: containers.cybertec.at/cybertec_migrator_${EDITION}/core:${VERSION} 23 | env_file: .env 24 | environment: 25 | # —— Internal database —— 26 | - CORE_DB_HOST=core_db 27 | - CORE_DB_PASSWORD=${CORE_DB_PASSWORD} 28 | - CORE_DB_DATABASE=migrator 29 | - TNS_ADMIN=/app/config/oracle/network/admin 30 | depends_on: 31 | core_db: 32 | condition: service_healthy 33 | volumes: 34 | - ./volumes/core/config:/app/config:Z 35 | networks: 36 | - common 37 | 38 | # Internal Migrator database 39 | core_db: 40 | image: docker.io/postgres:13-alpine 41 | environment: 42 | # —— Postgres settings —— 43 | - POSTGRES_PASSWORD=${CORE_DB_PASSWORD} 44 | volumes: 45 | - core_db-data:/var/lib/postgresql/data 46 | - ./volumes/core_db/initdb.sh:/docker-entrypoint-initdb.d/init-user-db.sh:Z 47 | healthcheck: 48 | # Ensures that the database is ready *and* the password is in sync 49 | test: 50 | [ 51 | "CMD-SHELL", 52 | 'psql --username=postgres --dbname=migrator --command="ALTER USER postgres WITH PASSWORD ''${CORE_DB_PASSWORD}''"', 53 | ] 54 | interval: 5s 55 | timeout: 5s 56 | retries: 10 57 | networks: 58 | - common 59 | 60 | volumes: 61 | core_db-data: 62 | 63 | networks: 64 | common: 65 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: "🐞 Bug Report" 2 | description: "Something isn't working as expected" 3 | labels: ["bug"] 4 | body: 5 | - type: textarea 6 | validations: 7 | required: true 8 | attributes: 9 | label: "📝 Description" 10 | description: "Short but concise description of the bug" 11 | 12 | - type: textarea 13 | validations: 14 | required: true 15 | attributes: 16 | label: "📜 Steps to reproduce" 17 | description: | 18 | How does the bug manifest itself? 19 | placeholder: | 20 | 1. First step 21 | 2. Second step 22 | 3. And so on... 23 | 24 | - type: textarea 25 | validations: 26 | required: true 27 | attributes: 28 | label: "🙁 Actual behavior" 29 | description: "What happened, and why it was wrong" 30 | 31 | - type: textarea 32 | validations: 33 | required: true 34 | attributes: 35 | label: "🙂 Expected behavior" 36 | description: "What you expected to happen instead, and why" 37 | 38 | - type: markdown 39 | attributes: 40 | value: | 41 | --- 42 | 43 | - type: input 44 | validations: 45 | required: true 46 | attributes: 47 | label: "Migrator version" 48 | description: | 49 | Which version of the CYBERTEC Migrator are you using? 50 | placeholder: "3.10.0" 51 | 52 | - type: checkboxes 53 | validations: 54 | required: true 55 | attributes: 56 | label: "In which environment are you operating?" 57 | options: 58 | - label: Linux 59 | - label: macOS 60 | - label: Windows 61 | - label: Other 62 | 63 | - type: input 64 | validations: 65 | required: true 66 | attributes: 67 | label: "What browser are you using" 68 | placeholder: "Firefox, Chrome, Safari, etc..." 69 | 70 | - type: markdown 71 | attributes: 72 | value: | 73 | --- 74 | 75 | - type: textarea 76 | id: other_description 77 | attributes: 78 | label: "Other" 79 | description: | 80 | Anything else that could be relevant? e.g.: Logs, OS version, Browser version, etc... 81 | **Tip:** You can attach images, recordings or log files by clicking this area to highlight it and then dragging files in it 82 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | CYBERTEC Migrator 3 |

4 | 5 | --- 6 | 7 |

8 | Streamlined Oracle to PostgreSQL migration 9 |

10 | 11 |

12 | Documentation 13 |  •  14 | Product Page 15 |  •  16 | Contact 17 |

18 | 19 | [![announcment](./docs/pictures/github-pages-announcement.svg)](https://cybertec-postgresql.github.io/cybertec_migrator/) 20 | 21 | --- 22 | 23 | [_CYBERTEC Migrator_](https://www.cybertec-postgresql.com/en/products/cybertec-migrator/) is a streamlined and user-friendly tool that helps you to organize and efficiently migrate multiple Oracle databases to PostgreSQL. 24 | In addition to migrating your data professionally and securely with minimum effort, _CYBERTEC Migrator_ allows you to visually monitor and track the whole process at any time. 25 | 26 | Do you want to know if the Migrator can migrate your Oracle database to PostgreSQL? 27 | Then [get the Migrator Trial Edition](https://www.cybertec-postgresql.com/en/products/cybertec-migrator#form), a **free version** of the CYBERTEC Migrator, follow the offline instructions provided in the [Installation](https://cybertec-postgresql.github.io/cybertec_migrator/getting-started/installation/) section, and try it out. 28 | 29 | | 💡 | The Trial Edition of the CYBERTEC Migrator is exclusively intended for private or testing purposes, unless explicit authorization is obtained. | 30 | |----|------------------------------------------------------------------------------------------------------------------------------------------------| 31 | 32 | In our blog [Meet the CYBERTEC Migrator](https://www.cybertec-postgresql.com/en/meet-the-cybertec-migrator/), we showcase how Oracle's `HR` demo schema may be migrated to PostgreSQL. 33 | Alternatively, you may want to watch the complementary [CYBERTEC Migrator YouTube playlist](https://www.youtube.com/playlist?list=PLt4uYyc72accw-Wi1Egn-IcOOSitK5Lcq). 34 | 35 |

36 | CYBERTEC Migrator v3 Demonstration
37 | Product Demo 38 |

39 | -------------------------------------------------------------------------------- /src/commands.install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # SPDX-License-Identifier: MIT 4 | # SPDX-FileCopyrightText: 2022-2024 CYBERTEC PostgreSQL International GmbH 5 | 6 | source ./console.sh 7 | source ./env.sh 8 | source ./images.load.sh 9 | source ./images.pull.sh 10 | source ./tls.sh 11 | source ./util.sh 12 | 13 | command_install() { 14 | if env_file_exists; then 15 | error "Unable to install: $(highlight "env file already exists")" 16 | fi 17 | 18 | git config --global --add safe.directory "*" 19 | 20 | info "You are about to be asked to enter some information relevant to the installation." 21 | info "The allowed values are in normal brackets, the default value in square brackets." 22 | 23 | if ! detect_arch > /dev/null; then 24 | exit 1 25 | fi 26 | local arch="$(detect_arch)" 27 | 28 | local edition="" 29 | if installed_from_archive; then 30 | edition="$(cat "../${EDITION_FILE}")" 31 | else 32 | edition="$(prompt_edition)" 33 | fi 34 | 35 | local runtime="$(prompt_runtime)" 36 | 37 | generate_env_file 38 | 39 | set_env_file_variable "ARCH" "${arch}" 40 | set_env_file_variable "EDITION" "${edition}" 41 | set_env_file_variable "CONTAINER_RUNTIME" "${runtime}" 42 | 43 | if [[ $runtime = "podman" ]]; then 44 | set_env_file_variable "EXTERNAL_HTTP_PORT" "8443" 45 | fi 46 | 47 | # Source the runtime again so it may now load the correct functions depending on the environment variable 48 | source ./runtime.sh 49 | 50 | if installed_from_archive; then 51 | load_images_from_path "../${IMAGE_PATH}"; 52 | else 53 | pull_images; 54 | fi 55 | 56 | generate_self_signed_certificate 57 | 58 | ok "Install finished. To start the CYBERTEC Migrator, run $(highlight "./migrator up")" 59 | } 60 | 61 | detect_arch() { 62 | local architecture="" 63 | case $(uname -m) in 64 | x86_64) architecture="amd64" ;; 65 | aarch64|arm64) architecture="arm64" ;; 66 | *) 67 | error "Unable to detect architecture $(highlight "$(uname -m)")" 68 | error "Please file a ticket so we may resolve this issue:" 69 | error " Public: https://github.com/cybertec-postgresql/cybertec_migrator/issues/new/choose" 70 | error " Customers: https://cybertec.atlassian.net/servicedesk/customer/portal/3/group/4/create/23" 71 | exit 1 72 | ;; 73 | esac 74 | echo "${architecture}" 75 | } 76 | 77 | prompt_edition() { 78 | local edition="trial" 79 | while true; do 80 | read -p "Migrator Edition (trial, professional, enterprise) [$edition]: " result 81 | case $result in 82 | "") break ;; 83 | assessment|trial|professional|enterprise) edition=$result; break ;; 84 | * ) ;; 85 | esac 86 | done 87 | echo "${edition}" 88 | } 89 | 90 | prompt_runtime() { 91 | local runtime="docker" 92 | if command -v docker 2>&1 >/dev/null 93 | then 94 | runtime="docker" 95 | elif command -v podman 2>&1 >/dev/null 96 | then 97 | runtime="podman" 98 | fi 99 | 100 | while true; do 101 | read -p "Container runtime (docker, podman) [$runtime]: " result 102 | case $result in 103 | "") break ;; 104 | docker|podman) runtime=$result; break ;; 105 | * ) ;; 106 | esac 107 | done 108 | echo "${runtime}" 109 | } -------------------------------------------------------------------------------- /docs/pictures/migrator-logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /helm/enterprise-edition/templates/app.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: {{ .Release.Name }} 5 | namespace: {{ .Release.Namespace }} 6 | labels: 7 | app: {{ .Release.Name }}-app 8 | spec: 9 | replicas: 1 10 | serviceName: {{ .Release.Name }} 11 | selector: 12 | matchLabels: 13 | app: {{ .Release.Name }}-app 14 | template: 15 | metadata: 16 | labels: 17 | app: {{ .Release.Name }}-app 18 | spec: 19 | containers: 20 | - name: core-db 21 | image: {{ .Values.postgres.image }} 22 | volumeMounts: 23 | - name: initdb 24 | mountPath: /docker-entrypoint-initdb.d 25 | - name: core-db-vol 26 | mountPath: /var/lib/postgresql/data 27 | env: 28 | - name: POSTGRES_PASSWORD 29 | valueFrom: 30 | secretKeyRef: 31 | name: migrator.postgres.core.db 32 | key: password 33 | optional: false 34 | 35 | - name: core 36 | image: "{{ .Values.image.repository }}/core:{{ .Values.image.release }}" 37 | env: 38 | 39 | - name: CORE_DB_PASSWORD 40 | valueFrom: 41 | secretKeyRef: 42 | name: migrator.postgres.core.db 43 | key: password 44 | optional: false 45 | 46 | - name: CORE_EXIT_ON_DATABASE_INITIALIZATION_ERROR 47 | valueFrom: 48 | configMapKeyRef: 49 | name: db-coninfo 50 | key: CORE_EXIT_ON_DATABASE_INITIALIZATION_ERROR 51 | 52 | - name: CORE_DB_HOST 53 | valueFrom: 54 | configMapKeyRef: 55 | name: db-coninfo 56 | key: CORE_DB_HOST 57 | 58 | - name: CORE_DB_DATABASE 59 | valueFrom: 60 | configMapKeyRef: 61 | name: db-coninfo 62 | key: CORE_DB_DATABASE 63 | 64 | imagePullPolicy: IfNotPresent 65 | 66 | volumeMounts: 67 | - name: core-log 68 | mountPath: /app/logs 69 | - name: core-config 70 | mountPath: /volumes/core/config 71 | subPath: oracle 72 | 73 | - name: web-gui 74 | image: "{{ .Values.image.repository }}/web_gui:{{ .Values.image.release }}" 75 | volumeMounts: 76 | - name: nginx-config 77 | mountPath: /etc/nginx/ 78 | - name: nginx-cert 79 | mountPath: /etc/ssl/nginx.crt 80 | subPath: nginx.cert 81 | readOnly: true 82 | - name: nginx-cert-key 83 | mountPath: /etc/ssl/nginx.key 84 | subPath: nginx.key 85 | readOnly: true 86 | imagePullPolicy: IfNotPresent 87 | 88 | 89 | {{- with .Values.imagePullSecrets }} 90 | imagePullSecrets: 91 | {{- toYaml . | nindent 8 }} 92 | {{- end}} 93 | 94 | volumes: 95 | - name: initdb 96 | configMap: 97 | name: initdb.sh 98 | 99 | - name: core-db-vol 100 | persistentVolumeClaim: 101 | claimName: cybertec-migrator-core-db-pvc 102 | 103 | - name: core-log 104 | persistentVolumeClaim: 105 | claimName: cybertec-migrator-core-log-pvc 106 | 107 | - name: core-config 108 | persistentVolumeClaim: 109 | claimName: cybertec-migrator-core-config-pvc 110 | 111 | 112 | - name: nginx-config 113 | configMap: 114 | name: nginx-config 115 | items: 116 | - key: nginx.conf 117 | path: nginx.conf 118 | - key: mime.types 119 | path: mime.types 120 | 121 | - name: nginx-cert 122 | configMap: 123 | name: nginx-cert 124 | items: 125 | - key: nginx.cert 126 | path: nginx.cert 127 | 128 | - name: nginx-cert-key 129 | configMap: 130 | name: nginx-cert-key 131 | items: 132 | - key: nginx.key 133 | path: nginx.key 134 | --- -------------------------------------------------------------------------------- /helm/professional-edition/templates/app.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: {{ .Release.Name }} 5 | namespace: {{ .Release.Namespace }} 6 | labels: 7 | app: {{ .Release.Name }}-app 8 | spec: 9 | replicas: 1 10 | serviceName: {{ .Release.Name }} 11 | selector: 12 | matchLabels: 13 | app: {{ .Release.Name }}-app 14 | template: 15 | metadata: 16 | labels: 17 | app: {{ .Release.Name }}-app 18 | spec: 19 | containers: 20 | - name: core-db 21 | image: {{ .Values.postgres.image }} 22 | volumeMounts: 23 | - name: initdb 24 | mountPath: /docker-entrypoint-initdb.d 25 | - name: core-db-vol 26 | mountPath: /var/lib/postgresql/data 27 | env: 28 | - name: POSTGRES_PASSWORD 29 | valueFrom: 30 | secretKeyRef: 31 | name: migrator.postgres.core.db 32 | key: password 33 | optional: false 34 | 35 | - name: core 36 | image: "{{ .Values.image.repository }}/core:{{ .Values.image.release }}" 37 | env: 38 | 39 | - name: CORE_DB_PASSWORD 40 | valueFrom: 41 | secretKeyRef: 42 | name: migrator.postgres.core.db 43 | key: password 44 | optional: false 45 | 46 | - name: CORE_EXIT_ON_DATABASE_INITIALIZATION_ERROR 47 | valueFrom: 48 | configMapKeyRef: 49 | name: db-coninfo 50 | key: CORE_EXIT_ON_DATABASE_INITIALIZATION_ERROR 51 | 52 | - name: CORE_DB_HOST 53 | valueFrom: 54 | configMapKeyRef: 55 | name: db-coninfo 56 | key: CORE_DB_HOST 57 | 58 | - name: CORE_DB_DATABASE 59 | valueFrom: 60 | configMapKeyRef: 61 | name: db-coninfo 62 | key: CORE_DB_DATABASE 63 | 64 | imagePullPolicy: IfNotPresent 65 | 66 | volumeMounts: 67 | - name: core-log 68 | mountPath: /app/logs 69 | - name: core-config 70 | mountPath: /volumes/core/config 71 | subPath: oracle 72 | 73 | - name: web-gui 74 | image: "{{ .Values.image.repository }}/web_gui:{{ .Values.image.release }}" 75 | volumeMounts: 76 | - name: nginx-config 77 | mountPath: /etc/nginx/ 78 | - name: nginx-cert 79 | mountPath: /etc/ssl/nginx.crt 80 | subPath: nginx.cert 81 | readOnly: true 82 | - name: nginx-cert-key 83 | mountPath: /etc/ssl/nginx.key 84 | subPath: nginx.key 85 | readOnly: true 86 | imagePullPolicy: IfNotPresent 87 | 88 | 89 | {{- with .Values.imagePullSecrets }} 90 | imagePullSecrets: 91 | {{- toYaml . | nindent 8 }} 92 | {{- end}} 93 | 94 | volumes: 95 | - name: initdb 96 | configMap: 97 | name: initdb.sh 98 | 99 | - name: core-db-vol 100 | persistentVolumeClaim: 101 | claimName: cybertec-migrator-core-db-pvc 102 | 103 | - name: core-log 104 | persistentVolumeClaim: 105 | claimName: cybertec-migrator-core-log-pvc 106 | 107 | - name: core-config 108 | persistentVolumeClaim: 109 | claimName: cybertec-migrator-core-config-pvc 110 | 111 | 112 | - name: nginx-config 113 | configMap: 114 | name: nginx-config 115 | items: 116 | - key: nginx.conf 117 | path: nginx.conf 118 | - key: mime.types 119 | path: mime.types 120 | 121 | - name: nginx-cert 122 | configMap: 123 | name: nginx-cert 124 | items: 125 | - key: nginx.cert 126 | path: nginx.cert 127 | 128 | - name: nginx-cert-key 129 | configMap: 130 | name: nginx-cert-key 131 | items: 132 | - key: nginx.key 133 | path: nginx.key 134 | --- -------------------------------------------------------------------------------- /helm/enterprise-edition/templates/configmaps.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: initdb.sh 5 | namespace: {{ .Release.Namespace }} 6 | data: 7 | initdb.sh: | 8 | #!/bin/bash 9 | 10 | set -e 11 | 12 | DATABASE="migrator" 13 | SCHEMA="cybertec_migrator" 14 | 15 | psql -U postgres -v ON_ERROR_STOP=1 <<-EOF 16 | CREATE DATABASE ${DATABASE}; 17 | EOF 18 | 19 | psql -U postgres -v ON_ERROR_STOP=1 --dbname "${DATABASE}" <<-EOF 20 | CREATE SCHEMA ${SCHEMA}; 21 | EOF 22 | --- 23 | apiVersion: v1 24 | kind: ConfigMap 25 | metadata: 26 | name: nginx-cert 27 | namespace: {{ .Release.Namespace }} 28 | data: 29 | nginx.cert: | 30 | -----BEGIN CERTIFICATE----- 31 | MIIDazCCAlOgAwIBAgIUQH0gHfDzbja1DEZa9y5jRpsh2jowDQYJKoZIhvcNAQEL 32 | BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM 33 | GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMzAyMDYxNDA1MjhaFw0yMzAz 34 | MDgxNDA1MjhaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw 35 | HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB 36 | AQUAA4IBDwAwggEKAoIBAQCgvdrNeOgt2TJgYanm5elBy3fYfTqayAIETo6AWajQ 37 | B8botE8HMGzsXf3qHLUkUOPtrSxj2Hr4+NDL7dpCBHtVKbSWP37w9Sf6eD89Yv5T 38 | ZcjQr2Oes07ifx1Ow494DuIshlwgNxtTpCHgpQHgMYr/NhGJyJeXuEaEbsVvez9i 39 | Byhg5a94P7VAr5AVID+6j0KmixHCOSDXSq+X417YWfrGu1ahZDelaAqe8Nl2HKFW 40 | YKs056/OKL7q5oFu2S8bx00WOwHwDK5K6+7BLu8w98PLXktjZzQxFZw4uEIBy/Gw 41 | /gIamPM0dGeVqgVEW4j8KenKmMhlugs8q9LURiUKYgZvAgMBAAGjUzBRMB0GA1Ud 42 | DgQWBBQQT00HcRQHftlZi8EuFkqwCTYxoTAfBgNVHSMEGDAWgBQQT00HcRQHftlZ 43 | i8EuFkqwCTYxoTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCH 44 | V7noTAsRb3fOqwiKS2eGu93EWkrLopD82h8ugoibKV3R/Ck57JETmAtypQiVtBrc 45 | zSBAdSemMHfWXFK88OgSFVBMZF2XFb5TMxyKALvicNSWYosRhRhq/fTCQNlK351H 46 | Q9xiPwpJLlpG3G4XApqLiUifWYWQsAntAKG+ts4DsLhfzrjcOziQpPFvcjfrQkwO 47 | mZFibkVOkjgBUqArt1J/mZNUXuSlU6rzX91HmRHCMS1Eg1jA37XiBhmvrS55mq3/ 48 | BwEGI1cZPl7c79ngl0WXiwDnvriDKOC5tSgWho5WcUQvC0kFFeWJZB2ZdmhwlneI 49 | cMxgJGsMdizznEzPSAeD 50 | -----END CERTIFICATE----- 51 | 52 | --- 53 | apiVersion: v1 54 | kind: ConfigMap 55 | metadata: 56 | name: nginx-cert-key 57 | namespace: {{ .Release.Namespace }} 58 | data: 59 | nginx.key: | 60 | -----BEGIN PRIVATE KEY----- 61 | MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCgvdrNeOgt2TJg 62 | Yanm5elBy3fYfTqayAIETo6AWajQB8botE8HMGzsXf3qHLUkUOPtrSxj2Hr4+NDL 63 | 7dpCBHtVKbSWP37w9Sf6eD89Yv5TZcjQr2Oes07ifx1Ow494DuIshlwgNxtTpCHg 64 | pQHgMYr/NhGJyJeXuEaEbsVvez9iByhg5a94P7VAr5AVID+6j0KmixHCOSDXSq+X 65 | 417YWfrGu1ahZDelaAqe8Nl2HKFWYKs056/OKL7q5oFu2S8bx00WOwHwDK5K6+7B 66 | Lu8w98PLXktjZzQxFZw4uEIBy/Gw/gIamPM0dGeVqgVEW4j8KenKmMhlugs8q9LU 67 | RiUKYgZvAgMBAAECggEBAJMazQhoE0wKTvEnz/6xABSnqellSeHnEvlwDzflVfn0 68 | dBP5F64Dolt69WpwlVJD+SRF7K7/qiL6StOmvKzYPyrEPTGXsIvCQLEXpQB//TLD 69 | ntFlAa12ecYNAPxZOo5sSI7o85zD8e1M83gMargLfyJrEAfhnOJL0bVXTrbkuy/w 70 | 263vlAN7+oaYW3v6UCMX0TmpNbsDfbi6xRp//SgKt2lqAVgKj3yqitoTAbSV7WmE 71 | P2Yc+Zhr6yBBQ1fSScm+W6Z6eCOMNt/ujBguvWv5zRNNEsmQDmeM8H0cxo6SZ+xy 72 | v53PD6Kmls+kWXU7KSWq1eHdqxAm4ZMmhdwmPUHSI+ECgYEAzaI8Q9sdWNXuUByI 73 | l+rLmW0nwwhqr44Czn/ZZUHfB3FcB0Lnap1NDApot9tRISRjqwlG2L46LbirK/TY 74 | Ue/mpzsm3a4zVTGG5I+yVbwfZiL/XEm7KabuZcBXHvqB4DoYB+ly7JNCrK+xovR1 75 | JGNV4hyG7kl+o4fTvWy6wGnpY/8CgYEAyBzEq1+aNwQEb9jhOTa+70YFLmWP3baH 76 | uJLhXQ97oargn6JjWMVKECZxvZ39OxOleI+FpMnZM7Tzfuz679ueuOW6QudQAmNU 77 | E9UQ3FITGyPZEjM5BxI6vo5qYiWLEFaWtMQCaMa4YEBa6tku2rS3p/+qHqbF2lpX 78 | w/ztF8EjnZECgYAeH/NWOYZuGkEkaVm1b8dN/cjCcLw4ZcSRffdaNzE2ROwngCyo 79 | 2MyNxASdUrrq8QrM5roDTLL3OcOR1/fM4SlYPHkwJrIMfAn39/k3SC0NaHkiiwap 80 | TnREYc4hkq9uKvSUTCXy9IvjAoYyij+TCh5t1qIJzKiJyn9Bk+k0ARAY/wKBgQCx 81 | apATQFeBn1Yvs6E7EIaHrRS65eB/OW1q/w4/a5K46r7ryRU7hu77EpqU+pWg4vI5 82 | yUU7rJmddjjLt19jeNtoIoTY/Cu7ckUAsE6ah0nZLhcuQ6uz0T2z5J/9FDwO6DYF 83 | XiKkskqVS3lP7e3UiZSqpck2E7YmuSJG6N9ryBjDgQKBgQCVQ8Qy/wSuZwW8NA7g 84 | IjWVfggvMFiWqbZjm+qTEawkwsC2fq3nNeJ0LLbTE7dS2qkUuyLyUpEniuURazLV 85 | NN7DBAFngAkKulW1kcA7dmh1fNdC+2ZmIZCrMqzfQBq3TBnNiacQg/QrYruoSoWh 86 | k+wUxPlG4BOde86KybPx+4iXQw== 87 | -----END PRIVATE KEY----- 88 | 89 | --- 90 | apiVersion: v1 91 | kind: ConfigMap 92 | metadata: 93 | name: nginx-config 94 | namespace: {{ .Release.Namespace }} 95 | data: 96 | nginx.conf: | 97 | error_log stderr; 98 | pid /tmp/nginx.pid; 99 | 100 | events { 101 | worker_connections 512; 102 | } 103 | 104 | http { 105 | client_body_temp_path /tmp/client_temp; 106 | proxy_temp_path /tmp/proxy_temp; 107 | fastcgi_temp_path /tmp/fastcgi_temp; 108 | uwsgi_temp_path /tmp/uwsgi_temp; 109 | scgi_temp_path /tmp/scgi_temp; 110 | access_log off; 111 | 112 | upstream api { 113 | server localhost:3000; 114 | } 115 | 116 | # server { 117 | # listen 8080 default_server; 118 | # return 301 https://$host$request_uri; 119 | # } 120 | server { 121 | listen 8080 default_server ssl; 122 | #listen 8080 default_server; 123 | 124 | root /usr/share/nginx/html/; 125 | index index.html; 126 | 127 | client_max_body_size 50m; 128 | 129 | ssl_certificate /etc/ssl/nginx.crt; 130 | ssl_certificate_key /etc/ssl/nginx.key; 131 | ssl_protocols TLSv1.1 TLSv1.2; 132 | 133 | location / { 134 | try_files $uri /index.html; 135 | add_header Cache-Control no-store always; 136 | autoindex off; 137 | include /etc/nginx/mime.types; 138 | } 139 | 140 | location /docs { 141 | index index.html; 142 | try_files $uri $uri/ /docs/index.html; 143 | include /etc/nginx/mime.types; 144 | } 145 | 146 | location /api/ { 147 | proxy_pass http://api/; 148 | proxy_redirect / /api/; 149 | absolute_redirect off; 150 | proxy_set_header Host $host; 151 | proxy_set_header X-Real-IP $remote_addr; 152 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 153 | proxy_set_header X-Forwarded-Host $server_name; 154 | } 155 | } 156 | } 157 | mime.types: | 158 | types { 159 | text/html html htm shtml; 160 | text/css css; 161 | text/xml xml; 162 | image/gif gif; 163 | image/jpeg jpeg jpg; 164 | application/javascript js; 165 | application/atom+xml atom; 166 | application/rss+xml rss; 167 | 168 | text/mathml mml; 169 | text/plain txt; 170 | text/vnd.sun.j2me.app-descriptor jad; 171 | text/vnd.wap.wml wml; 172 | text/x-component htc; 173 | 174 | image/avif avif; 175 | image/png png; 176 | image/svg+xml svg svgz; 177 | image/tiff tif tiff; 178 | image/vnd.wap.wbmp wbmp; 179 | image/webp webp; 180 | image/x-icon ico; 181 | image/x-jng jng; 182 | image/x-ms-bmp bmp; 183 | 184 | font/woff woff; 185 | font/woff2 woff2; 186 | 187 | application/java-archive jar war ear; 188 | application/json json; 189 | application/mac-binhex40 hqx; 190 | application/msword doc; 191 | application/pdf pdf; 192 | application/postscript ps eps ai; 193 | application/rtf rtf; 194 | application/vnd.apple.mpegurl m3u8; 195 | application/vnd.google-earth.kml+xml kml; 196 | application/vnd.google-earth.kmz kmz; 197 | application/vnd.ms-excel xls; 198 | application/vnd.ms-fontobject eot; 199 | application/vnd.ms-powerpoint ppt; 200 | application/vnd.oasis.opendocument.graphics odg; 201 | application/vnd.oasis.opendocument.presentation odp; 202 | application/vnd.oasis.opendocument.spreadsheet ods; 203 | application/vnd.oasis.opendocument.text odt; 204 | application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; 205 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; 206 | application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; 207 | application/vnd.wap.wmlc wmlc; 208 | application/wasm wasm; 209 | application/x-7z-compressed 7z; 210 | application/x-cocoa cco; 211 | application/x-java-archive-diff jardiff; 212 | application/x-java-jnlp-file jnlp; 213 | application/x-makeself run; 214 | application/x-perl pl pm; 215 | application/x-pilot prc pdb; 216 | application/x-rar-compressed rar; 217 | application/x-redhat-package-manager rpm; 218 | application/x-sea sea; 219 | application/x-shockwave-flash swf; 220 | application/x-stuffit sit; 221 | application/x-tcl tcl tk; 222 | application/x-x509-ca-cert der pem crt; 223 | application/x-xpinstall xpi; 224 | application/xhtml+xml xhtml; 225 | application/xspf+xml xspf; 226 | application/zip zip; 227 | 228 | application/octet-stream bin exe dll; 229 | application/octet-stream deb; 230 | application/octet-stream dmg; 231 | application/octet-stream iso img; 232 | application/octet-stream msi msp msm; 233 | 234 | audio/midi mid midi kar; 235 | audio/mpeg mp3; 236 | audio/ogg ogg; 237 | audio/x-m4a m4a; 238 | audio/x-realaudio ra; 239 | 240 | video/3gpp 3gpp 3gp; 241 | video/mp2t ts; 242 | video/mp4 mp4; 243 | video/mpeg mpeg mpg; 244 | video/quicktime mov; 245 | video/webm webm; 246 | video/x-flv flv; 247 | video/x-m4v m4v; 248 | video/x-mng mng; 249 | video/x-ms-asf asx asf; 250 | video/x-ms-wmv wmv; 251 | video/x-msvideo avi; 252 | } 253 | --- 254 | apiVersion: v1 255 | kind: ConfigMap 256 | metadata: 257 | name: db-coninfo 258 | namespace: {{ .Release.Namespace }} 259 | data: 260 | CORE_DB_DATABASE: migrator 261 | CORE_DB_HOST: localhost 262 | CORE_EXIT_ON_DATABASE_INITIALIZATION_ERROR: "true" 263 | CORE_PORT: "8080" 264 | NGINX_ENTRYPOINT_QUIET_LOGS: "1" -------------------------------------------------------------------------------- /helm/professional-edition/templates/configmaps.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: initdb.sh 5 | namespace: {{ .Release.Namespace }} 6 | data: 7 | initdb.sh: | 8 | #!/bin/bash 9 | 10 | set -e 11 | 12 | DATABASE="migrator" 13 | SCHEMA="cybertec_migrator" 14 | 15 | psql -U postgres -v ON_ERROR_STOP=1 <<-EOF 16 | CREATE DATABASE ${DATABASE}; 17 | EOF 18 | 19 | psql -U postgres -v ON_ERROR_STOP=1 --dbname "${DATABASE}" <<-EOF 20 | CREATE SCHEMA ${SCHEMA}; 21 | EOF 22 | --- 23 | apiVersion: v1 24 | kind: ConfigMap 25 | metadata: 26 | name: nginx-cert 27 | namespace: {{ .Release.Namespace }} 28 | data: 29 | nginx.cert: | 30 | -----BEGIN CERTIFICATE----- 31 | MIIDazCCAlOgAwIBAgIUQH0gHfDzbja1DEZa9y5jRpsh2jowDQYJKoZIhvcNAQEL 32 | BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM 33 | GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMzAyMDYxNDA1MjhaFw0yMzAz 34 | MDgxNDA1MjhaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw 35 | HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB 36 | AQUAA4IBDwAwggEKAoIBAQCgvdrNeOgt2TJgYanm5elBy3fYfTqayAIETo6AWajQ 37 | B8botE8HMGzsXf3qHLUkUOPtrSxj2Hr4+NDL7dpCBHtVKbSWP37w9Sf6eD89Yv5T 38 | ZcjQr2Oes07ifx1Ow494DuIshlwgNxtTpCHgpQHgMYr/NhGJyJeXuEaEbsVvez9i 39 | Byhg5a94P7VAr5AVID+6j0KmixHCOSDXSq+X417YWfrGu1ahZDelaAqe8Nl2HKFW 40 | YKs056/OKL7q5oFu2S8bx00WOwHwDK5K6+7BLu8w98PLXktjZzQxFZw4uEIBy/Gw 41 | /gIamPM0dGeVqgVEW4j8KenKmMhlugs8q9LURiUKYgZvAgMBAAGjUzBRMB0GA1Ud 42 | DgQWBBQQT00HcRQHftlZi8EuFkqwCTYxoTAfBgNVHSMEGDAWgBQQT00HcRQHftlZ 43 | i8EuFkqwCTYxoTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCH 44 | V7noTAsRb3fOqwiKS2eGu93EWkrLopD82h8ugoibKV3R/Ck57JETmAtypQiVtBrc 45 | zSBAdSemMHfWXFK88OgSFVBMZF2XFb5TMxyKALvicNSWYosRhRhq/fTCQNlK351H 46 | Q9xiPwpJLlpG3G4XApqLiUifWYWQsAntAKG+ts4DsLhfzrjcOziQpPFvcjfrQkwO 47 | mZFibkVOkjgBUqArt1J/mZNUXuSlU6rzX91HmRHCMS1Eg1jA37XiBhmvrS55mq3/ 48 | BwEGI1cZPl7c79ngl0WXiwDnvriDKOC5tSgWho5WcUQvC0kFFeWJZB2ZdmhwlneI 49 | cMxgJGsMdizznEzPSAeD 50 | -----END CERTIFICATE----- 51 | 52 | --- 53 | apiVersion: v1 54 | kind: ConfigMap 55 | metadata: 56 | name: nginx-cert-key 57 | namespace: {{ .Release.Namespace }} 58 | data: 59 | nginx.key: | 60 | -----BEGIN PRIVATE KEY----- 61 | MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCgvdrNeOgt2TJg 62 | Yanm5elBy3fYfTqayAIETo6AWajQB8botE8HMGzsXf3qHLUkUOPtrSxj2Hr4+NDL 63 | 7dpCBHtVKbSWP37w9Sf6eD89Yv5TZcjQr2Oes07ifx1Ow494DuIshlwgNxtTpCHg 64 | pQHgMYr/NhGJyJeXuEaEbsVvez9iByhg5a94P7VAr5AVID+6j0KmixHCOSDXSq+X 65 | 417YWfrGu1ahZDelaAqe8Nl2HKFWYKs056/OKL7q5oFu2S8bx00WOwHwDK5K6+7B 66 | Lu8w98PLXktjZzQxFZw4uEIBy/Gw/gIamPM0dGeVqgVEW4j8KenKmMhlugs8q9LU 67 | RiUKYgZvAgMBAAECggEBAJMazQhoE0wKTvEnz/6xABSnqellSeHnEvlwDzflVfn0 68 | dBP5F64Dolt69WpwlVJD+SRF7K7/qiL6StOmvKzYPyrEPTGXsIvCQLEXpQB//TLD 69 | ntFlAa12ecYNAPxZOo5sSI7o85zD8e1M83gMargLfyJrEAfhnOJL0bVXTrbkuy/w 70 | 263vlAN7+oaYW3v6UCMX0TmpNbsDfbi6xRp//SgKt2lqAVgKj3yqitoTAbSV7WmE 71 | P2Yc+Zhr6yBBQ1fSScm+W6Z6eCOMNt/ujBguvWv5zRNNEsmQDmeM8H0cxo6SZ+xy 72 | v53PD6Kmls+kWXU7KSWq1eHdqxAm4ZMmhdwmPUHSI+ECgYEAzaI8Q9sdWNXuUByI 73 | l+rLmW0nwwhqr44Czn/ZZUHfB3FcB0Lnap1NDApot9tRISRjqwlG2L46LbirK/TY 74 | Ue/mpzsm3a4zVTGG5I+yVbwfZiL/XEm7KabuZcBXHvqB4DoYB+ly7JNCrK+xovR1 75 | JGNV4hyG7kl+o4fTvWy6wGnpY/8CgYEAyBzEq1+aNwQEb9jhOTa+70YFLmWP3baH 76 | uJLhXQ97oargn6JjWMVKECZxvZ39OxOleI+FpMnZM7Tzfuz679ueuOW6QudQAmNU 77 | E9UQ3FITGyPZEjM5BxI6vo5qYiWLEFaWtMQCaMa4YEBa6tku2rS3p/+qHqbF2lpX 78 | w/ztF8EjnZECgYAeH/NWOYZuGkEkaVm1b8dN/cjCcLw4ZcSRffdaNzE2ROwngCyo 79 | 2MyNxASdUrrq8QrM5roDTLL3OcOR1/fM4SlYPHkwJrIMfAn39/k3SC0NaHkiiwap 80 | TnREYc4hkq9uKvSUTCXy9IvjAoYyij+TCh5t1qIJzKiJyn9Bk+k0ARAY/wKBgQCx 81 | apATQFeBn1Yvs6E7EIaHrRS65eB/OW1q/w4/a5K46r7ryRU7hu77EpqU+pWg4vI5 82 | yUU7rJmddjjLt19jeNtoIoTY/Cu7ckUAsE6ah0nZLhcuQ6uz0T2z5J/9FDwO6DYF 83 | XiKkskqVS3lP7e3UiZSqpck2E7YmuSJG6N9ryBjDgQKBgQCVQ8Qy/wSuZwW8NA7g 84 | IjWVfggvMFiWqbZjm+qTEawkwsC2fq3nNeJ0LLbTE7dS2qkUuyLyUpEniuURazLV 85 | NN7DBAFngAkKulW1kcA7dmh1fNdC+2ZmIZCrMqzfQBq3TBnNiacQg/QrYruoSoWh 86 | k+wUxPlG4BOde86KybPx+4iXQw== 87 | -----END PRIVATE KEY----- 88 | 89 | --- 90 | apiVersion: v1 91 | kind: ConfigMap 92 | metadata: 93 | name: nginx-config 94 | namespace: {{ .Release.Namespace }} 95 | data: 96 | nginx.conf: | 97 | error_log stderr; 98 | pid /tmp/nginx.pid; 99 | 100 | events { 101 | worker_connections 512; 102 | } 103 | 104 | http { 105 | client_body_temp_path /tmp/client_temp; 106 | proxy_temp_path /tmp/proxy_temp; 107 | fastcgi_temp_path /tmp/fastcgi_temp; 108 | uwsgi_temp_path /tmp/uwsgi_temp; 109 | scgi_temp_path /tmp/scgi_temp; 110 | access_log off; 111 | 112 | upstream api { 113 | server localhost:3000; 114 | } 115 | 116 | # server { 117 | # listen 8080 default_server; 118 | # return 301 https://$host$request_uri; 119 | # } 120 | server { 121 | listen 8080 default_server ssl; 122 | #listen 8080 default_server; 123 | 124 | root /usr/share/nginx/html/; 125 | index index.html; 126 | 127 | client_max_body_size 50m; 128 | 129 | ssl_certificate /etc/ssl/nginx.crt; 130 | ssl_certificate_key /etc/ssl/nginx.key; 131 | ssl_protocols TLSv1.1 TLSv1.2; 132 | 133 | location / { 134 | try_files $uri /index.html; 135 | add_header Cache-Control no-store always; 136 | autoindex off; 137 | include /etc/nginx/mime.types; 138 | } 139 | 140 | location /docs { 141 | index index.html; 142 | try_files $uri $uri/ /docs/index.html; 143 | include /etc/nginx/mime.types; 144 | } 145 | 146 | location /api/ { 147 | proxy_pass http://api/; 148 | proxy_redirect / /api/; 149 | absolute_redirect off; 150 | proxy_set_header Host $host; 151 | proxy_set_header X-Real-IP $remote_addr; 152 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 153 | proxy_set_header X-Forwarded-Host $server_name; 154 | } 155 | } 156 | } 157 | mime.types: | 158 | types { 159 | text/html html htm shtml; 160 | text/css css; 161 | text/xml xml; 162 | image/gif gif; 163 | image/jpeg jpeg jpg; 164 | application/javascript js; 165 | application/atom+xml atom; 166 | application/rss+xml rss; 167 | 168 | text/mathml mml; 169 | text/plain txt; 170 | text/vnd.sun.j2me.app-descriptor jad; 171 | text/vnd.wap.wml wml; 172 | text/x-component htc; 173 | 174 | image/avif avif; 175 | image/png png; 176 | image/svg+xml svg svgz; 177 | image/tiff tif tiff; 178 | image/vnd.wap.wbmp wbmp; 179 | image/webp webp; 180 | image/x-icon ico; 181 | image/x-jng jng; 182 | image/x-ms-bmp bmp; 183 | 184 | font/woff woff; 185 | font/woff2 woff2; 186 | 187 | application/java-archive jar war ear; 188 | application/json json; 189 | application/mac-binhex40 hqx; 190 | application/msword doc; 191 | application/pdf pdf; 192 | application/postscript ps eps ai; 193 | application/rtf rtf; 194 | application/vnd.apple.mpegurl m3u8; 195 | application/vnd.google-earth.kml+xml kml; 196 | application/vnd.google-earth.kmz kmz; 197 | application/vnd.ms-excel xls; 198 | application/vnd.ms-fontobject eot; 199 | application/vnd.ms-powerpoint ppt; 200 | application/vnd.oasis.opendocument.graphics odg; 201 | application/vnd.oasis.opendocument.presentation odp; 202 | application/vnd.oasis.opendocument.spreadsheet ods; 203 | application/vnd.oasis.opendocument.text odt; 204 | application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; 205 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; 206 | application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; 207 | application/vnd.wap.wmlc wmlc; 208 | application/wasm wasm; 209 | application/x-7z-compressed 7z; 210 | application/x-cocoa cco; 211 | application/x-java-archive-diff jardiff; 212 | application/x-java-jnlp-file jnlp; 213 | application/x-makeself run; 214 | application/x-perl pl pm; 215 | application/x-pilot prc pdb; 216 | application/x-rar-compressed rar; 217 | application/x-redhat-package-manager rpm; 218 | application/x-sea sea; 219 | application/x-shockwave-flash swf; 220 | application/x-stuffit sit; 221 | application/x-tcl tcl tk; 222 | application/x-x509-ca-cert der pem crt; 223 | application/x-xpinstall xpi; 224 | application/xhtml+xml xhtml; 225 | application/xspf+xml xspf; 226 | application/zip zip; 227 | 228 | application/octet-stream bin exe dll; 229 | application/octet-stream deb; 230 | application/octet-stream dmg; 231 | application/octet-stream iso img; 232 | application/octet-stream msi msp msm; 233 | 234 | audio/midi mid midi kar; 235 | audio/mpeg mp3; 236 | audio/ogg ogg; 237 | audio/x-m4a m4a; 238 | audio/x-realaudio ra; 239 | 240 | video/3gpp 3gpp 3gp; 241 | video/mp2t ts; 242 | video/mp4 mp4; 243 | video/mpeg mpeg mpg; 244 | video/quicktime mov; 245 | video/webm webm; 246 | video/x-flv flv; 247 | video/x-m4v m4v; 248 | video/x-mng mng; 249 | video/x-ms-asf asx asf; 250 | video/x-ms-wmv wmv; 251 | video/x-msvideo avi; 252 | } 253 | --- 254 | apiVersion: v1 255 | kind: ConfigMap 256 | metadata: 257 | name: db-coninfo 258 | namespace: {{ .Release.Namespace }} 259 | data: 260 | CORE_DB_DATABASE: migrator 261 | CORE_DB_HOST: localhost 262 | CORE_EXIT_ON_DATABASE_INITIALIZATION_ERROR: "true" 263 | CORE_PORT: "8080" 264 | NGINX_ENTRYPOINT_QUIET_LOGS: "1" --------------------------------------------------------------------------------