Skip to content

Commit

Permalink
bug fixing , reducing unnecessary codes
Browse files Browse the repository at this point in the history
  • Loading branch information
anatolicvs committed Jul 28, 2020
1 parent 2f8678e commit 982e560
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 59 deletions.
36 changes: 35 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
COMPOSE_PROJECT_NAME=es
CERTS_DIR=/usr/share/elasticsearch/config/certificates/
VERSION=7.8.0
VERSION=7.8.0

ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=InSylva1465441881

ME_CONFIG_MONGODB_ADMINUSERNAME=in_sylva_mongoc
ME_CONFIG_MONGODB_ADMINPASSWORD=v2kGBDUaGjXK2VuPyf5R64VS

PGADMIN_DEFAULT_EMAIL=[email protected]
PGADMIN_DEFAULT_PASSWORD=v2kGBDUaGjXK2VuPyf5R64VS

DB_USER=insylva_admin_pg
DB_SCHEMA=public
DB_PASSWORD=v2kGBDUaGjXK2VuPyf5R64VS

KEYCLOAK_USER=insylva_admin
KEYCLOAK_PASSWORD=v2kGBDUaGjXK2VuPyf5R64VS

POSTGRES_USER=insylva_admin_pg
POSTGRES_PASSWORD=v2kGBDUaGjXK2VuPyf5R64VS

MONGO_INITDB_ROOT_USERNAME=in_sylva_mongoc
MONGO_INITDB_ROOT_PASSWORD=v2kGBDUaGjXK2VuPyf5R64VS
MONGO_INITDB_DATABASE=insylva

KEYCLOAK_REALM=in-sylva
KEYCLOAK_SERVER_URL=http://keycloak:8080/keycloak/auth
KEYCLOAK_SERVER_PUBLIC_KEY=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp4KOgK5s+xvmun5sbPzcRLTIvGmVyG+nNdILYKNkpjUuFGvG2KqDNZZsq5rk9EPyrEApnbPWmOZusCn1dVegoGvkfSxkyP7AtVamwZMvTBObG0Ktju47o8/KCk63NPfwdWxSNyhWWa3VV95+l4VctvwAH7MeEV6uTDjsby2+LIojJOE+IWhPoLXiINuQ/GzKrzd30pS0XpMLQdru1vJgLXBPAvcZbYMvIkK3b5zIC02x4mL7PGP2LFZBZxUTMhRoC6cTc7C3uDagF5MHPOqfVl3ycHbm7Hc4bpJGSzqYGINLQ28I59WqM5zc+Wpml0Lmyd6wv5eqUTJWQKdc92DvtQIDAQAB
KEYCLOAK_CREDENTIALS_SECRET=6d1fea7a-b803-440e-b0d7-2b551e2ff2b9

BOT_SERVICE_TOKEN=xoxb-791472305859-913372508932-2CcYhaCRrTLDXzKc5Df9ZMUb
BOT_SERVICE_CHANNEL=CPLTQQQ0Y

MONGO_USERNAME=in_sylva_mongoc
MONGO_PASSWORD=v2kGBDUaGjXK2VuPyf5R64VS
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Usage(){
echo "Args:"
echo "-k <ssh_key_file>: mandatory. id_rsa keyfile should exits in ~/.ssh/ user directory "
echo "-t {dev|prod}: mandatory. If <prod> deployment is choosen, you must precise -d argument"
echo "-d domain_name: mandatory in production deploiement. Precise the base URL which will be use to contact application."
echo "-d domain_name: mandatory in production deployment. Precise the base URL which will be use to contact application."
echo " domain_name should appear as <domain>/<path1>/<path2>/"
echo " Example: w3.avignon.inra.fr/bas_insylva/portal/"
echo "-s <ip address>: mandatory in production deploiement. Precise the ip address of the server (used for direct access to search application in production mode)"
echo "-p <port number>: mandatory in production deploiement. Precise the port number of the server (used for direct access to login application in production mode)"
echo "-s <ip address>: mandatory in production deployment. Precise the ip address of the server (used for direct access to search application in production mode)"
echo "-p <port number>: mandatory in production deployment. Precise the port number of the server (used for direct access to login application in production mode)"
echo "##############################################"
exit
}
Expand Down
93 changes: 48 additions & 45 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
- cluster.initial_master_nodes=es01
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- ELASTIC_PASSWORD=InSylva1465441881
- ELASTIC_PASSWORD=$ELASTICSEARCH_PASSWORD
- xpack.security.enabled=true
- xpack.security.transport.ssl.enabled=true
- xpack.security.transport.ssl.verification_mode=certificate
Expand Down Expand Up @@ -66,6 +66,7 @@ services:
interval: 30s
timeout: 10s
retries: 5
restart: unless-stopped
networks:
- insylva-net

Expand All @@ -77,8 +78,8 @@ services:
- SERVER_HOST=0.0.0.0
- ELASTICSEARCH_URL=http://es01:9200
- ELASTICSEARCH_HOSTS=http://es01:9200
- ELASTICSEARCH_USERNAME=elastic
- ELASTICSEARCH_PASSWORD=InSylva1465441881
- ELASTICSEARCH_USERNAME=$ELASTICSEARCH_USERNAME
- ELASTICSEARCH_PASSWORD=$ELASTICSEARCH_PASSWORD
volumes:
- type: volume
source: logs
Expand Down Expand Up @@ -109,6 +110,7 @@ services:
delay: 30s
max_attempts: 3
window: 120s
restart: unless-stopped
networks:
- insylva-net

Expand All @@ -133,12 +135,12 @@ services:
image: in-sylva.postgres:latest
container_name: in-sylva.postgres
volumes:
- ./data.sql:/docker-entrypoint-initdb.d/data.sql
- ./postgres-data:/var/lib/postgresql/data
- ./data.sql:/docker-entrypoint-initdb.d/data.sql:z
- postgres_data:/var/lib/postgresql:z
environment:
POSTGRES_MULTIPLE_DATABASES: insylva,keycloak
POSTGRES_USER: insylva_admin_pg
POSTGRES_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_HOST: postgres
ports:
- 5432:5432
Expand All @@ -157,12 +159,12 @@ services:
DB_PORT: 5432
DB_DATABASE: keycloak

DB_USER: insylva_admin_pg
DB_SCHEMA: public
DB_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
DB_USER: $DB_USER
DB_SCHEMA: $DB_SCHEMA
DB_PASSWORD: $DB_PASSWORD

KEYCLOAK_USER: insylva_admin
KEYCLOAK_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
KEYCLOAK_USER: $KEYCLOAK_USER
KEYCLOAK_PASSWORD: $KEYCLOAK_PASSWORD
# Uncomment the line below if you want to specify JDBC parameters. The parameter below is just an example, and it shouldn't be used in production without knowledge. It is highly recommended that you read the PostgreSQL JDBC driver documentation in order to use it.
# JDBC_PARAMS: useSSL=false
# JGROUPS_DISCOVERY_PROTOCOL: JDBC_PING
Expand All @@ -177,9 +179,10 @@ services:

pgadmin:
image: dpage/pgadmin4:latest
depends_on: [postgres]
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
PGADMIN_DEFAULT_EMAIL: $PGADMIN_DEFAULT_EMAIL
PGADMIN_DEFAULT_PASSWORD: $PGADMIN_DEFAULT_PASSWORD
volumes:
- pgadmin:/root/.pgadmin
ports:
Expand All @@ -192,8 +195,8 @@ services:
image: mongo:latest
container_name: in-sylva.mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: in_sylva_mongoc
MONGO_INITDB_ROOT_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
MONGO_INITDB_ROOT_USERNAME: $MONGO_INITDB_ROOT_USERNAME
MONGO_INITDB_ROOT_PASSWORD: $MONGO_INITDB_ROOT_PASSWORD
MONGO_INITDB_DATABASE: insylva
ports:
- 27017:27017
Expand All @@ -208,8 +211,8 @@ services:
ports:
- 8881:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: in_sylva_mongoc
ME_CONFIG_MONGODB_ADMINPASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
ME_CONFIG_MONGODB_ADMINUSERNAME: $ME_CONFIG_MONGODB_ADMINUSERNAME
ME_CONFIG_MONGODB_ADMINPASSWORD: $ME_CONFIG_MONGODB_ADMINPASSWORD
networks:
- insylva-net
restart: unless-stopped
Expand All @@ -226,15 +229,15 @@ services:
NODE_ENV: production

DB_HOST: in-sylva.postgres
DB_USERNAME: insylva_admin_pg
DB_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
DB_USERNAME: $DB_USER
DB_PASSWORD: $DB_PASSWORD
DB_DATABASE: insylva
DB_PORT: 5432

ELK_HOST: es01
ELK_PORT: 9200
ELK_USERNAME: elastic
ELK_PASSWORD: InSylva1465441881
ELK_USERNAME: $ELASTICSEARCH_USERNAME
ELK_PASSWORD: $ELASTICSEARCH_PASSWORD

KEYCLOAK_REALM: in-sylva
KEYCLOAK_SERVER_URL: http://keycloak:7000/keycloak/auth
Expand All @@ -260,15 +263,15 @@ services:

DB_HOST: in-sylva.postgres
DB_PORT: 5432
DB_USER: insylva_admin_pg
DB_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
DB_USER: $DB_USER
DB_PASSWORD: $DB_PASSWORD
DB_DATABASE: insylva

IN_SYLVA_KEYCLOAK_HOST: http://keycloak
IN_SYLVA_KEYCLOAK_PORT: 8080

KEYCLOAK_USERNAME: insylva_admin
KEYCLOAK_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
KEYCLOAK_USERNAME: $KEYCLOAK_USER
KEYCLOAK_PASSWORD: $KEYCLOAK_PASSWORD
KEYCLOAK_GRANT_TYPE: password
KEYCLOAK_CLIENT_ID: admin-cli

Expand All @@ -279,10 +282,10 @@ services:
SERVICE_PORT: 4000
SERVICE_NAME: in-sylva-gatekeeper-v1

KEYCLOAK_REALM: in-sylva
KEYCLOAK_SERVER_URL: http://keycloak:8080/keycloak/auth
KEYCLOAK_SERVER_PUBLIC_KEY: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp4KOgK5s+xvmun5sbPzcRLTIvGmVyG+nNdILYKNkpjUuFGvG2KqDNZZsq5rk9EPyrEApnbPWmOZusCn1dVegoGvkfSxkyP7AtVamwZMvTBObG0Ktju47o8/KCk63NPfwdWxSNyhWWa3VV95+l4VctvwAH7MeEV6uTDjsby2+LIojJOE+IWhPoLXiINuQ/GzKrzd30pS0XpMLQdru1vJgLXBPAvcZbYMvIkK3b5zIC02x4mL7PGP2LFZBZxUTMhRoC6cTc7C3uDagF5MHPOqfVl3ycHbm7Hc4bpJGSzqYGINLQ28I59WqM5zc+Wpml0Lmyd6wv5eqUTJWQKdc92DvtQIDAQAB
KEYCLOAK_CREDENTIALS_SECRET: 6d1fea7a-b803-440e-b0d7-2b551e2ff2b9
KEYCLOAK_REALM: $KEYCLOAK_REALM
KEYCLOAK_SERVER_URL: $KEYCLOAK_SERVER_URL
KEYCLOAK_SERVER_PUBLIC_KEY: $KEYCLOAK_SERVER_PUBLIC_KEY
KEYCLOAK_CREDENTIALS_SECRET: $KEYCLOAK_CREDENTIALS_SECRET

networks:
- insylva-net
Expand All @@ -296,38 +299,38 @@ services:
PROCESS_TYPE: web
PORT: 5000

BOT_SERVICE_TOKEN: xoxb-791472305859-913372508932-2CcYhaCRrTLDXzKc5Df9ZMUb
BOT_SERVICE_CHANNEL: CPLTQQQ0Y
BOT_SERVICE_TOKEN: $BOT_SERVICE_TOKEN
BOT_SERVICE_CHANNEL: $BOT_SERVICE_CHANNEL

IN_SYLVA_GATEKEEPER_HOST: http://in-sylva.gatekeeper
IN_SYLVA_GATEKEEPER_PORT: 4000

MONGO_HOST: mongo
MONGO_USERNAME: in_sylva_mongoc
MONGO_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
MONGO_USERNAME: $MONGO_USERNAME
MONGO_PASSWORD: $MONGO_PASSWORD
MONGO_DB_NAME: insylva
MONGO_PORT: 27017

DB_HOST: postgres
DB_USER: insylva_admin_pg
DB_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
DB_USER: $DB_USER
DB_PASSWORD: $DB_PASSWORD
DB_DATABASE: insylva
DB_PORT: 5432

ELK_HOST: es01
ELK_PORT: 9200
ELK_USERNAME: elastic
ELK_PASSWORD: InSylva1465441881
ELK_USERNAME: $ELASTICSEARCH_USERNAME
ELK_PASSWORD: $ELASTICSEARCH_PASSWORD

KEYCLOAK_USERNAME: insylva_admin
KEYCLOAK_PASSWORD: v2kGBDUaGjXK2VuPyf5R64VS
KEYCLOAK_USERNAME: $KEYCLOAK_USER
KEYCLOAK_PASSWORD: $KEYCLOAK_PASSWORD
KEYCLOAK_GRANT_TYPE: password
KEYCLOAK_CLIENT_ID: admin-cli

KEYCLOAK_REALM: in-sylva
KEYCLOAK_SERVER_URL: http://keycloak:8080/keycloak/auth
KEYCLOAK_SERVER_PUBLIC_KEY: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp4KOgK5s+xvmun5sbPzcRLTIvGmVyG+nNdILYKNkpjUuFGvG2KqDNZZsq5rk9EPyrEApnbPWmOZusCn1dVegoGvkfSxkyP7AtVamwZMvTBObG0Ktju47o8/KCk63NPfwdWxSNyhWWa3VV95+l4VctvwAH7MeEV6uTDjsby2+LIojJOE+IWhPoLXiINuQ/GzKrzd30pS0XpMLQdru1vJgLXBPAvcZbYMvIkK3b5zIC02x4mL7PGP2LFZBZxUTMhRoC6cTc7C3uDagF5MHPOqfVl3ycHbm7Hc4bpJGSzqYGINLQ28I59WqM5zc+Wpml0Lmyd6wv5eqUTJWQKdc92DvtQIDAQAB
KEYCLOAK_CREDENTIALS_SECRET: 6d1fea7a-b803-440e-b0d7-2b551e2ff2b9
KEYCLOAK_REALM: $KEYCLOAK_REALM
KEYCLOAK_SERVER_URL: $KEYCLOAK_SERVER_URL
KEYCLOAK_SERVER_PUBLIC_KEY: $KEYCLOAK_SERVER_PUBLIC_KEY
KEYCLOAK_CREDENTIALS_SECRET: $KEYCLOAK_CREDENTIALS_SECRET

CONSUL_IP: in-sylva-consul
CONSUL_PORT: 8500
Expand Down Expand Up @@ -427,7 +430,7 @@ services:
- 35729:35729

volumes:
postgres-data:
postgres_data:
pgadmin:
esdata:
certs:
Expand Down
6 changes: 3 additions & 3 deletions portal/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
REACT_APP_IN_SYLVA_GATEKEEPER_HOST=/bas_insylva/portal/gatekeeper
REACT_APP_IN_SYLVA_SOURCE_MANAGER_HOST=/bas_insylva/portal/source-manager
REACT_APP_IN_SYLVA_KEYCLOAK_HOST=/bas_insylva/portal/keycloak
REACT_APP_IN_SYLVA_GATEKEEPER_HOST=/gatekeeper
REACT_APP_IN_SYLVA_SOURCE_MANAGER_HOST=/source-manager
REACT_APP_IN_SYLVA_KEYCLOAK_HOST=/keycloak
REACT_APP_IN_SYLVA_CLIENT_ID=in-sylva.user.app
REACT_APP_IN_SYLVA_GRANT_TYPE=password
REACT_APP_IN_SYLVA_REALM=in-sylva
Expand Down
2 changes: 1 addition & 1 deletion portal/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ server {

listen 3000;
listen [::]:3000;
server_name w3.avignon.inra.fr/bas_insylva/portal/;
server_name -;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
Expand Down
2 changes: 2 additions & 0 deletions postgresql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM postgres:12.3-alpine

COPY create-multiple-postgresql-databases.sh /docker-entrypoint-initdb.d/
# RUN chown postgres:postgres /docker-entrypoint-initdb.d/

EXPOSE 5432
6 changes: 6 additions & 0 deletions search.api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
FROM node:latest

ENV DOCKERIZE_VERSION v0.6.1

RUN apt-get update && \
apt-get install -y git \
openssh-server

RUN apt-get update && apt-get install wget && apt-get install telnet -y
RUN npm install --global pm2

RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz

RUN mkdir /var/run/sshd
EXPOSE 22

Expand Down
10 changes: 5 additions & 5 deletions search/.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
REACT_APP_IN_SYLVA_GATEKEEPER_HOST=/bas_insylva/search/gatekeeper
REACT_APP_IN_SYLVA_SOURCE_MANAGER_HOST=/bas_insylva/search/source-manager
REACT_APP_IN_SYLVA_KEYCLOAK_HOST=/bas_insylva/search/keycloak
REACT_APP_IN_SYLVA_SEARCH_HOST=/bas_insylva/search/search-api
REACT_APP_IN_SYLVA_LOGIN_HOST=http://w3.avignon.inra.fr/bas_insylva/login/
REACT_APP_IN_SYLVA_GATEKEEPER_HOST=/gatekeeper
REACT_APP_IN_SYLVA_SOURCE_MANAGER_HOST=/source-manager
REACT_APP_IN_SYLVA_KEYCLOAK_HOST=/keycloak
REACT_APP_IN_SYLVA_SEARCH_HOST=/search-api
REACT_APP_IN_SYLVA_LOGIN_HOST=/login
REACT_APP_IN_SYLVA_CLIENT_ID=in-sylva.user.app
REACT_APP_IN_SYLVA_GRANT_TYPE=password
REACT_APP_IN_SYLVA_REALM=in-sylva
Expand Down
2 changes: 1 addition & 1 deletion search/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ server {

listen 3001;
listen [::]:3001;
server_name w3.avignon.inra.fr/bas_insylva/search/;
server_name -;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
Expand Down

0 comments on commit 982e560

Please sign in to comment.