fix vm vagrant
This commit is contained in:
parent
b73f123b5f
commit
4d22bfb766
@ -1,10 +1,10 @@
|
|||||||
# commun fonctions for KAZ
|
# commun fonctions for KAZ
|
||||||
|
|
||||||
#TODO; toutes les fonctions ci-dessous devraient être commentées
|
#TODO; toutes les fonctions ci-dessous devraient être commentées
|
||||||
|
|
||||||
#KI : françois
|
#KI : françois
|
||||||
#KOI : tout un tas de trucs utiles pour la gestion de l'infra kaz (à mettre dans chaque script)
|
#KOI : tout un tas de trucs utiles pour la gestion de l'infra kaz (à mettre dans chaque script)
|
||||||
#KAN :
|
#KAN :
|
||||||
# maj le 27/01/2024 by FAB: recherche de tous les srv kaz dispo (via le DNS)
|
# maj le 27/01/2024 by FAB: recherche de tous les srv kaz dispo (via le DNS)
|
||||||
# maj le 15/04/2024 by FAB: correction getPahekoOrgaList
|
# maj le 15/04/2024 by FAB: correction getPahekoOrgaList
|
||||||
|
|
||||||
@ -139,13 +139,13 @@ getAvailableOrgas () {
|
|||||||
|
|
||||||
#en entrée
|
#en entrée
|
||||||
SITE_DST="$1"
|
SITE_DST="$1"
|
||||||
|
|
||||||
if [ -n "${SITE_DST}" ];then
|
if [ -n "${SITE_DST}" ];then
|
||||||
ssh -p 2201 root@${SITE_DST}.${domain} "ls \"${KAZ_COMP_DIR}\" | grep -- \"^.*-orga$\""
|
ssh -p 2201 root@${SITE_DST}.${domain} "ls \"${KAZ_COMP_DIR}\" | grep -- \"^.*-orga$\""
|
||||||
else
|
else
|
||||||
ls "${KAZ_COMP_DIR}" | grep -- "^.*-orga$"
|
ls "${KAZ_COMP_DIR}" | grep -- "^.*-orga$"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getAvailableServices () {
|
getAvailableServices () {
|
||||||
@ -224,10 +224,10 @@ waitUrl () {
|
|||||||
# $1 URL to waitfor
|
# $1 URL to waitfor
|
||||||
# $2 timeout en secondes (optional)
|
# $2 timeout en secondes (optional)
|
||||||
starttime=$(date +%s)
|
starttime=$(date +%s)
|
||||||
if [[ $(curl --connect-timeout 2 -s -D - "$1" -o /dev/null 2>/dev/null | head -n1) != *[23]0[0-9]* ]]; then
|
if [[ $(curl -k --connect-timeout 2 -s -D - "$1" -o /dev/null 2>/dev/null | head -n1) != *[23]0[0-9]* ]]; then
|
||||||
printKazMsg "service not available ($1). Please wait..."
|
printKazMsg "service not available ($1). Please wait..."
|
||||||
echo curl --connect-timeout 2 -s -D - "$1" -o /dev/null \| head -n1
|
echo curl -k --connect-timeout 2 -s -D - "$1" -o /dev/null \| head -n1
|
||||||
while [[ $(curl --connect-timeout 2 -s -D - "$1" -o /dev/null 2>/dev/null | head -n1) != *[23]0[0-9]* ]]
|
while [[ $(curl -k --connect-timeout 2 -s -D - "$1" -o /dev/null 2>/dev/null | head -n1) != *[23]0[0-9]* ]]
|
||||||
do
|
do
|
||||||
sleep 5
|
sleep 5
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
@ -244,7 +244,7 @@ waitUrl () {
|
|||||||
waitContainerHealthy () {
|
waitContainerHealthy () {
|
||||||
# $1 ContainerName
|
# $1 ContainerName
|
||||||
# $2 timeout en secondes (optional)
|
# $2 timeout en secondes (optional)
|
||||||
|
|
||||||
healthy="false"
|
healthy="false"
|
||||||
starttime=$(date +%s)
|
starttime=$(date +%s)
|
||||||
running="false"
|
running="false"
|
||||||
@ -270,7 +270,7 @@ waitContainerHealthy () {
|
|||||||
waitContainerRunning () {
|
waitContainerRunning () {
|
||||||
# $1 ContainerName
|
# $1 ContainerName
|
||||||
# $2 timeout en secondes (optional)
|
# $2 timeout en secondes (optional)
|
||||||
|
|
||||||
starttime=$(date +%s)
|
starttime=$(date +%s)
|
||||||
running="false"
|
running="false"
|
||||||
[[ $(docker ps -f name="$1" | grep -w "$1") ]] && running="true"
|
[[ $(docker ps -f name="$1" | grep -w "$1") ]] && running="true"
|
||||||
|
11
dockers/traefik/conf/allow_ip.yml.dist
Normal file
11
dockers/traefik/conf/allow_ip.yml.dist
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
test-ipallowlist:
|
||||||
|
ipallowlist:
|
||||||
|
sourceRange:
|
||||||
|
# tlm est autorisé
|
||||||
|
- "0.0.0.0/0"
|
||||||
|
test-adminipallowlist:
|
||||||
|
ipallowlist:
|
||||||
|
sourceRange:
|
||||||
|
- "127.0.0.1"
|
@ -1,18 +0,0 @@
|
|||||||
http:
|
|
||||||
middlewares:
|
|
||||||
ipwhitelist:
|
|
||||||
ipWhiteList:
|
|
||||||
sourceRange:
|
|
||||||
- "192.168.0.0/16"
|
|
||||||
- "172.16.0.0/12"
|
|
||||||
- "127.0.0.0/8"
|
|
||||||
- "10.0.0.0/8"
|
|
||||||
- "0.0.0.0/0"
|
|
||||||
adminipwhitelist:
|
|
||||||
ipWhiteList:
|
|
||||||
sourceRange:
|
|
||||||
- "192.168.0.0/16"
|
|
||||||
- "172.16.0.0/12"
|
|
||||||
- "127.0.0.0/8"
|
|
||||||
- "10.0.0.0/8"
|
|
||||||
- "0.0.0.0/0"
|
|
6
dockers/traefik/conf/cert.yml.dist
Normal file
6
dockers/traefik/conf/cert.yml.dist
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
tls:
|
||||||
|
stores:
|
||||||
|
default:
|
||||||
|
defaultCertificate:
|
||||||
|
certFile: /etc/traefik/fullchain.pem
|
||||||
|
keyFile: /etc/traefik/privkey.pem
|
16
dockers/traefik/first.sh
Normal file
16
dockers/traefik/first.sh
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SERV_DIR=$(cd $(dirname $0); pwd)
|
||||||
|
KAZ_ROOT=$(cd $(dirname $0)/../..; pwd)
|
||||||
|
. "${KAZ_ROOT}/bin/.commonFunctions.sh"
|
||||||
|
setKazVars
|
||||||
|
|
||||||
|
cd $(dirname $0)
|
||||||
|
. "${DOCKERS_ENV}"
|
||||||
|
|
||||||
|
|
||||||
|
printKazMsg "\n *** Premier lancement de Traefik : Mise en place"
|
||||||
|
|
||||||
|
[[ -f "conf/allow_ip.yml" ]] || cp "conf/allow_ip.yml.dist" "conf/allow_ip.yml"
|
||||||
|
cp /etc/letsencrypt/live/${domain}/{fullchain.pem,privkey.pem} conf/
|
||||||
|
[[ -f "conf/cert.yml" ]] || cp "conf/cert.yml.dist" "conf/cert.yml"
|
Loading…
x
Reference in New Issue
Block a user