Repository Public
1#!/bin/bash2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : KA Maps Engine8# File : server/pipeline/env.sh9# Module : server10# Repository : https://git.spboucher.ai/ka-maps-engine11# Created : 2026-12-0112# Last Modified : 2026-12-0113#14# Author : Simon-Pierre Boucher15# Position : Professor of Finance16# Institution : Université du Québec en Outaouais (UQO)17# Organization : SP Boucher18# Website : https://spboucher.ai19# Git : https://git.spboucher.ai20#21# Preferred Contact: support@spboucher.ai22# Technical Contact: dev@spboucher.ai23# Security/Admin : admin@spboucher.ai24#25# Copyright (c) 202626# Simon-Pierre Boucher27# All rights reserved where applicable. This file is governed by the28# applicable project license, copyright notices and relevant law.29# Existing third-party rights and notices remain unaffected.30#31# License : None specified (no license file in this repository)32#33# Do not embed credentials, private keys, access tokens,34# certificates or confidential personal information.35#36# =============================================================================37# END OF SP BOUCHER SOURCE HEADER38# =============================================================================3940# KA Maps pipeline — environnement commun. À sourcer.41set -euo pipefail42export KM_ROOT=${KM_ROOT:-/var/lib/kamaps}43export KM_SRC=$KM_ROOT/src44export KM_LOG=${KM_LOG:-/var/log/kamaps}45export KM_PIPE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"46export KM_THREADS=${KM_THREADS:-$(nproc)}47# Identifiants du rôle propriétaire (root:kamaps 640).48if [ -r /etc/kamaps/db-owner.env ]; then49 set -a; . /etc/kamaps/db-owner.env; set +a50else51 eval "$(sudo cat /etc/kamaps/db-owner.env | sed 's/^/export /')"52fi53export KM_DB_URL54log() { echo "$(date -u +%FT%TZ) $*"; }55psqlq() { psql -X -q -v ON_ERROR_STOP=1 "$KM_DB_URL" "$@"; }56# Région chargée à pleine résolution pour les océans (EPSG:4326) : Québec + voisinage.57export KM_REGION_BBOX="-100 38 -45 66"58