diff --git a/build.sh b/build.sh index 93b7b8f..d94c1da 100755 --- a/build.sh +++ b/build.sh @@ -6,23 +6,23 @@ 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 "-d domain_name: mandatory in production deployment. Precise the base URL which will be use to contact application." + 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 deployment. Precise the ip address of the server (used for direct access to search application in production mode)" - echo "-p : mandatory in production deployment. Precise the port number of the server (used for direct access to login 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";; @@ -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 @@ -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 diff --git a/data.sql b/data.sql index 3cce885..d735716 100644 --- a/data.sql +++ b/data.sql @@ -399,6 +399,47 @@ CREATE TABLE IF NOT EXISTS profile_specifications( updatedAt timestamp ); +CREATE TABLE unblurred_sites +( + id SERIAL PRIMARY KEY, + 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'; 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/ {