Skip to content
Snippets Groups Projects
Commit 7606e2af authored by Callari, Roberto's avatar Callari, Roberto
Browse files

docker

parent 8265f87e
Branches
No related tags found
No related merge requests found
Showing
with 2369 additions and 231 deletions
FROM node:12.9.0-alpine as builder
ARG BASE_HREF
RUN mkdir -p /app
WORKDIR /app
COPY package.json /app
RUN npm install
COPY . /app
RUN npm run build -- --prod --aot --base-href $BASE_HREF
FROM nginx
EXPOSE 80
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /usr/share/nginx/html
\ No newline at end of file
version: '3'
services:
urbanite-ui:
image: urbanite/urbanite-ui:latest
build:
context: .
args:
BASE_HREF: /
ports:
- '80:80'
volumes:
- ./src/assets/config.json:/usr/share/nginx/html/assets/config.json
- ./nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- urbanite-network
keycloak:
image: quay.io/keycloak/keycloak:latest
volumes:
- ./keycloak-realm:/opt/jboss/keycloak/imports
environment:
KEYCLOAK_IMPORT: /opt/jboss/keycloak/imports/realm-export.json -Dkeycloak.profile.feature.upload_scripts=enabled
DB_VENDOR: POSTGRES
DB_ADDR: postgres
DB_DATABASE: keycloak
DB_USER: keycloak
DB_SCHEMA: public
DB_PASSWORD: password
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: Pa55w0rd
ports:
- 8080:8080
depends_on:
- postgres
networks:
- urbanite-network
postgres:
image: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
networks:
- urbanite-network
volumes:
postgres_data:
driver: local
networks:
urbanite-network:
driver: bridge
\ No newline at end of file
This diff is collapsed.
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html index.htm;
include /etc/nginx/mime.types;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
location / {
try_files $uri $uri/ /index.html;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE';
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
#
# Tell client that this pre-flight info is valid for 20 days
#
return 204;
}
if ($request_method = 'DELETE') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'DELETE';
}
}
}
\ No newline at end of file
...@@ -2351,12 +2351,41 @@ ...@@ -2351,12 +2351,41 @@
"viz.js": "^1.8.0" "viz.js": "^1.8.0"
} }
}, },
"@fortawesome/angular-fontawesome": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/@fortawesome/angular-fontawesome/-/angular-fontawesome-0.8.2.tgz",
"integrity": "sha512-K/AiykA4YbHKE6XKEtZ0ZvVRQocUHyk+79HYWIfhGy3teHpzxsUqB/UjDaxivgBd6dF6ihlzgEbgrDMHlGNwGg==",
"requires": {
"tslib": "^2.1.0"
}
},
"@fortawesome/fontawesome-common-types": {
"version": "0.2.35",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.35.tgz",
"integrity": "sha512-IHUfxSEDS9dDGqYwIW7wTN6tn/O8E0n5PcAHz9cAaBoZw6UpG20IG/YM3NNLaGPwPqgjBAFjIURzqoQs3rrtuw=="
},
"@fortawesome/fontawesome-free": { "@fortawesome/fontawesome-free": {
"version": "5.14.0", "version": "5.14.0",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.14.0.tgz", "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.14.0.tgz",
"integrity": "sha512-OfdMsF+ZQgdKHP9jUbmDcRrP0eX90XXrsXIdyjLbkmSBzmMXPABB8eobUJtivaupucYaByz6WNe1PI1JuYm3qA==", "integrity": "sha512-OfdMsF+ZQgdKHP9jUbmDcRrP0eX90XXrsXIdyjLbkmSBzmMXPABB8eobUJtivaupucYaByz6WNe1PI1JuYm3qA==",
"dev": true "dev": true
}, },
"@fortawesome/fontawesome-svg-core": {
"version": "1.2.35",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.35.tgz",
"integrity": "sha512-uLEXifXIL7hnh2sNZQrIJWNol7cTVIzwI+4qcBIq9QWaZqUblm0IDrtSqbNg+3SQf8SMGHkiSigD++rHmCHjBg==",
"requires": {
"@fortawesome/fontawesome-common-types": "^0.2.35"
}
},
"@fortawesome/free-solid-svg-icons": {
"version": "5.15.3",
"resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.15.3.tgz",
"integrity": "sha512-XPeeu1IlGYqz4VWGRAT5ukNMd4VHUEEJ7ysZ7pSSgaEtNvSo+FLurybGJVmiqkQdK50OkSja2bfZXOeyMGRD8Q==",
"requires": {
"@fortawesome/fontawesome-common-types": "^0.2.35"
}
},
"@istanbuljs/schema": { "@istanbuljs/schema": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz",
...@@ -3423,16 +3452,6 @@ ...@@ -3423,16 +3452,6 @@
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
"integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU="
}, },
"angular-auth-oidc-client": {
"version": "11.4.5",
"resolved": "https://registry.npmjs.org/angular-auth-oidc-client/-/angular-auth-oidc-client-11.4.5.tgz",
"integrity": "sha512-QNQIOFE4rYU/rhq9HgDDUC+6nt7CWfyo16B+BP6AokIoAijkSZIsHz7Tpbt9ZSQKVulkM0xgWmtNsbBsV/GTog==",
"requires": {
"common-tags": "^1.8.0",
"jsrsasign-reduced": "^8.0.15",
"tslib": "^2.0.0"
}
},
"angular2-chartjs": { "angular2-chartjs": {
"version": "0.4.1", "version": "0.4.1",
"resolved": "https://registry.npmjs.org/angular2-chartjs/-/angular2-chartjs-0.4.1.tgz", "resolved": "https://registry.npmjs.org/angular2-chartjs/-/angular2-chartjs-0.4.1.tgz",
...@@ -5255,11 +5274,6 @@ ...@@ -5255,11 +5274,6 @@
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true "dev": true
}, },
"common-tags": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz",
"integrity": "sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw=="
},
"commondir": { "commondir": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
...@@ -11480,11 +11494,6 @@ ...@@ -11480,11 +11494,6 @@
} }
} }
}, },
"jsrsasign-reduced": {
"version": "8.0.15",
"resolved": "https://registry.npmjs.org/jsrsasign-reduced/-/jsrsasign-reduced-8.0.15.tgz",
"integrity": "sha512-Ig4W69nXCIUedzOSk3nqJWUr2DmSDENYfsmCqVK33GPETtPcjwREGQc92hV5jcJ6zavMvGD4tjhZ+T7JIiaSLA=="
},
"jszip": { "jszip": {
"version": "3.5.0", "version": "3.5.0",
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.5.0.tgz", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.5.0.tgz",
...@@ -13432,6 +13441,11 @@ ...@@ -13432,6 +13441,11 @@
} }
} }
}, },
"ngx-pagination": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ngx-pagination/-/ngx-pagination-5.0.0.tgz",
"integrity": "sha512-Ur0pTWRe2ZXoJ8impEzo0IZKxY5aEcQfSmL5uBqW1rHI2J6nfzgZAHsSLagKHFGchXq0PkRlDVVMcIaNxYJwvQ=="
},
"nice-try": { "nice-try": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
......
...@@ -18,7 +18,10 @@ import { OidcJWTToken } from './auth/oidc/oidc'; ...@@ -18,7 +18,10 @@ import { OidcJWTToken } from './auth/oidc/oidc';
}) })
export class AppComponent implements OnInit { export class AppComponent implements OnInit {
constructor(private analytics: AnalyticsService, private seoService: SeoService, private configService: ConfigService,
constructor(private analytics: AnalyticsService,
private seoService: SeoService,
private configService: ConfigService,
authService: NbAuthService, // force construction of the auth service authService: NbAuthService, // force construction of the auth service
oauthStrategy: NbOAuth2AuthStrategy) { oauthStrategy: NbOAuth2AuthStrategy) {
......
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { CanActivate, Router } from '@angular/router'; import { CanActivate, Router } from '@angular/router';
import { NbAuthService } from '@nebular/auth'; import { NbAuthService } from '@nebular/auth';
import { ConfigService } from '@ngx-config/core';
import { tap } from 'rxjs/operators'; import { tap } from 'rxjs/operators';
...@@ -9,10 +10,14 @@ import { tap } from 'rxjs/operators'; ...@@ -9,10 +10,14 @@ import { tap } from 'rxjs/operators';
}) })
export class AuthGuard implements CanActivate { export class AuthGuard implements CanActivate {
constructor(private authService: NbAuthService, private router: Router) { constructor(private authService: NbAuthService, private router: Router, private configService: ConfigService) {
} }
canActivate() { canActivate() {
if (!this.configService.getSettings('enableAuthentication')) {
return true;
} else {
return this.authService.isAuthenticated() return this.authService.isAuthenticated()
.pipe( .pipe(
tap(authenticated => { tap(authenticated => {
...@@ -22,5 +27,6 @@ export class AuthGuard implements CanActivate { ...@@ -22,5 +27,6 @@ export class AuthGuard implements CanActivate {
}), }),
); );
} }
}
} }
...@@ -29,11 +29,15 @@ export class TokenInterceptor implements HttpInterceptor { ...@@ -29,11 +29,15 @@ export class TokenInterceptor implements HttpInterceptor {
} }
this.auth.getToken().subscribe((x: NbAuthOAuth2JWTToken) => this.token = x);
let newHeaders = req.headers; let newHeaders = req.headers;
if(this.config.getSettings('enableAuthentication')){
this.auth.getToken().subscribe((x: NbAuthOAuth2JWTToken) => this.token = x);
if (this.token.getPayload() != null) { if (this.token.getPayload() != null) {
newHeaders = newHeaders.append('Authorization', 'Bearer ' + this.token.getPayload().access_token); newHeaders = newHeaders.append('Authorization', 'Bearer ' + this.token.getPayload().access_token);
} }
}
const authReq = req.clone({ headers: newHeaders }); const authReq = req.clone({ headers: newHeaders });
return next.handle(authReq); return next.handle(authReq);
} }
......
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DataCatalogueComponent } from './data-catalogue.component';
import { DatasetComponent } from './dataset/dataset.component';
import { SearchComponent } from './search/search.component';
const routes: Routes = [{
path: '',
redirectTo:'',
component: DataCatalogueComponent,
children: [ {
path: 'search',
component: SearchComponent,
}, {
path: 'datasets/:id',
component: DatasetComponent,
}],
}];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class DataCatalogueRoutingModule { }
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'ngx-data-catalogue',
template: `
<router-outlet></router-outlet>
`,
})
export class DataCatalogueComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DataCatalogueRoutingModule } from './data-catalogue-routing.module';
import { SearchComponent } from './search/search.component';
import { DatasetComponent } from './dataset/dataset.component';
import { DataCatalogueComponent } from './data-catalogue.component';
@NgModule({
declarations: [DataCatalogueComponent, SearchComponent, DatasetComponent],
imports: [
CommonModule,
DataCatalogueRoutingModule
]
})
export class DataCatalogueModule { }
<p>dataset works!</p>
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DatasetComponent } from './dataset.component';
describe('DatasetComponent', () => {
let component: DatasetComponent;
let fixture: ComponentFixture<DatasetComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ DatasetComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(DatasetComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'ngx-dataset',
templateUrl: './dataset.component.html',
styleUrls: ['./dataset.component.scss']
})
export class DatasetComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
export class Datalet {
id?: string;
nodeID?: string;
datasetID?: string;
distributionID?: string;
datalet_html?: string;
title?: string;
customTitle?: boolean;
registerDate?: string;
lastSeenDate?: string;
views?: number;
constructor(){}
}
\ No newline at end of file
export enum DCATAPFormat {
IDRA = "IDRA",
TURTLE = "TURTLE",
NTRIPLES = "NTRIPLES",
RDFXML = "RDF/XML",
N3 = "N3",
RDFJSON = "RDF/JSON",
JSONLD = "JSON-LD",
}
\ No newline at end of file
import { DCATDistribution } from "./dcatdistribution";
import { DCTLocation } from "./dctlocation";
import { DCTPeriodOfTime } from "./dctperiod-of-time";
import { DCTStandard } from "./dctstandard";
import { FOAFAgent } from "./foafagent";
import { SKOSConcept } from "./skosconcept";
import { VCardOrganization } from "./vcard-organization";
export class DCATDataset {
id: string;
nodeID: string;
title: string;
description: string;
distributions?: DCATDistribution[];
theme?: SKOSConcept[];
publisher?: FOAFAgent;
contactPoint?: VCardOrganization[];
keywords?: string[];
accessRights?: string;
conformsTo?: DCTStandard[];
documentation?: string[];
frequency?: string;
hasVersion?: string[];
isVersionOf?: string[];
landingPage?: string;
language?: string[];
provenance?: string[];
releaseDate?: string;
updateDate?: string;
identifier: string;
otherIdentifier?: string[];
sample?: string[];
source?: string[];
spatialCoverage?: DCTLocation;
temporalCoverage?: DCTPeriodOfTime;
type?: string;
version?: string;
versionNodes?: string[];
rightsHolder?: FOAFAgent;
creator?: FOAFAgent;
subject?: SKOSConcept[];
legacyIdentifier?: string;
constructor(){}
}
\ No newline at end of file
import { DCTLicenseDocument } from "./dctlicense-document";
import { DCTStandard } from "./dctstandard";
import { SKOSConcept } from "./skosconcept";
import { SPDXChecksum } from "./spdxchecksum";
export class DCATDistribution {
id: string;
storedRDF?: boolean;
nodeID: string;
accessURL: string;
description?: string;
format?: string;
license?: DCTLicenseDocument;
byteSize?: string;
checksum?: SPDXChecksum;
documentation?: string[];
downloadURL?: string;
language?: string[];
linkedSchemas?: DCTStandard[];
mediaType?: string;
releaseDate?: string;
updateDate?: string;
rights?: string;
status?: SKOSConcept;
title?: string;
hasDatalets?: boolean;
constructor(){}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment