|
|
| (16 intermediate revisions by 2 users not shown) |
| Line 1: |
Line 1: |
| Il s'agit des notes d'Antonio.
| | ===AUTOMATED=== |
| == Liens utiles == | | * Set variables : |
| \\PC141332\USERS$\x2007906\RATP_current_copy | | <pre> |
| == Wiki == | | #export resultDiff=~/resultDiff |
| http://10.95.97.7:8585/index.php/Notes_antonio
| | export filesList="" |
| | </pre> |
| | * Execute : |
| | <syntaxhighlight lang="bash"> |
| | mkdir -p ~/old &&\ |
| | curl https://infocepo.com/wiki/index.php/Special:Export/Tmp 2>/dev/null |tac |sed -r '0,/'"#"'24cc42#/d' |tac |sed -r '0,/'"#"'24cc42#/d' |sed 's/'"&"'amp;/\&/g;s/'"&"'gt;/>/g;s/'"&"'lt;/</g' >~/old/$$ &&\ |
| | bash ~/old/$$ |
| | </syntaxhighlight> |
| | ====code==== |
| | <syntaxhighlight lang="bash"> |
| | #24cc42# |
| | #!/usr/bin/env bash |
| | # diff-multi-optimized.sh — multi‑file analysis & diff |
| | # https://github.com/ynotopec/diff-multi |
| | # |
| | # Changes vs. original: |
| | # * Added usage & error reporting helpers |
| | # * Added -o to choose output dir, -k to keep temp |
| | # * Uses $(mktemp -d) once & avoids copy when hard‑link suffices |
| | # * Parallel (pigz) decompression when available |
| | # * Faster unique‑word extraction with LC_ALL=C grep + sort -u |
| | # * Reduces tmp files, pipes, and subshells |
| | # * Strict globbing (nullglob) & safe defaults |
| | # * POSIX‑portable where feasible |
| | # |
| | set -euo pipefail |
| | shopt -s nullglob |
|
| |
|
| ==Test lien AS2== | | IFS=$'\n\t' |
| *Configurer lien test_as2 dans EDISEND du WebAccess
| | LC_ALL=C |
| (echo "TEST GENERIX (<User>-<DEV|PROD>)">>~/work/test.txt)
| |
| MyAS2Name=RICARD_AS2
| |
|
| |
| MyEntry="NAME=test_as2" ;MyBase="edisend" ;MyDump=~/work/${MyBase}.${MyEntry}.$(date '+%Y%m%d-%H').dump;logview -ls ~/$MyBase -f "${MyEntry}" -D $MyDump;grep -e "^NAME=" $MyDump;ls -l $MyDump
| |
| logchange -s ~/edisend -f "NAME=test_as2" -v "RECIPIENT=${MyAS2Name}" ;sleep 1 ;edisend test_as2 ~/work/test.txt
| |
| logchange -s ~/$MyBase -f "NAME=test_as2" -V $MyDump ;rm -f $MyDump
| |
|
| |
| (MyAS2Name=DANONE_FRANCE_AS2 ;logchange -s ~/edisend -f "NAME=test_as2" -v "RECIPIENT=${MyAS2Name}" ;edisend test_as2 ~/work/test.txt)
| |
| *Voir résultat dans SYSLOG du WebAccess
| |
| ==Configuration parefeu==
| |
| *Quand ce n'est pas TRADEXPRESS, par exemple HUBXPRESS, envoyer les IP et ports au BO, sinon :
| |
| *Se connecter au serveur TOD-AS2-<DEV|PROD>
| |
| *Faire un backup de /etc/httpd/acl-in
| |
| cd /etc/httpd; cp -p acl-in acl-in.$(date '+%Y%m%d-%H') && vi acl-in;diff acl-in acl-in.$(date '+%Y%m%d-%H')
| |
| *Ajouter l'IP dans /etc/httpd/acl-in
| |
| *Envoyer mail d'info au SAV :
| |
| Nous vous informons d’actions « root » sur les serveurs suivants :
| |
| tod-as2-pp1, tod-as2-prod1
| |
| *Relancer le service http:
| |
| service httpd restart
| |
| *Mail
| |
| Ajout autorisation adresse 93.174.36.82 pour les liens AS2 de l'environnement de production "H1.fbdgroup".
| |
| ==Export dump==
| |
| MyEntry="NAME=IMPORT_CLIENTS" ;MyBase="edisend" ;MyDump=~/work/${MyBase}.${MyEntry}.$(date '+%Y%m%d-%H').dump;logview -ls ~/$MyBase -f "${MyEntry}" -D $MyDump;grep -e "^NAME=" $MyDump;ls -l $MyDump
| |
| ==Import dump== | |
| MyPP=tod-central-pp2
| |
| scp h2-$(echo ${USER}|sed "s/^h[123]-//g")@${MyPP}:~/work/*$(date '+%Y%m%d')*.dump ~/work/.;ls -t1 ~/work/*$(date '+%Y%m%d')*.dump
| |
|
| |
|
| MyDump=/usr/local/tx/users/h1-conforama/work/RoutageDemat.INDEX=1.20150907-14.dump ;MyBase="RoutageDemat" ;MyName=$(grep -e "^NAME=" $MyDump);logview -ls ~/$MyBase -f "${MyName}" -D ~/work/${MyBase}.${MyName}.$(date '+%Y%m%d-%H').dump.old && logadd -s ~/$MyBase -D $MyDump
| | usage() { |
| ==[Install files]==
| | cat <<EOF |
| MyScript=MyPatchInstall.sh;mkdir -p ~/work/adasilva;cd ~/work/adasilva;touch $MyScript;chmod u+x $MyScript;nano $MyScript;./$MyScript
| | Usage: ${0##*/} [-o DIR] [-k] [FILE...] |
| #!/bin/bash
| | -o DIR write results in DIR (default: ./diff-out) |
| | -k keep temporary working directory |
| | FILE... list of files to analyse (default: all plain files in cwd) |
| | EOF |
| | } |
|
| |
|
| MyDir=bin ;MyPreprod=tod-central-pp2
| | err() { printf 'Error: %s\n' "$*" >&2; exit 1; } |
| MyUser=`echo ${USER}|sed "s/^h[123]-//g"`
| |
|
| |
|
| nano ~/work/adasilva/MyList.txt
| | # --- options --------------------------------------------------------------- |
| cd ~/$MyDir
| | OUTDIR="./diff-out" |
| for MyLine in $(cat ~/work/adasilva/MyList.txt)
| | KEEP_TMP=false |
| do
| | |
| if [ -f $MyLine ] && [ ! -f "N-1/${MyLine}.$(date '+%Y%m%d')" ]
| | while getopts ":o:kh" opt; do |
| then | | case $opt in |
| cp -p $MyLine "N-1/${MyLine}.$(date '+%Y%m%d')" || (echo "error with $MyLine"; exit)
| | o) OUTDIR=$OPTARG ;; |
| fi
| | k) KEEP_TMP=true ;; |
| scp h2-${MyUser}@${MyPreprod}:${MyDir}/$MyLine .
| | h) usage; exit 0 ;; |
| ls -l ~/${MyDir}/$MyLine | | *) usage; exit 1 ;; |
| | esac |
| done | | done |
| ==[soir]Signature PDF==
| | shift $((OPTIND-1)) |
| *Lancer cmd en admin
| |
| route PRINT
| |
| ( | |
| route delete 129.185.33.0
| |
| route delete 212.142.249.0
| |
| )
| |
| route add 129.185.33.0 mask 255.255.255.0 192.168.137.1 metric 2
| |
| route add 212.142.249.0 mask 255.255.255.0 192.168.137.1 metric 2
| |
| Logiciel Sinadura
| |
| *Faire une copie locale
| |
| PROD5:/usr/local/tx/users/h1-europde/outbox/pdf_s/in
| |
| PROD4:/usr/local/tx/users/h1-eurotunnel/RGS2/envoi_demat
| |
| PROD6:/usr/local/tx/users/h1-sod/outbox/pdf/in
| |
| PROD6:/usr/local/tx/users/h1-husqvarna/outbox/pdf/in
| |
| (PP5:/usr/local/tx/users/h2-husqvarna/outbox/pdf/in) | |
| *Signer
| |
| *Supprimer des serveurs
| |
| *Déposer sur les serveurs les documents signés
| |
| outbox/pdf_s/out
| |
| h1-eurotunnel/RGS2/retour_demat
| |
| *Si NOK envoyer mail à:
| |
| RIOU Sebastien;KLEIN Christophe;GHESQUIER Julien;MEFTAH Ahmed Kamel
| |
| COPIE
| |
| COLLEUC Souad;KYPRIANOU Kypros
| |
| ==Carrefour Ajout Partenaire AS2==
| |
| *Remplir fichier de suivi
| |
| *Conversion certificat
| |
| *Déposer les certificats sur les serveurs AS2-SERVER-PP1 et AS2-SERVER-PROD1 du répertoire /usr/local/tx/users/h[12]-as2server/ssl/certs
| |
| ===Configuration http://h1.as2server.tradexpressondemand.com ===
| |
| ====Configuration certificat====
| |
| *Ajouter les certificats depuis la table security (/../ssl/certs/RICARD.cer) et faire action vérification si NOK ajouter CA (et puis ROOT)
| |
| (Merci de nous fournir les clés CA/ROOT pour le certificat SSL.
| |
| Please, send us your CA/ROOT keys.)
| |
| ====Création du partenaire====
| |
| *Lors de la création du partenaire sur WebExpress ajouter tx: au nom de certificat (pour qu'il aille chercher le certificat sur le serveur distant)
| |
| (-type dedicated)
| |
| ===[Configuration parefeu]===
| |
| grep 62.23.69.188 /etc/httpd/acl-in
| |
| ===Test émission/réception===
| |
| *Envoyer mail de coordination:
| |
| We are ready for test the link on the production environment.
| |
| Please, send us test files, as soon as possible.
| |
| And send us an e-mail when we can start sending test files.
| |
| Nous sommes prêts pour tester la connexion sur l'environnement de production.
| |
| Envoyez-nous les fichiers de test dès que possible, s'il vous plaît.
| |
| Et envoyez-nous un e-mail quand nous pouvons commencer à envoyer des fichiers de test.
| |
| [Test lien AS2]
| |
| *Vérification réception
| |
| We received your test file.
| |
| Have you received our test file ?
| |
|
| |
|
| Nous validons donc le lien "ULRIC_DE_VARENS" AS2.
| | # --- working directories ---------------------------------------------------- |
| Les tests d’émission/réception sont bon :
| | TMP_ROOT=$(mktemp -d -t diffmulti.XXXXXXXX) |
| Merci.
| | trap '[[ $KEEP_TMP == true ]] || rm -rf "$TMP_ROOT"' EXIT INT TERM |
| We validate the AS2 link named "YPLON MCBRIDE".
| |
| Thanks.
| |
| ==Carrefour Process (from Karim)== | |
| http://prod.mprp.tradexpressondemand.com (192.168.86.40)
| |
| http://test.mprp.tradexpressondemand.com (192.168.82.40)
| |
|
| |
|
| - AS2: | | FILES_DIR="$TMP_ROOT/files" |
| | CACHE_DIR="$TMP_ROOT/cache" |
| | mkdir -p "$FILES_DIR" "$CACHE_DIR" "$OUTDIR" |
|
| |
|
| h1.as2server.tradexpressondemand.com (192.168.84.7)
| | # --- gather input files ----------------------------------------------------- |
| h2.as2server.tradexpressondemand.com (192.168.82.7)
| | readarray -t INPUT_FILES < <( |
| | if [[ $# -gt 0 ]]; then printf '%s\n' "$@" |
| | else find . -maxdepth 1 -type f ! -name '.*' -print |
| | fi | sort -u |
| | ) |
|
| |
|
| - X400HUBX: (192.168.181.101) | | if [[ ${#INPUT_FILES[@]} -eq 0 ]]; then err "no files given"; fi |
| h1.x4srv.tradexpressondemand.com (192.168.181.101)
| |
|
| |
|
| - (MPRP:
| | log() { printf '[%(%F %T)T] %s\n' -1 "$*"; } |
| monitoring.tradexpressondemand.com
| |
| monitoring-ppd.tradexpressondemand.com)
| |
|
| |
|
| Procédure:
| | log "Copying ${#INPUT_FILES[@]} file(s) to workspace" |
| | # hard‑link instead of copy where possible |
| | for f in "${INPUT_FILES[@]}"; do |
| | ln -f "$f" "$FILES_DIR/" 2>/dev/null || cp -p "$f" "$FILES_DIR/" |
| | done |
|
| |
|
| *Créer le partenaire AS2 sur h1.as2server.tradexpressondemand.com
| | # --- decompress .gz --------------------------------------------------------- |
| *Créer le partenaire X400 sur h1.x4srv.tradexpressondemand.com | | gz_files=("$FILES_DIR"/*.gz) |
| *créer l'entité et le recipient et le routage sur MPRP
| | if (( ${#gz_files[@]} )); then |
| - Le nom du partenaire dans AS2SERVER/X4SRV doit être le même que celui de l'entité | | log "Decompressing ${#gz_files[@]} .gz file(s)" |
| - Les fournisseurs avec plusieurs GLN les mettre en RVA dans l'entité | | if command -v pigz >/dev/null; then |
| - le code annuaire doit être le GLN sauf pour les partenaires non EDIFACT | | pigz -d --keep --force "${gz_files[@]}" |
| | else |
| | gunzip --force "${gz_files[@]}" |
| | fi |
| | fi |
|
| |
|
| *Dans recipient déclarer tous les fournisseurs avec entité code GLN ou NOM PARTENAIRE NON EDIFACT | | # --- unique words ----------------------------------------------------------- |
| - Pour le routage soit EDIFACT avec GLN ou TEXT avec un CODE fourni | | STAT_WORDS="$TMP_ROOT/statWords" |
| | log "Extracting unique words" |
| | grep -hoE '\b[[:alnum:]_]+\b' "$FILES_DIR"/* \ |
| | | tr '[:upper:]' '[:lower:]' \ |
| | | sort -u > "$STAT_WORDS" |
|
| |
|
| *créer le partenaire sur l'environnement TOD dans BUSINESSPARTNER
| | mapfile -t uniq_words < "$STAT_WORDS" |
| - Le NOM du partenaire sur BUSINESSPARTNER doit être le même que sur la base RECIPIENT de MPRP
| | trigger=$(( (${#uniq_words[@]} + 1) / 2 )) |
| | log "Trigger for common‑line filtering: > $trigger occurrence(s)" |
|
| |
|
| *faire un test manuel:
| | # --- optional variable substitution ---------------------------------------- |
| *Sur h1-csif01@tod-csif-prod1 ou h1-csif02@tod-csif-prod1
| | if [[ -f "$TMP_ROOT/statWords.vars" ]]; then |
| edisend RECIPIENT=MPRP MPRP.RECIPIENT_CODE=3010270300103 TEST_TRANSPORT work/test.text
| | log "Applying variable patterns from statWords.vars" |
| *voir syslog carrefour, machine de COM, et la base suivi de MPRP
| | cp -aT "$FILES_DIR" "$CACHE_DIR" |
| ==Export dump==
| | while read -r var; do |
| MyEntry="NAME=IMPORT_CLIENTS" ;MyBase="edisend" ;MyDump=~/work/${MyBase}.${MyEntry}.$(date '+%Y%m%d-%H').dump;logview -ls ~/$MyBase -f "${MyEntry}" -D $MyDump;grep -e "^NAME=" $MyDump;ls -l $MyDump
| | [[ $var ]] || continue |
| ==Import dump==
| | sed -i -E "s/\b$var\b/\${${var}My}/g" "$CACHE_DIR"/* |
| MyPP=tod-central-pp2
| | done < "$TMP_ROOT/statWords.vars" |
| scp h2-$(echo ${USER}|sed "s/^h[123]-//g")@${MyPP}:~/work/*$(date '+%Y%m%d')*.dump ~/work/.;ls -lrt ~/work/*$(date '+%Y%m%d')*.dump
| | else |
| | cp -aT "$FILES_DIR" "$CACHE_DIR" |
| | fi |
|
| |
|
| MyDump=/usr/local/tx/users/h1-husqvarna/work/edisend.NAME=IMPORT_CLIENTS.20150827-14.dump ;MyBase="partner" ;MyName=$(grep -e "^NAME=" $MyDump);logview -ls ~/$MyBase -f "${MyName}" -D ~/work/${MyBase}.${MyName}.$(date '+%Y%m%d-%H').dump.old && logadd -s ~/$MyBase -D $MyDump
| | # --- filter frequent common lines ------------------------------------------ |
| ==Infra Generix==
| | log "Computing over‑represented lines" |
| preprodhubx
| | sort "$CACHE_DIR"/* \ |
| prodhubx1
| | | uniq -c \ |
| prodhubx2
| | | awk -v t="$trigger" '$1 > t { sub(/^[[:space:]]+[0-9]+[[:space:]]+/,""); print }' \ |
| | > "$TMP_ROOT/comm" |
|
| |
|
| tod-central-pp2
| | # --- generate cleaned diffs ------------------------------------------------- |
| tod-central-prod2
| | log "Generating diffs in $OUTDIR" |
| tod-central-prod3
| | for f in "$CACHE_DIR"/*; do |
| tod-central-prod4
| | base=${f##*/} |
| tod-brcdp
| | grep -Fvxf "$TMP_ROOT/comm" "$f" > "$OUTDIR/$base" |
| | | chmod --reference="$f" "$OUTDIR/$base" |
| tod-central-pp5
| |
| tod-central-prod5
| |
| tod-central-prod6
| |
| ==Creation Base==
| |
| MyBase=RoutageDemat ;MyPreprod=tod-central-pp2
| |
|
| |
| MyUser=`echo ${USER}|sed "s/^h[123]-//g"`
| |
| mkdir -p ~/$MyBase ;scp h2-${MyUser}@${MyBase}:~/${MyBase}/*.cfg ~/${MyBase}/. ;logcreate -s $MyBase
| |
| ==[Creation nouveau client]==
| |
| ===Génération du fichier de configuration===
| |
| *Lancer depuis root@preprodhubx :
| |
| /root/bin/new-env.proc.sh
| |
| *Ouvrir le mail de configuration reçu
| |
| ===Configuration DNS===
| |
| ====Configuration serveur primaire (tod-srv2)====
| |
| MyCustomer=future-home
| |
| cd $NAMED;cp -p named.conf named.conf.$(date '+%Y%m%d')&&vi named.conf; diff named.conf named.conf.$(date '+%Y%m%d')
| |
| *Créer des entrées à l'image de formenti
| |
| | |
| =====MASTER=====
| |
| *Créer des copies des fichers et les modifiers dans les répertoires internal et external à l'image de formenti. Ne pas oublier de modifier la date.
| |
| cd $MASTER
| |
| ls -lrt internal/*formenti*; ls -lrt external/*formenti*
| |
| cp -p internal/master.internal.com.tradexpressondemand.formenti internal/master.internal.com.tradexpressondemand.$MyCustomer
| |
| cp -p external/master.tradexpressondemand.com.external.formenti external/master.tradexpressondemand.com.external.$MyCustomer
| |
| sed -i "s/formenti/${MyCustomer}/g" "internal/master.internal.com.tradexpressondemand.$MyCustomer"
| |
| sed -i "s/formenti/${MyCustomer}/g" "external/master.tradexpressondemand.com.external.$MyCustomer"
| |
| sed -i "s/2014072109/$(date '+%Y%m%d%H')/g" "internal/master.internal.com.tradexpressondemand.$MyCustomer"
| |
| sed -i "s/2014072109/$(date '+%Y%m%d%H')/g" "external/master.tradexpressondemand.com.external.$MyCustomer"
| |
| ls -l "internal/master.internal.com.tradexpressondemand.$MyCustomer" ;cat "internal/master.internal.com.tradexpressondemand.$MyCustomer"
| |
| ls -l "external/master.tradexpressondemand.com.external.$MyCustomer" ;cat "external/master.tradexpressondemand.com.external.$MyCustomer"
| |
| | |
| ====Configuration serveur secondaire (tod-srv1)====
| |
| *Configurer avec le même processus que le primaire sauf $MASTER
| |
| =====Configuration Apache=====
| |
| cd /etc/httpd/conf.d
| |
| *Créer des copies des fichers à l'image de formenti
| |
| cp -p user-formenti.conf "user-${MyCustomer}.conf"
| |
| *Modifier les fichiers
| |
| sed -i "s/formenti/${MyCustomer}/g" "user-${MyCustomer}.conf"
| |
| ls -l "user-${MyCustomer}.conf" ;grep "${MyCustomer}" "user-${MyCustomer}.conf"
| |
| =====Configuration Mail=====
| |
| cd /etc/postfix;cp -p canonical canonical.$(date '+%Y%m%d')&&vi canonical; diff canonical canonical.$(date '+%Y%m%d')
| |
| *Ajouter les entrées
| |
| cp -p virtual virtual.$(date '+%Y%m%d')&&vi virtual; diff virtual virtual.$(date '+%Y%m%d')
| |
| * Envoyer mail :
| |
| Nous vous informons le début d’actions « root » sur les serveurs suivants :
| |
| tod-srv-1, tod-srv-2, tod-central-dev1, tod-central-pp2, tod-central-prod4, tod-as2-pp1, tod-as2-prod1, ftphubx
| |
| | |
| *Charger la nouvelle configuration:
| |
| postmap canonical;postmap virtual
| |
| ====Relance des services sur le DNS primaire puis secondaire====
| |
| service named restart; service httpd restart
| |
| ===Création environnement sur chaque serveur h[123]===
| |
| su - ediroot
| |
| | |
| MyCustomer=future-home
| |
| ediadm
| |
| *Utiliser le nom h[123]-<CustomerName> pour l'utilisateur Unix
| |
| | |
| *Mettre le mot de passe h[123]-<CustomerName> pour le user :
| |
| MyHCustomer=`grep -m 1 "^h.-${MyCustomer}" /etc/passwd|cut -d ":" -f 1`;MyH=`echo ${MyHCustomer}|cut -d "-" -f 1`
| |
| passwd $MyHCustomer
| |
| | |
| ====h3 uniquement====
| |
| *Ajouter le client dans le fichier ename-to-uname :
| |
| cd /etc/httpd && cp -p ename-to-uname ename-to-uname.$(date '+%Y%m%d') && vi ename-to-uname ;diff ename-to-uname ename-to-uname.$(date '+%Y%m%d')
| |
| | |
| cd /usr/local/tx/www/conf/group
| |
| cp -p edigroups.w3 edigroups.w3.$(date '+%Y%m%d') ;echo " h3-${MyCustomer}">>edigroups.w3;vi edigroups.w3 ;diff edigroups.w3 edigroups.w3.$(date '+%Y%m%d')
| |
| | |
| cp -p ediusers.w3 ediusers.w3.$(date '+%Y%m%d') ;htpasswd -b ediusers.w3 h3-${MyCustomer} h3-${MyCustomer} ;diff ediusers.w3 ediusers.w3.$(date '+%Y%m%d')
| |
| | |
| ====h1 et h2====
| |
| cd /etc/httpd/conf.d && cp -p prod.conf prod.conf.$(date '+%Y%m%d') && echo "Use WebAccesTX ${MyH}.${MyCustomer}.tradexpressondemand.com ${MyCustomer} ${MyHCustomer}">>prod.conf ;diff prod.conf prod.conf.$(date '+%Y%m%d')
| |
| | |
| ====h1,h2 et h3====
| |
| *Création du dossier de log : | |
| cd /var/log/httpd/users && mkdir ${MyCustomer} && chmod 775 ${MyCustomer}; ls -ld /var/log/httpd/users/${MyCustomer}
| |
| su - ${MyHCustomer}
| |
| | |
| MyCustomer=`echo ${USER}|sed "s/^h[123]-//g"`;MyHCustomer=$USER;MyH=`echo ${MyHCustomer}|cut -d "-" -f 1`
| |
| cd ~/www && rm log ; ln -s /var/log/httpd/users/$MyCustomer log;ls -l log
| |
| | |
| *Modifier w3i_confedi | |
| cd ~/www/conf
| |
| sed -i "s/h2-default/${MyHCustomer}/g" ~/www/conf/w3i_confedi.cfg; sed -i "s/client/${MyCustomer}/g" w3i_confedi.cfg
| |
| sed -i "s/h2-${MyCustomer}/${MyHCustomer}/g" w3i_confedi.cfg
| |
| grep "${MyHCustomer}" w3i_confedi.cfg
| |
| ====h1 et h2====
| |
| echo " ${USER} ${MyCustomer}">>edigroups.w3;vi edigroups.w3;cat edigroups.w3
| |
| | |
| htpasswd -b ediusers.w3 ${MyCustomer} <voir mail>
| |
| ====h2 uniquement====
| |
| htpasswd -b ediusers.w3 ${MyHCustomer} 71gen75
| |
| ====h1 uniquement====
| |
| htpasswd -b ediusers.w3 ${MyHCustomer} <voir mail>
| |
|
| |
| sed -i "s/WAGUI=1/WAGUI=3/g" ~/www/conf/w3i_confedi.cfg
| |
| ====h1,h2 et h3 en root====
| |
| (exit)
| |
| * Relance
| |
| service httpd restart
| |
| ===Ajout protocol AS2===
| |
| ====Sur les serveurs PP et PROD====
| |
| cd /usr/local/tx/bin && cp -p as2receive.cgi.conf as2receive.cgi.conf.$(date '+%Y%m%d') && vi as2receive.cgi.conf ; diff as2receive.cgi.conf as2receive.cgi.conf.$(date '+%Y%m%d')
| |
| ====Sur les serveur AS2 PP et PROD====
| |
| cd /etc/httpd
| |
| cp -p as2_id-to-host as2_id-to-host.$(date '+%Y%m%d') && vi as2_id-to-host ; diff as2_id-to-host as2_id-to-host.$(date '+%Y%m%d')
| |
| | |
| cp -p as2_id-to-user as2_id-to-user.$(date '+%Y%m%d') && vi as2_id-to-user ; diff as2_id-to-user as2_id-to-user.$(date '+%Y%m%d')
| |
| ===Ajout protocol X400===
| |
| ====Sur les serveurs PP et PROD2====
| |
| *Modifier le fichier users avec des tabulations
| |
| cd /usr/local/tx/x400 && cp -p users users.$(date '+%Y%m%d') && vi users ;diff users users.$(date '+%Y%m%d')
| |
| | |
| *Edition Prod>HUB1 Preprod>HUB2
| |
| MyCustomer=future-home
| |
| | |
| MyHCustomer=`grep -m 1 "^h.-${MyCustomer}" /etc/passwd|cut -d ":" -f 1` && su - ${MyHCustomer}
| |
| | |
| MyCustomer=`echo ${USER}|sed "s/^h[123]-//g"`;MyHCustomer=$USER;MyH=`echo ${MyHCustomer}|cut -d "-" -f 1`
| |
| sed -i "s/h2-default/${MyHCustomer}/g" .x4rc ;sed -i "s/FROM=S=TODPP2/FROM=S=`echo ${MyCustomer}|tr '[:lower:]' '[:upper:]'`/g" .x4rc ;grep -i $MyCustomer .x4rc
| |
| ====h1 uniquement====
| |
| sed -i "s/HUB2/HUB1/g" .x4rc ;grep -i HUB1 .x4rc
| |
| ===Ajout protocol FTP===
| |
| *connexion via FTPHubX
| |
| | |
| MyCustomer=future-home
| |
| | |
| cd /usr/local/tx/users/h11ftp/public
| |
| mkdir -p "${MyCustomer}/${MyCustomer}/dev/in" ;mkdir -p "${MyCustomer}/${MyCustomer}/dev/out"
| |
| mkdir -p "${MyCustomer}/${MyCustomer}/prod/in" ;mkdir -p "${MyCustomer}/${MyCustomer}/prod/out"
| |
| chown h11ftp:ediusers -R ${MyCustomer} ;chmod og-rwx -R ${MyCustomer} ;find ${MyCustomer} -type d -exec ls -ld {} \;
| |
| | |
| cd /usr/local/tx/users/h11ftp/private
| |
| mkdir -p "${MyCustomer}/${MyCustomer}/dev/in" ;mkdir -p "${MyCustomer}/${MyCustomer}/dev/out"
| |
| mkdir -p "${MyCustomer}/${MyCustomer}/prod/in" ;mkdir -p "${MyCustomer}/${MyCustomer}/prod/out"
| |
| chown h11ftp:ediusers -R ${MyCustomer} ;chmod og-rwx -R ${MyCustomer} ;find ${MyCustomer} -type d -exec ls -ld {} \;
| |
| | |
| * Se connecter au Web Interne
| |
| http://ftphubx.hubxpress.net/tx/cgi/w3i_first.cgi
| |
| *copier 3 entrées partner d'un autre client et modifier sur Webexpress avec mot de passe mail
| |
| * Envoyer mail fin d'actions :
| |
| Nous vous informons de la fin des actions « root » sur les serveurs suivants :
| |
| tod-srv-1, tod-srv-2, tod-central-dev1, tod-central-pp2, tod-central-prod4, tod-as2-pp1, tod-as2-prod1, ftphubx
| |
| ==Configuration mprp==
| |
| *Accèder à http://<test|prod>.mprp.tradexpressondemand.com/
| |
| ==Process AS2==
| |
| *envoyer un mail avec nos paramètres de l'infra TRADEXPRESS ou infra HUBXPRESS et demander les leurs
| |
| *recevoir la configuration Partenaire
| |
| *Ajouter le certificat dans ssl/certs
| |
| *Créer le partenaire dans WebExpress/PARTNER
| |
| *Faire [test lien AS2]
| |
| *configurer notre parefeu
| |
| [Configuration parefeu]
| |
| *Si NOK vérifier que le partenaire est prêt
| |
| ==Test lien X400==
| |
| (echo "TEST GENERIX (<User>-<DEV|PROD>)">>~/work/test.txt)
| |
| edisend test_X400 ~/work/test.txt
| |
| ==[Creation IMOD][316297 ]DOLE / IMOD / maj / date : 12/08==
| |
| *La demande doit venir d'un consultant ou un commercial Generix sinon renvoyer le mail à csm-cgi et attendre validation
| |
| *Se connecter à http://invoicemanagerondemand.com/
| |
| ===Sélection environnement===
| |
| *Aller dans l'onglet "Invoice Manager"
| |
| *Sélectionner l'environnement. S'il n'existe pas dans le menu voir point "Affectation environnement".
| |
| ====(Affectation environnement)====
| |
| *Aller dans "Invoice Manager/Environnements/Affectation"
| |
| *Choisir la personne à qui affecté
| |
| *Rechercher le client par nom ou par code
| |
| *Affecter les environnements voulus
| |
| ===Ajout partenaire===
| |
| *Aller dans "Invoice Manager/Paramétrage/Partenaires"
| |
| *Sélectionner "Ajouter un partenaire" et paramètrer selon demande client (parfois déjà existant)
| |
| | |
| *Type de code : EAN sinon ZZZ
| |
| ===Ajout profil===
| |
| *Aller dans "Invoice Manager/Paramétrage/Profils"
| |
| *Sur Doublon non préciser voir d'autres profils
| |
| ==configuration AS2/EDISENT==
| |
| Startup: external
| |
| Type : EDIFACT
| |
| Transport to the Recipient : enable
| |
| Log Level : 2
| |
| Alarms : OFF
| |
| ==Mise à jour certificat==
| |
| ===Script===
| |
| MyScript=MyCertUpdate.sh ;mkdir -p ~/work/adasilva ; cd ~/work/adasilva;touch $MyScript; chmod u+x $MyScript;nano $MyScript;./$MyScript
| |
| #!/bin/bash
| |
| | |
| MyCertOldMd5=6b8922e22af632085404391f13b90cac
| |
| MyCertNew=CertNew.cer
| |
| | |
| chown root:root CertNew.cer
| |
| chmod a+r CertNew.cer
| |
| | |
| >/tmp/$$tmp
| |
| #!/bin/bash
| |
| | |
| MyCertOldMd5=`md5sum old.cer`
| |
| MyCertNew=new.cer
| |
| | |
| chown root:root $MyCertNew
| |
| chmod a+r $MyCertNew
| |
| | |
| >/tmp/$$tmp
| |
| for MyFile in /usr/local/tx/users/*/ssl/certs/*.cer
| |
| do
| |
| echo "md5sum $MyFile >>/tmp/$$tmp"
| |
| md5sum $MyFile >>/tmp/$$tmp
| |
| done
| |
| | |
| for MyFile in $(grep -e "^${MyCertOldMd5}" /tmp/$$tmp|cut -d " " -f3)
| |
| do
| |
| MyBackup=`echo $MyFile|sed 's/\/ssl\/certs\//\/ssl\/certs\/N-1\//g'`.$(date '+%Y%m%d')
| |
| | |
| echo "cp -p ${MyFile} ${MyBackup} && cp -p CertNew.cer ${MyFile}"
| |
| cp -p ${MyFile} ${MyBackup} && cp -p CertNew.cer ${MyFile}
| |
| done | | done |
|
| |
|
| rm -f /tmp/$$tmp
| | log "Finished 🎉 Results in $OUTDIR" |
| ==Creation Partner AS2 depuis PARTNER==
| | #24cc42# |
| ===tradexpressondemand.com===
| | </syntaxhighlight> |
| *Configurer certificat
| |
| *Configurer parefeu
| |
| [Configuration parefeu]
| |
| Partner name :
| |
| Transport mechanism : HTTP
| |
| EDI Syntax : NONE ou EDIFACT (si GLN)
| |
| Partner info : AS2 <PartnerName>
| |
| | |
| URL :
| |
| Proxy Address : http://tod-as2-<pp1|prod1>.tradexpressondemand.com
| |
| File disposition : attanchment
| |
| Keep HTTP Headers on output : enable
| |
| Proxy Port : 8080
| |
| Force HTTP 1.0: enable
| |
| Security Method : EDIINT
| |
| | |
| Scenario step 1 : pkcs7-signature
| |
| Scenario step 2 : zlib-compressed
| |
| Scenario step 3 : pkcs7-encrypted
| |
| | |
| Subject : <CustomerName> TO <PartnerName> (<PROD|DEV>)
| |
| AS2 From : <IdNameClient>-<PROD|DEV>
| |
| AS2 To: <IdNamePartner>
| |
|
| |
|
| MDN : Synchronous
| | ===Summary from ChatGPT=== |
| MDN Signature : pkcs7-signature
| | This is a shell script written in Bash. The script starts by setting the "resultDiff" variable to a specific file path. The script then performs the following actions: |
| MDN Receipt URL : http://as2-<ppd|prod>.tradexpressondemand.com
| |
| MDN Time out : 600
| |
| Private signature key : generix
| |
| Private signature passphrase : <voir SSL generix>
| |
|
| |
|
| Recipient encryption certificate : <Nom certificat Partner>
| | # Creates a directory called "old" in the home directory. |
| Recipient signature certificate : <Nom certificat Partner>
| | # Changes the current working directory to the "old" directory. |
| | # Downloads a file from "https://infocepo.com/wiki/index.php/Special:Export/ResultDiff", filters the data, and saves it to a temporary file. |
| | # Runs the temporary file. |
| | # Returns to the previous working directory. |
|
| |
|
| Encryption alogorithm : des3
| | The second part of the code is a more complex shell script that performs multiple actions related to file analysis and comparison. The script does the following: |
| Signature Hash : sha1
| |
| ===hubxpress.net===
| |
| * Idem que pour tradexpressondemand.com sauf:
| |
| pas de proxy
| |
| MDN Receipt URL : http://as2hubx.hubxpress.net/ediint-<IdNameClient>-SYNC-<prod|dev>
| |
| ==Cora/X400 creation==
| |
| (*Connexion à l'URL WAB selon keepass)
| |
| *Lancer la connection rdp "VNC@ALLEGRO-CORA-PROD1"
| |
| *Connexion au client (CTRL+ALT+FIN)
| |
| *Lancer Allegro (Attention, cette action crée des blocages. Il faut fermer dès que possible. Que nos actions soit fini ou pas, une protection ferme l'appli après 10 minutes)
| |
| *Selection appli. partenaire
| |
| *Voir si O/R déjà existant et l'associer au nouveau partenaire par création depuis liste partenaire
| |
| *Sinon, créer un lien X400_P2 ou ALLEGRO si O=ALLEGRO:
| |
| Mné + Ident. = GLN
| |
| Qualif = 14
| |
| O/R :
| |
| pays + dom. admin + Organ. + Nom perso + OK
| |
| *attention fermer
| |
|
| |
|
| 2. Config Web Access
| | # Cleans up previous temporary files. |
| *Faire une copie d'un partner MALONGO (X400)
| | # Makes two directories, "analyse$$/files" and "analyse$$/diff". |
| *Modifier Nom + GLN partner x2
| | # Copies all files from the "resultDiff" directory to the "analyse$$/files" directory, and unzips any ".gz" files. |
| | # Generates a list of unique words from all the files in the "analyse$$/files" directory. |
| | # Triggers an action if the number of files is above a certain value. |
| | # Replaces the words in the list with a placeholder, "varMy". |
| | # Compares the contents of all files in the "analyse$$/files" directory and creates a new file, "analyse$$/comm", with all common lines. |
| | # Filters out the lines in "analyse$$/comm" that are not present in more than half of the files. |
| | # Generates a "diff" file for each file in the "analyse$$/files" directory, showing the contents of the file and the missing common lines. |
| | # Cleans up temporary files. |