From 53164ddae5bc80a27015ee85c0e6276ff9889f9b Mon Sep 17 00:00:00 2001 From: Philippe Clastre Date: Thu, 13 Aug 2020 17:49:25 +0200 Subject: [PATCH 1/5] Change some option name; allow upper case module name --- build.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index a376bc7..8ece57e 100755 --- a/build.sh +++ b/build.sh @@ -6,22 +6,22 @@ Usage(){ echo "##############$0 USAGE########################" - echo "Script $0 -k -t {dev|prod} <-d domain_name>" + echo "Script $0 -k -e {dev|prod} <-d domain_name>" echo "Use it to build in-sylva docker infrastructure" echo "##############################################" - echo "$0 -k id_rsa -t dev" + echo "$0 -k id_rsa -e dev" echo " * Starts building for development; " - echo "$0 -k id_rsa -t prod -d w3.avignon.inra.fr/bas_insylva/ -s 147.100.20.44 -p 8081" + echo "$0 -k id_rsa -e prod -d w3.avignon.inra.fr/bas_insylva/ -ip 147.100.20.44 -p 8081" echo " * The portal page would be accessible with URL: http://w3.avignon.inra.fr/bas_insylva/portal/" echo " * The login page will be http://147.100.20.44:8081" echo "##############################################" echo "Args:" echo "-k : mandatory. id_rsa keyfile should exits in ~/.ssh/ user directory " - echo "-t {dev|prod}: mandatory. If deployment is choosen, you must precise -d argument" + echo "-e {dev|prod}: mandatory. Switching environment. If 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 " domain_name should appear as ///" echo " Example: w3.avignon.inra.fr/bas_insylva/portal/" - echo "-s : mandatory in production deploiement. Precise the ip address of the server (used for direct access to search application in production mode)" + echo "-ip : mandatory in production deploiement. Precise the ip address of the server (used for direct access to search application in production mode)" echo "-p : mandatory in production deploiement. Precise the port number of the server (used for direct access to login application in production mode)" echo "##############################################" exit @@ -40,7 +40,7 @@ while [[ $# != 0 ]];do KEY=$1 echo "Key file: $KEY" fi;; - -t) + -e) shift case $1 in dev) MODE=dev;; @@ -54,7 +54,7 @@ while [[ $# != 0 ]];do shift DOMAIN=$1 echo "INFO: using $DOMAIN as domaine name";; - -s) + -ip) shift LOGINSERVER=$1 echo "INFO: server used is $LOGINSERVER";; @@ -160,11 +160,15 @@ echo -n "Enter the name of docker image you want to build locally: (ex:gatekeepe read imageName +# accepting image name with uppercase: converting them to lower ! +imageName=$(echo "$imageName" | tr '[:upper:]' '[:lower:]') + if [ "$imageName" == "" ] then set $"all" fi + case $imageName in "gatekeeper") sh ./gatekeeper/build.sh $KEY From cd2e5a2c8dda9fc941d9d866a34311500b61d739 Mon Sep 17 00:00:00 2001 From: Philippe Clastre Date: Mon, 17 Aug 2020 17:29:22 +0200 Subject: [PATCH 2/5] Update data.sql with unblurred_sites table and trigger to update geom --- data.sql | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/data.sql b/data.sql index 237b6b3..526e510 100644 --- a/data.sql +++ b/data.sql @@ -390,6 +390,47 @@ CREATE TABLE IF NOT EXISTS profile_specifications( updatedAt timestamp ); +CREATE TABLE unblurred_sites +( + id integer NOT NULL, + userid integer NOT NULL, + x real NOT NULL, + y real NOT NULL, + geom geometry, + blurring_rule character(30) COLLATE pg_catalog."default" NOT NULL, + new_point boolean +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +COMMENT ON TABLE unblurred_sites + IS 'Spatial table containing unblurred coordinates'; + +CREATE OR REPLACE FUNCTION add_geom_from_x_y() + RETURNS TRIGGER + LANGUAGE PLPGSQL +AS $add_geom_from_x_y$ +BEGIN + IF NEW.new_point=true THEN + UPDATE unblurred_sites SET + new_point=false, + geom = ST_SetSRID(ST_MakePoint(NEW.x, NEW.y), 4326) + WHERE id=NEW.id; + END IF; + RETURN NEW; +END; +$add_geom_from_x_y$ ; + +DROP TRIGGER IF EXISTS tr_add_geom on unblurred_sites; +CREATE TRIGGER tr_add_geom + AFTER INSERT + ON unblurred_sites + FOR EACH ROW + EXECUTE PROCEDURE add_geom_from_x_y(); + + \connect keycloak update REALM set ssl_required = 'NONE' where id = 'master'; From c6024a53c57b2e94f715a5a467029342eedbc736 Mon Sep 17 00:00:00 2001 From: Philippe Clastre Date: Tue, 18 Aug 2020 09:59:27 +0200 Subject: [PATCH 3/5] Update data.sql: swith unblurred_sites layer with serial primary key --- data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data.sql b/data.sql index 526e510..b23b1c7 100644 --- a/data.sql +++ b/data.sql @@ -392,7 +392,7 @@ CREATE TABLE IF NOT EXISTS profile_specifications( CREATE TABLE unblurred_sites ( - id integer NOT NULL, + id SERIAL PRIMARY KEY, userid integer NOT NULL, x real NOT NULL, y real NOT NULL, From d4dc912c1c39129b8df7530052486467c8b9d0b8 Mon Sep 17 00:00:00 2001 From: "Benjamin.Jaillet" Date: Wed, 19 Aug 2020 14:06:58 +0200 Subject: [PATCH 4/5] fixed error msg when -e option is missing --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 5fdda28..483a644 100755 --- a/build.sh +++ b/build.sh @@ -67,7 +67,7 @@ while [ $# != 0 ];do done if [ -z $MODE ]; then - echo "ERROR: the -t option is mandatory. Check Usage and relaunch" + echo "ERROR: the -e option is mandatory. Check Usage and relaunch" Usage exit fi From 10950aa2bc047a127c425ea945fd753d5be1bbb9 Mon Sep 17 00:00:00 2001 From: Aytac Ozkan Date: Thu, 20 Aug 2020 10:18:33 +0200 Subject: [PATCH 5/5] ** --- docker-compose.yml | 2 +- login/Dockerfile | 4 +++- portal/.env | 1 + portal/.env_generic | 1 + search/nginx/nginx.conf | 30 +++++++++++++++--------------- search/nginx/nginx_generic.conf | 30 +++++++++++++++--------------- 6 files changed, 36 insertions(+), 32 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0f8863a..e020594 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -379,7 +379,7 @@ services: IN_SYLVA_GRANT_TYPE: "password" IN_SYLVA_REALM: "in-sylva" ports: - - 8081:8080 + - 8081:8081 links: - gatekeeper - keycloak diff --git a/login/Dockerfile b/login/Dockerfile index 46018e7..be783fe 100644 --- a/login/Dockerfile +++ b/login/Dockerfile @@ -74,4 +74,6 @@ EXPOSE 8080 WORKDIR /app/in-sylva.user.login/ -CMD [ "pm2-runtime", "npm","--", "start" ] \ No newline at end of file +CMD [ "pm2-runtime", "npm","--", "start" ] + +# CMD npm run start \ No newline at end of file diff --git a/portal/.env b/portal/.env index f156d05..8b50c49 100644 --- a/portal/.env +++ b/portal/.env @@ -1,6 +1,7 @@ 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_LOGIN_HOST=http://localhost:8081 REACT_APP_IN_SYLVA_CLIENT_ID=in-sylva.user.app REACT_APP_IN_SYLVA_GRANT_TYPE=password REACT_APP_IN_SYLVA_REALM=in-sylva diff --git a/portal/.env_generic b/portal/.env_generic index f156d05..8b50c49 100644 --- a/portal/.env_generic +++ b/portal/.env_generic @@ -1,6 +1,7 @@ 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_LOGIN_HOST=http://localhost:8081 REACT_APP_IN_SYLVA_CLIENT_ID=in-sylva.user.app REACT_APP_IN_SYLVA_GRANT_TYPE=password REACT_APP_IN_SYLVA_REALM=in-sylva diff --git a/search/nginx/nginx.conf b/search/nginx/nginx.conf index d12d32c..a8ed38d 100644 --- a/search/nginx/nginx.conf +++ b/search/nginx/nginx.conf @@ -61,23 +61,23 @@ server { proxy_pass http://backend_search/; } - location /login/_next/static/ { - autoindex on; + # location /login/_next/static/ { + # autoindex on; # /app/in-sylva.user.login/.next/static/G-XKPGgjYNxek_SDdSj9a/pages - alias /app/in-sylva.user.login/.next/static; - } + # alias /app/in-sylva.user.login/.next/static; + #} - location /login/ { - proxy_pass http://login:8080/; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - - sub_filter_once off; - proxy_set_header Accept-Encoding ""; - } + # location /login/ { + # proxy_pass http://login:8080/; + # proxy_http_version 1.1; + # proxy_set_header Upgrade $http_upgrade; + # proxy_set_header Connection 'upgrade'; + # proxy_set_header Host $host; + # proxy_cache_bypass $http_upgrade; + + # sub_filter_once off; + # proxy_set_header Accept-Encoding ""; + #} location /source-manager/ { diff --git a/search/nginx/nginx_generic.conf b/search/nginx/nginx_generic.conf index d12d32c..a8ed38d 100644 --- a/search/nginx/nginx_generic.conf +++ b/search/nginx/nginx_generic.conf @@ -61,23 +61,23 @@ server { proxy_pass http://backend_search/; } - location /login/_next/static/ { - autoindex on; + # location /login/_next/static/ { + # autoindex on; # /app/in-sylva.user.login/.next/static/G-XKPGgjYNxek_SDdSj9a/pages - alias /app/in-sylva.user.login/.next/static; - } + # alias /app/in-sylva.user.login/.next/static; + #} - location /login/ { - proxy_pass http://login:8080/; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - - sub_filter_once off; - proxy_set_header Accept-Encoding ""; - } + # location /login/ { + # proxy_pass http://login:8080/; + # proxy_http_version 1.1; + # proxy_set_header Upgrade $http_upgrade; + # proxy_set_header Connection 'upgrade'; + # proxy_set_header Host $host; + # proxy_cache_bypass $http_upgrade; + + # sub_filter_once off; + # proxy_set_header Accept-Encoding ""; + #} location /source-manager/ {