Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajustes para habilitar a instalação do módulo do barramento PEN #38

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,11 @@ apagar_volume_openldap: ## Apagar volumes OpenLDAP
apagar_volume_controlador_instalacao: ## Apagar volume controlador da instalacao
docker volume rm $(VOLUME_CONTROLADOR_INSTALACAO) || true

clear_all: #Apaga tanto os containers quanto os volumes, iniciando do zero o ambiente
make clear
make apagar_volumes

bash_app: #Acessa o container de app, caso for diferente do app_1, passar id=X
@[ "${id}" ] && docker exec -it docker-compose_app_$(id) bash || ( docker exec -it docker-compose_app_1 bash ;exit 1 )


2 changes: 2 additions & 0 deletions containeres/app/files/conf/ConfiguracaoSip.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public function getArrConfiguracoes(){
'Banco' => getenv('APP_DB_SIP_BASE'),
'Usuario' => getenv('APP_DB_SIP_USERNAME'),
'Senha' => getenv('APP_DB_SIP_PASSWORD'),
'UsuarioScript' => getenv('APP_DB_SIP_USERNAME'),
'SenhaScript' => getenv('APP_DB_SIP_PASSWORD'),
'Tipo' => getenv('APP_DB_TIPO')), //MySql, SqlServer, Oracle ou PostgreSql

/*
Expand Down
1 change: 1 addition & 0 deletions containeres/app/files/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ yum -y install httpd memcached openssl wget curl unzip gcc java-1.8.0-openjdk li
yum install -y epel-release yum-utils
yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php73
yum install -y zip
yum -y update

# Instalação do PHP e demais extenções necessárias para o projeto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ cd /sei-modulos

git clone https://github.com/spbgovbr/mod-sei-estatisticas.git
git clone https://github.com/spbgovbr/mod-wssei.git
git clone https://github.com/spbgovbr/mod-sei-pen
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,71 @@ else
fi


echo "***************************************************"
echo "***************************************************"
echo "*INICIANDO CONFIGURACOES DO MODULO DO PEN*"
echo "***************************************************"
echo "***************************************************"

if [ "$MODULO_PEN_INSTALAR" == "true" ]; then

cd /opt/sei/web/modulos
cp -R /sei-modulos/mod-sei-pen ./mod-sei-pen
cd mod-sei-pen
git checkout $MODULO_PEN_VERSAO
echo "Versao do PEN agora: $MODULO_PEN_VERSAO"

# adiciona config
cd /opt/sei
sed -i "s#/\*novomodulo\*/#'PENIntegracao' => 'pen', /\*novomodulo\*/#g" config/ConfiguracaoSEI.php

cd /opt/sei/web/modulos/mod-sei-pen
make build
cd dist
files=( *.zip )
f="${files[0]}"

yes | unzip $f
cp -Rf sei/* /opt/sei/
cp -Rf sip/* /opt/sip/

cd /opt/sei/web/modulos
mv mod-sei-pen mod-sei-pen.old

cd /opt/sei/config/mod-pen/
mv ./ConfiguracaoModPEN.exemplo.php ./ConfiguracaoModPEN.php
sed -i "s#\"SenhaCertificado\" => \"\"#'SenhaCertificado' => $MODULO_PEN_CERTIFICADO_SENHA#g" ConfiguracaoModPEN.php
sed -i "s#\"WebService\" => \"\"#'WebService' => $MODULO_PEN_WEBSERVICE#g" ConfiguracaoModPEN.php

# adiciona o certificado
cd /opt/sei/config/mod-pen
echo $MODULO_PEN_CERTIFICADO > /certificado.pem
sed -i "s/ | //1" /certificado.pem
sed -i "s/BEGIN CERTIFICATE/BEGINCERTIFICATE/g" /certificado.pem
sed -i "s/END CERTIFICATE/ENDCERTIFICATE/g" /certificado.pem
sed -i "s/BEGIN PRIVATE KEY/BEGINPRIVATEKEY/g" /certificado.pem
sed -i "s/END PRIVATE KEY/ENDPRIVATEKEY/g" /certificado.pem
cat /certificado.pem | tr ' ' '\n' > /certificado2.pem
rm -f /certificado.pem
mv /certificado2.pem /certificado.pem
sed -i "s/BEGINCERTIFICATE/BEGIN CERTIFICATE/g" /certificado.pem
sed -i "s/ENDCERTIFICATE/END CERTIFICATE/g" /certificado.pem
sed -i "s/BEGINPRIVATEKEY/BEGIN PRIVATE KEY/g" /certificado.pem
sed -i "s/ENDPRIVATEKEY/END PRIVATE KEY/g" /certificado.pem
sleep 2
echo "copiar certificado"
yes | cp -f /certificado.pem certificado.pem
echo "certificado copiado"
cat certificado.pem

cd /opt
php sip/scripts/mod-pen/sip_atualizar_versao_modulo_pen.php
php sei/scripts/mod-pen/sei_atualizar_versao_modulo_pen.php


fi


echo "***************************************************"
echo "***************************************************"
echo "**CONFIGURANDO MODULO WSSEI************************"
Expand Down
59 changes: 59 additions & 0 deletions containeres/app/files/scripts-e-automatizadores/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,65 @@ else
fi


echo "***************************************************"
echo "***************************************************"
echo "*INICIANDO CONFIGURACOES DO MODULO DO PEN*"
echo "***************************************************"
echo "***************************************************"

if [ "$MODULO_PEN_INSTALAR" == "true" ]; then

cd /opt/sei/web/modulos
cp -R /sei-modulos/mod-sei-pen ./mod-sei-pen
cd mod-sei-pen
git checkout $MODULO_PEN_VERSAO
echo "Versao do PEN agora: $MODULO_PEN_VERSAO"

# adiciona config
cd /opt/sei
sed -i "s#/\*novomodulo\*/#'PENIntegracao' => 'pen', /\*novomodulo\*/#g" config/ConfiguracaoSEI.php

cd /opt/sei/web/modulos/mod-sei-pen
make build
cd dist
files=( *.zip )
f="${files[0]}"

yes | unzip $f
cp -Rf sei/* /opt/sei/
cp -Rf sip/* /opt/sip/

cd /opt/sei/web/modulos
mv mod-sei-pen mod-sei-pen.old

cd /opt/sei/config/mod-pen/
mv ./ConfiguracaoModPEN.exemplo.php ./ConfiguracaoModPEN.php
sed -i "s#\"SenhaCertificado\" => \"\"#'SenhaCertificado' => $MODULO_PEN_CERTIFICADO_SENHA#g" ConfiguracaoModPEN.php
sed -i "s#\"WebService\" => \"\"#'WebService' => $MODULO_PEN_WEBSERVICE#g" ConfiguracaoModPEN.php

# adiciona o certificado
cd /opt/sei/config/mod-pen
echo $MODULO_PEN_CERTIFICADO > /certificado.pem
sed -i "s/ | //1" /certificado.pem
sed -i "s/BEGIN CERTIFICATE/BEGINCERTIFICATE/g" /certificado.pem
sed -i "s/END CERTIFICATE/ENDCERTIFICATE/g" /certificado.pem
sed -i "s/BEGIN PRIVATE KEY/BEGINPRIVATEKEY/g" /certificado.pem
sed -i "s/END PRIVATE KEY/ENDPRIVATEKEY/g" /certificado.pem
cat /certificado.pem | tr ' ' '\n' > /certificado2.pem
rm -f /certificado.pem
mv /certificado2.pem /certificado.pem
sed -i "s/BEGINCERTIFICATE/BEGIN CERTIFICATE/g" /certificado.pem
sed -i "s/ENDCERTIFICATE/END CERTIFICATE/g" /certificado.pem
sed -i "s/BEGINPRIVATEKEY/BEGIN PRIVATE KEY/g" /certificado.pem
sed -i "s/ENDPRIVATEKEY/END PRIVATE KEY/g" /certificado.pem
sleep 2
echo "copiar certificado"
yes | cp -f /certificado.pem certificado.pem
echo "certificado copiado"
cat certificado.pem

fi

echo "***************************************************"
echo "***************************************************"
echo "**CONFIGURANDO MODULO WSSEI************************"
Expand Down
2 changes: 1 addition & 1 deletion docs/Instrucoes.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Inicialmente sugerimos que vc verifique a variável:
LOCALIZACAO_FONTES_SEI
leia a orientação que ali aparece e posicione o código fonte no local adequado.

**IMPORTANTE: A recomendação inicial é que você não seja um doido e já saia modificando o arquivo envlocal.env a revelia.**
**IMPORTANTE: A recomendação inicial é que seja estudado o código antes de modificar o arquivo envlocal.env.**

Suba primeiro com a sugestão ofertada. Depois usando o make, desligue o projeto e remova os volumes. Altere um parâmetro no envlocal.env e suba novamente. Teste as alterações e o resto do ambiente. Desligue e limpe os volumes novamente, altere os parâmetros e suba até compreender todo o ecossistema e definir o que você vai deixar rodando.

Expand Down
10 changes: 10 additions & 0 deletions envlocal.env
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,13 @@ export MODULO_ESTATISTICAS_CHAVE=seipublico
#export MODULO_WSSEI_URL_NOTIFICACAO=https://app-push-gestao-api.dev.nuvem.gov.br/mba-mmmessage/message
#export MODULO_WSSEI_ID_APP=4
#export MODULO_WSSEI_CHAVE=pegueachavenacentraldesservicospen

# MODULO DO PEN
export MODULO_PEN_INSTALAR=true
export MODULO_PEN_VERSAO=3.0.0
export MODULO_PEN_WEBSERVICE="https://homolog.api.processoeletronico.gov.br/interoperabilidade/soap/v2/"
export MODULO_PEN_CERTIFICADO_SENHA=adicionar-senha
export MODULO_PEN_CERTIFICADO=adicionar-certificado



10 changes: 10 additions & 0 deletions orquestrators/docker-compose/docker-compose-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ services:
- MODULO_WSSEI_URL_NOTIFICACAO=${MODULO_WSSEI_URL_NOTIFICACAO}
- MODULO_WSSEI_ID_APP=${MODULO_WSSEI_ID_APP}
- MODULO_WSSEI_CHAVE=${MODULO_WSSEI_CHAVE}
- MODULO_PEN_INSTALAR=${MODULO_PEN_INSTALAR}
- MODULO_PEN_VERSAO=${MODULO_PEN_VERSAO}
- MODULO_PEN_CERTIFICADO=${MODULO_PEN_CERTIFICADO}
- MODULO_PEN_CERTIFICADO_SENHA=${MODULO_PEN_CERTIFICADO_SENHA}
- MODULO_PEN_WEBSERVICE=${MODULO_PEN_WEBSERVICE}
links:
- db:db
- memcached:memcached
Expand Down Expand Up @@ -257,6 +262,11 @@ services:
#- EXCLUDE_PORTS=80
#- EXTRA_ROUTE_SETTINGS=ssl verify none
- COOKIE=SRV insert indirect nocache
- MODULO_PEN_INSTALAR=${MODULO_PEN_INSTALAR}
- MODULO_PEN_VERSAO=${MODULO_PEN_VERSAO}
- MODULO_PEN_CERTIFICADO=${MODULO_PEN_CERTIFICADO}
- MODULO_PEN_CERTIFICADO_SENHA=${MODULO_PEN_CERTIFICADO_SENHA}
- MODULO_PEN_WEBSERVICE=${MODULO_PEN_WEBSERVICE}
links:
- db:db
- memcached:memcached
Expand Down