diff --git a/Dockerfile b/Dockerfile index 6a8913cc..01cbf401 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -from node:12.22.0-buster +from node:18-bullseye # instalar ENV DEBIAN_FRONTEND noninteractive @@ -6,10 +6,10 @@ ENV DEBIAN_FRONTEND noninteractive # Install mongodb RUN apt-get update RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget git curl apt-transport-https ca-certificates apt-utils gnupg build-essential apache2 libaio1 -RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add - -RUN echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | tee /etc/apt/sources.list.d/mongodb-org-4.2.list +RUN curl -fsSL https://pgp.mongodb.com/server-6.0.asc | gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor +RUN echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list RUN apt-get update -RUN apt-get install -y mongodb-org=4.2.1 mongodb-org-server=4.2.1 mongodb-org-shell=4.2.1 mongodb-org-mongos=4.2.1 mongodb-org-tools=4.2.1 +RUN apt-get install -y mongodb-org #Dependencias de chronium para el envio por correo RUN apt-get install -y ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils @@ -31,4 +31,4 @@ COPY /eda /eda RUN chmod u+x /eda/docker_run.sh # entrypoint -ENTRYPOINT /eda/docker_run.sh \ No newline at end of file +ENTRYPOINT /eda/docker_run.sh diff --git a/eda/docker_run.sh b/eda/docker_run.sh index 5b8777f4..54dd259b 100644 --- a/eda/docker_run.sh +++ b/eda/docker_run.sh @@ -19,16 +19,16 @@ fi if ! $eda_installed then - mongo --eval 'db.createCollection("users")' EDA - mongo --eval 'db.createCollection("groups")' EDA - mongo --eval 'db.createCollection("dashboard")' EDA - mongo --eval 'db.createCollection("data-source")' EDA - mongo --eval 'db.createCollection("files")' EDA - mongo --eval 'db.createCollection("features")' EDA - mongo --eval 'db.groups.insert( { "_id": ObjectId("135792467811111111111110"), "role": "EDA_ADMIN_ROLE", "name" : "ADMIN", "users":[ ObjectId("135792467811111111111111") ] } )' EDA - mongo --eval 'db.groups.insert( { "_id": ObjectId("135792467811111111111113"), "role": "EDA_USER_ROLE", "name" : "RO", "users":[] } )' EDA - mongo --eval 'db.users.insert( { "_id" : ObjectId("135792467811111111111111"), "role" : [ ObjectId("135792467811111111111110") ], "name" : "EDA", "email" : "eda@jortilles.com", "password" : "$2a$10$J48xu5KAqobLzvD8FX1LOem7NZUMuXPHID1uSHzbzTbM.wGFPXjb2" } )' EDA - mongo --eval ' db.users.insert( { "_id" : ObjectId("135792467811111111111112"), "role" : [], "name" : "edaanonim", "email" : "edaanonim@jortilles.com", "password" : "$2a$10$ziukAcgjgTe2XPmjO1xsruKJW1HlX0I2pvCiKZHQ69DdaCzgZA4/2" } ) ' EDA + mongosh --eval 'db.createCollection("users")' EDA + mongosh --eval 'db.createCollection("groups")' EDA + mongosh --eval 'db.createCollection("dashboard")' EDA + mongosh --eval 'db.createCollection("data-source")' EDA + mongosh --eval 'db.createCollection("files")' EDA + mongosh --eval 'db.createCollection("features")' EDA + mongosh --eval 'db.groups.insert( { "_id": ObjectId("135792467811111111111110"), "role": "EDA_ADMIN_ROLE", "name" : "ADMIN", "users":[ ObjectId("135792467811111111111111") ] } )' EDA + mongosh --eval 'db.groups.insert( { "_id": ObjectId("135792467811111111111113"), "role": "EDA_USER_ROLE", "name" : "RO", "users":[] } )' EDA + mongosh --eval 'db.users.insert( { "_id" : ObjectId("135792467811111111111111"), "role" : [ ObjectId("135792467811111111111110") ], "name" : "EDA", "email" : "eda@jortilles.com", "password" : "$2a$10$J48xu5KAqobLzvD8FX1LOem7NZUMuXPHID1uSHzbzTbM.wGFPXjb2" } )' EDA + mongosh --eval ' db.users.insert( { "_id" : ObjectId("135792467811111111111112"), "role" : [], "name" : "edaanonim", "email" : "edaanonim@jortilles.com", "password" : "$2a$10$ziukAcgjgTe2XPmjO1xsruKJW1HlX0I2pvCiKZHQ69DdaCzgZA4/2" } ) ' EDA npm install -g forever forever-monitor nodemon http-server @@ -47,7 +47,7 @@ then cd /eda/eda_app/ - npm install + npm install --legacy-peer-deps npm run build:prod rm -rf /var/www/html cp -r /eda/eda_app/dist/app-eda /var/www/html diff --git a/eda/eda_app/src/app/core/pages/login/login.component.ts b/eda/eda_app/src/app/core/pages/login/login.component.ts index c9713fc0..4be591b1 100644 --- a/eda/eda_app/src/app/core/pages/login/login.component.ts +++ b/eda/eda_app/src/app/core/pages/login/login.component.ts @@ -100,7 +100,7 @@ export class LoginComponent implements OnInit { if( baseUrl.substring(-4) == '/es/' || baseUrl.substring(-4) == '/ca/' || baseUrl.substring(-4) == '/en/' ){ - baseUrl = baseUrl.substring(0, baseUrl.length -3) + baseUrl = baseUrl.substring(0, baseUrl.length -5) } switch(lan){ case 'EN' : window.location.href = baseUrl + 'en/#/'; break; diff --git a/eda/eda_app/src/app/shared/components/sidebar/sidebar.component.ts b/eda/eda_app/src/app/shared/components/sidebar/sidebar.component.ts index af1e7b74..7bb02324 100644 --- a/eda/eda_app/src/app/shared/components/sidebar/sidebar.component.ts +++ b/eda/eda_app/src/app/shared/components/sidebar/sidebar.component.ts @@ -126,10 +126,10 @@ export class SidebarComponent implements OnInit { public redirectLocale(lan: string) { let baseUrl = window.location.href.split('#')[0]; - if (baseUrl.substr(-4) == '/es/' || - baseUrl.substr(-4) == '/ca/' || - baseUrl.substr(-4) == '/en/') { - baseUrl = baseUrl.substr(0, baseUrl.length - 3) + if (baseUrl.substring(-4) == '/es/' || + baseUrl.substring(-4) == '/ca/' || + baseUrl.substring(-4) == '/en/') { + baseUrl = baseUrl.substring(0, baseUrl.length - 5) } switch (lan) { case 'EN': window.location.href = baseUrl + 'en/#/home'; break; diff --git a/eda/eda_app/src/index_locale.html b/eda/eda_app/src/index_locale.html index 4e3b25c2..c7b35a29 100644 --- a/eda/eda_app/src/index_locale.html +++ b/eda/eda_app/src/index_locale.html @@ -8,6 +8,8 @@ window.location.href = window.location.href.replace('/index.html','')+'/es'; }else if(userLang === 'ca-ES'){ window.location.href = window.location.href.replace('/index.html','')+'/ca'; + }else if(userLang.indexOf('pl') >=0){ + window.location.href = window.location.href.replace('/index.html','')+'/pl'; }else{ window.location.href = window.location.href.replace('/index.html','')+'/en'; }