Skip to content

Commit

Permalink
Merge branch 'master' of forgemia.inra.fr:in-sylva-development/in-syl…
Browse files Browse the repository at this point in the history
…va.infrastructure
  • Loading branch information
pclastre committed Aug 13, 2020
2 parents 53164dd + 6fd49b0 commit 6eceb5b
Show file tree
Hide file tree
Showing 37 changed files with 655 additions and 364 deletions.
37 changes: 37 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
COMPOSE_PROJECT_NAME=es
CERTS_DIR=/usr/share/elasticsearch/config/certificates/
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
28 changes: 0 additions & 28 deletions admin-key.pem

This file was deleted.

20 changes: 0 additions & 20 deletions admin.pem

This file was deleted.

2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Usage(){
exit
}

while [[ $# != 0 ]];do
while [ $# != 0 ];do
opt="$1"
case $opt in
-k)
Expand Down
23 changes: 23 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
opendistro_security:
dynamic:
authc:
basic_internal_auth_domain:
enabled: true
order: 0
http_authenticator:
type: basic
challenge: false
authentication_backend:
type: internal
openid_auth_domain:
enabled: true
order: 1
http_authenticator:
type: openid
challenge: false
config:
subject_key: preferred_username
roles_key: roles
openid_connect_url: http://147.100.20.44:7000/keycloak/auth/realms/in-sylva/.well-known/openid-configuration
authentication_backend:
type: noop
170 changes: 144 additions & 26 deletions data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,30 @@ CREATE TABLE IF NOT EXISTS sources (
updatedAt timestamp
);

CREATE table IF NOT EXISTS std_fields(
id serial UNIQUE NOT NULL,
std_field_id integer,

category varchar(100),
field_name varchar(250),
definition_and_comment varchar(250),
obligation_or_condition varchar(250),
cardinality varchar(200),
field_type varchar(100),
values text,

isPublic BOOLEAN,
isOptional BOOLEAN,
PRIMARY KEY (id),

CONSTRAINT std_fields_id_fkkey FOREIGN KEY (std_field_id)
REFERENCES std_fields(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);

CREATE TABLE IF NOT EXISTS sources_indices(
id serial PRIMARY KEY,
source_id integer,
Expand All @@ -36,41 +60,126 @@ CREATE TABLE IF NOT EXISTS sources_indices(
updatedAt timestamp
);

CREATE table IF NOT EXISTS provider_sources (
id serial PRIMARY KEY,
user_id integer NOT NULL,
source_id integer,
CREATE TABLE IF NOT EXISTS policies (
id serial PRIMARY KEY,
name varchar(50) NOT NULL,
source_id integer,
is_default boolean default false,

CONSTRAINT provider_sources_source_id_fkey FOREIGN KEY (source_id)
CONSTRAINT policy_source_id_fkey FOREIGN KEY (source_id)
REFERENCES sources(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

CONSTRAINT provider_sources_user_id_fkey FOREIGN KEY (user_id)
REFERENCES users(id) MATCH SIMPLE
createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);

CREATE TABLE IF NOT EXISTS policy_fields(
id serial PRIMARY KEY,
policy_id integer,
std_field_id integer,

CONSTRAINT policy_field_policy_id_fkey FOREIGN KEY (policy_id)
REFERENCES policies(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

CONSTRAINT std_fields_id_fkkey FOREIGN KEY (std_field_id)
REFERENCES std_fields(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);

CREATE table IF NOT EXISTS std_fields(
id serial UNIQUE NOT NULL,
std_field_id integer,

category varchar(100),
field_name varchar(250),
definition_and_comment varchar(250),
obligation_or_condition varchar(250),
cardinality varchar(200),
field_type varchar(100),
values text,
CREATE TABLE IF NOT EXISTS groups (
id serial PRIMARY KEY,

isPublic BOOLEAN,
isOptional BOOLEAN,
PRIMARY KEY (id),
name varchar(50) NOT NULL,

CONSTRAINT std_fields_id_fkkey FOREIGN KEY (std_field_id)
REFERENCES std_fields(id) MATCH SIMPLE
createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);

CREATE TABLE IF NOT EXISTS groups_policies (
id serial PRIMARY KEY,
group_id integer,
policy_id integer,

CONSTRAINT group_policy_policy_id_fkey FOREIGN KEY (policy_id)
REFERENCES policies(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

CONSTRAINT group_policy_group_id_fkey FOREIGN KEY (group_id)
REFERENCES groups(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);

CREATE TABLE IF NOT EXISTS group_users (
id serial PRIMARY KEY,
group_id integer,
user_id integer,

CONSTRAINT group_user_user_id_fkey FOREIGN KEY (user_id)
REFERENCES users(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

CONSTRAINT group_user_group_id_fkey FOREIGN KEY (group_id)
REFERENCES groups(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);
/* CREATE TABLE IF NOT EXISTS policy_user(
id serial PRIMARY KEY,
policy_id integer,
user_id integer,
CONSTRAINT policy_user_user_id_fkey FOREIGN KEY (user_id)
REFERENCES users(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT policy_user_policy_id_fkey FOREIGN KEY (policy_id)
REFERENCES policies(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
); */

CREATE TABLE IF NOT EXISTS source_sharing(
id serial PRIMARY KEY,
source_id integer,
user_id integer,

CONSTRAINT source_sharing_user_id_fkey FOREIGN KEY (user_id)
REFERENCES users(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

CONSTRAINT source_sharing_source_id_fkey FOREIGN KEY (source_id)
REFERENCES sources(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);


CREATE table IF NOT EXISTS provider_sources (
id serial PRIMARY KEY,
user_id integer NOT NULL,
source_id integer,

CONSTRAINT provider_sources_source_id_fkey FOREIGN KEY (source_id)
REFERENCES sources(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

CONSTRAINT provider_sources_user_id_fkey FOREIGN KEY (user_id)
REFERENCES users(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

createdAt timestamp NOT NULL DEFAULT NOW(),
Expand Down Expand Up @@ -217,14 +326,18 @@ CREATE table IF NOT EXISTS roles_users (
);

CREATE table IF NOT EXISTS user_search_his(
id serial not null,
user_id int not null references users(id),

PRIMARY KEY (id, user_id),
id serial primary key,
kc_id varchar(100) NOT NULL,

query text,
name varchar(50),
ui_structure text,
description text,

CONSTRAINT roles_users_kc_id_fkey FOREIGN KEY (kc_id)
REFERENCES users(kc_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);
Expand Down Expand Up @@ -281,6 +394,11 @@ CREATE TABLE IF NOT EXISTS profile_specifications(

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


/*
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
*/
/*
CREATE OR REPLACE FUNCTION func_role_updater() RETURNS TRIGGER AS $BODY$
BEGIN
Expand Down
Binary file modified db_schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6eceb5b

Please sign in to comment.