Skip to content

Commit

Permalink
**readme file is updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
anatolicvs committed Sep 12, 2020
1 parent 5dbeac7 commit bbcc194
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 15 deletions.
6 changes: 5 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ IN_SYLVA_SMTP_HOST=smtp.gmail.com
IN_SYLVA_SMTP_PORT=465
IN_SYLVA_SMTP_SECURE=true
IN_SYLVA_EMAIL_TO=[email protected]
IN_SYLVA_EMAIL_FROM=[email protected]
IN_SYLVA_EMAIL_FROM=[email protected]


IN_SYLVA_ADMIN_USERNAME=[email protected]
IN_SYLVA_ADMIN_PASSWORD=InSylva1465441881
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,48 @@
* docker >= 17.12.0+
* docker-compose

* Run this command `docker-compose --compatibility up -d`
* Run this command for stats of the container (ex: Mem & CPU usage.) `docker stats postgres_container`
## Build

* To Build the all necessary images regarding of your environment, it could be your machine as development or your host machine as production environment. Follow the example below;
* Starts building for development;

```sh
$ sh build.sh -k id_rsa -e dev
```
* Starts building for production;

```sh
$ sh build.sh -k id_rsa -e prod -d w3.avignon.inra.fr/bas_insylva/ -ip 147.100.20.44 -p 8081
```

## RUN
* To able to run `Infrastructure`, please follow these stages below;
* Run this command
```sh
$ docker-compose --compatibility up -d
```
* Run this command for stats of the container (ex: Mem & CPU usage.)
```sh
$ docker stats postgres_container
```

* After build stage is completed, you should configure your 'Keycloak',
* First, please go your PgAdmin (http://$YOUR_IP_OR_LOCALHOST:5050/), then enter the credentials that located in the project root .env file. After login, make your postgresql settings and switch the 'keycloak as your primary database' and run this command as below;

```sql
update REALM set ssl_required = 'NONE' where id = 'master';
```
* Second, please go your Keycloak application by following this url ((http://$YOUR_IP_OR_LOCALHOST:7000/keycloak/auth/), then enter the neccessary login credentials that located in the project root .env file, and import the `realm-export.json` it is located in the keycloak folder.
* After the second step, please run below command to able to create admin user for the system, be aware it is very important, without this account you cannot acces to portal.
* Finnaly you can access to portal, with these credentials:
* username: [email protected]
* psswd:
```sh
$ curl --location --request POST 'http://$YOUR_IP_OR_LOCALHOST:4000/user/create-system-user'
```
[![asciicast](https://asciinema.org/a/aoUNfjZ2okPW5WFltYSQqmrsm.svg)](https://asciinema.org/a/aoUNfjZ2okPW5WFltYSQqmrsm)
Expand Down
12 changes: 6 additions & 6 deletions data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -428,20 +428,20 @@ CREATE TABLE IF NOT EXISTS profile_specifications(
--This function computes the geom attribute from x and y coordinates
--It just returns true when finished
-- can be called with a simple command: select
drop table if exists unblurred_sites cascade;
-- drop table if exists unblurred_sites cascade; #You can't drop any table that is not exist previously.
CREATE TABLE unblurred_sites
(
id SERIAL PRIMARY KEY,
userid integer ,
indexid varchar(120), -- in elasticsearch index_id holds all documents within. The reason of to remove sourceid from the table is simple I do not want to make unnecessary joins through source table.
docid varchar(100) , -- in index_id doc_id is symbolize one unique document.
siteid integer,
siteid integer, -- it is useless for me #ozkan
x real NOT NULL,
y real NOT NULL,
geom geometry,
blurring_rule character(30) COLLATE pg_catalog."default" NOT NULL,
new_point boolean,
--do not delete the line below.
--do not delete the lines below, they are necessary for the ORM
createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
)
Expand All @@ -457,7 +457,7 @@ COMMENT ON TABLE unblurred_sites
--This function computes the geom attribute from x and y coordinates
--It just returns true when finished
-- can be called with a simple command: select
DROP FUNCTION add_geom_from_x_y();
-- DROP FUNCTION add_geom_from_x_y();
CREATE FUNCTION add_geom_from_x_y()
RETURNS BOOLEAN
LANGUAGE PLPGSQL
Expand Down Expand Up @@ -568,9 +568,9 @@ SELECT INTO nb_perdus count(lost_id) FROM overlapping;
END
$$;

\connect keycloak
-- \connect keycloak

update REALM set ssl_required = 'NONE' where id = 'master';
-- update REALM set ssl_required = 'NONE' where id = 'master';


/*
Expand Down
19 changes: 13 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
'
user: "0"
working_dir: /usr/share/elasticsearch
volumes: ['certs:/usr/share/elasticsearch/config/certificates']
volumes: ["certs:/usr/share/elasticsearch/config/certificates"]

es01:
container_name: es01
Expand All @@ -31,7 +31,12 @@ services:
- xpack.security.transport.ssl.verification_mode=certificate
- xpack.security.transport.ssl.keystore.path=/usr/share/elasticsearch/config/certificates/elastic-certificates.p12
- xpack.security.transport.ssl.truststore.path=/usr/share/elasticsearch/config/certificates/elastic-certificates.p12
volumes: ['esdata:/usr/share/elasticsearch/data', 'certs:/usr/share/elasticsearch/config/certificates', 'logs:/var/log']
volumes:
[
"esdata:/usr/share/elasticsearch/data",
"certs:/usr/share/elasticsearch/config/certificates",
"logs:/var/log",
]
ulimits:
nofile:
soft: 65536
Expand Down Expand Up @@ -80,7 +85,7 @@ services:
- ELASTICSEARCH_HOSTS=http://es01:9200
- ELASTICSEARCH_USERNAME=$ELASTICSEARCH_USERNAME
- ELASTICSEARCH_PASSWORD=$ELASTICSEARCH_PASSWORD
volumes:
volumes:
- type: volume
source: logs
target: /var/log
Expand Down Expand Up @@ -216,7 +221,7 @@ services:
networks:
- insylva-net
restart: unless-stopped

search-api:
image: in-sylva.search.api:latest
depends_on: [es01]
Expand Down Expand Up @@ -288,14 +293,17 @@ services:
KEYCLOAK_CREDENTIALS_SECRET: $KEYCLOAK_CREDENTIALS_SECRET

IN_SYLVA_reCAPTCHA_SECRET_KEY: $IN_SYLVA_reCAPTCHA_SECRET_KEY

IN_SYLVA_EMAIL: $IN_SYLVA_EMAIL
IN_SYLVA_EMAIL_PASSWORD: $IN_SYLVA_EMAIL_PASSWORD
IN_SYLVA_SMTP_HOST: $IN_SYLVA_SMTP_HOST
IN_SYLVA_SMTP_PORT: $IN_SYLVA_SMTP_PORT
IN_SYLVA_SMTP_SECURE: $IN_SYLVA_SMTP_SECURE
IN_SYLVA_EMAIL_TO: $IN_SYLVA_EMAIL_TO
IN_SYLVA_EMAIL_FROM: $IN_SYLVA_EMAIL_FROM

IN_SYLVA_ADMIN_USERNAME: $IN_SYLVA_ADMIN_USERNAME
IN_SYLVA_ADMIN_PASSWORD: $IN_SYLVA_ADMIN_PASSWORD
networks:
- insylva-net
restart: unless-stopped
Expand Down Expand Up @@ -445,7 +453,6 @@ volumes:
certs:
portainer_data:
logs:


networks:
insylva-net:
Expand Down

0 comments on commit bbcc194

Please sign in to comment.