diff --git a/deployment/docker-compose.yaml b/deployment/docker-compose.yaml index 84ba63e..4be2977 100644 --- a/deployment/docker-compose.yaml +++ b/deployment/docker-compose.yaml @@ -22,14 +22,14 @@ services: - "443:443" volumes: - ./nginx/conf:/etc/nginx:ro - - ./certbot/www:/var/www/certbot - - ./certbot/conf:/etc/letsencrypt + - ./certbot/www/:/var/www/certbot/:ro + - ./certbot/conf/:/etc/letsencrypt/:rw command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'" certbot: image: certbot/certbot container_name: certbot restart: unless-stopped volumes: - - ./certbot/conf:/etc/letsencrypt - - ./certbot/www:/var/www/certbot + - ./certbot/conf/:/etc/letsencrypt/:rw + - ./certbot/www/:/var/www/certbot/:rw entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" diff --git a/deployment/nginx/conf/nginx.conf b/deployment/nginx/conf/nginx.conf index 4a92475..5a190ed 100644 --- a/deployment/nginx/conf/nginx.conf +++ b/deployment/nginx/conf/nginx.conf @@ -13,8 +13,8 @@ http { listen [::]:443 ssl; http2 on; - ssl_certificate /etc/letsencrypt/live/marketplace.cetaf.org-0001/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/marketplace.cetaf.org-0001/privkey.pem; + ssl_certificate /etc/letsencrypt/live/marketplace.cetaf.org/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/marketplace.cetaf.org/privkey.pem; ssl_session_timeout 1d; ssl_session_cache shared:MozSSL:10m; ssl_session_tickets off; @@ -23,7 +23,7 @@ http { # intermediate configuration ssl_protocols TLSv1.2 TLSv1.3; - ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA> + ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA>; ssl_prefer_server_ciphers off; # HSTS (ngx_http_headers_module is required) (63072000 seconds) @@ -34,7 +34,7 @@ http { ssl_stapling_verify on; # verify chain of trust of OCSP response using Root CA and Intermediate certs - ssl_trusted_certificate /etc/letsencrypt/live/marketplace.cetaf.org-0001/fullchain.pem; + ssl_trusted_certificate /etc/letsencrypt/live/marketplace.cetaf.org/fullchain.pem; location / { proxy_pass http://tettris_marketplace:3000; diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 607f83a..56753be 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,17 +1,18 @@ server { - include mime.types; + include mime.types; - listen 3000; + listen 3000; - location / { - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html; - } + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } - error_page 500 502 503 504 /50x.html; + error_page 500 502 503 504 /50x.html; + + location = /50x.html { + root /usr/share/nginx/html; + } - location = /50x.html { - root /usr/share/nginx/html; - } } \ No newline at end of file diff --git a/src/api/taxonomicService/GetTaxonomicServices.ts b/src/api/taxonomicService/GetTaxonomicServices.ts index 62dead0..ce7404d 100644 --- a/src/api/taxonomicService/GetTaxonomicServices.ts +++ b/src/api/taxonomicService/GetTaxonomicServices.ts @@ -62,11 +62,6 @@ const GetTaxonomicServices = async ({ pageNumber, pageSize, searchFilters }: { p /* Get result data from JSON */ const data: CordraResultArray = result.data; - /* Check if there are any results */ - if (!data.results.length) { - throw (new Error('No results found', { cause: 200 })); - }; - /* Set Taxonomic Services */ data.results.forEach((dataFragment) => { const taxonomicService = dataFragment.attributes.content as TaxonomicService; diff --git a/src/app/types/TaxonomicService.d.ts b/src/app/types/TaxonomicService.d.ts index e9dabd0..cb8d08e 100644 --- a/src/app/types/TaxonomicService.d.ts +++ b/src/app/types/TaxonomicService.d.ts @@ -26,9 +26,9 @@ export interface TaxonomicService { */ "ods:type": string; /** - * http://purl.org/dc/terms/license + * http://purl.org/dc/terms/licence */ - "dcterms:license": string; + "dcterms:licence": string; /** * The current state of the object */ @@ -152,9 +152,9 @@ export interface TaxonomicService { */ "erp:multimediaUrl": string; /** - * http://purl.org/dc/terms/license + * http://purl.org/dc/terms/licence */ - "dcterms:license"?: string; + "dcterms:licence"?: string; [k: string]: unknown; }[]; [k: string]: unknown; diff --git a/src/components/search/Search.tsx b/src/components/search/Search.tsx index 76b01c6..a027afd 100644 --- a/src/components/search/Search.tsx +++ b/src/components/search/Search.tsx @@ -38,19 +38,22 @@ const Search = () => { /* Base variables */ const paginator = usePaginator({ - Initiate: () => dispatch(setTaxonomicServices([])), + Initiate: () => { + dispatch(setTaxonomicServices([])); + setNoMoreResults(false); + }, Method: GetTaxonomicServices, Handler: (taxonomicServices: TaxonomicService[]) => { /* On receival of a new page with records, add them to the total */ dispatch(concatToTaxonomicServices(taxonomicServices)); dispatch(setIsApiOnline(true)) + + if (!taxonomicServices.length) { + setNoMoreResults(true); + } }, ErrorHandler: (error: Error) => { - if (error.cause === 200) { - setNoMoreResults(true); - } else { - dispatch(setIsApiOnline(false)); - }; + dispatch(setIsApiOnline(false)); }, pageSize: 12, resultKey: 'taxonomicServices', @@ -125,23 +128,23 @@ const Search = () => { {/* Load more button */} - {(!paginator.loading && !paginator.errorMessage && paginator.totalRecords > 0) ? + {(!paginator.loading && !noMoreResults && paginator.totalRecords > 0) && paginator.Next?.()} > Load more - : <> - {(!noMoreResults && paginator.totalRecords > 0) ? - - : - - {paginator.errorMessage} - - - } - > + } + {(!paginator.loading && noMoreResults && paginator.totalRecords > 0) && + + + {`No ${paginator.totalRecords > 0 ? 'more ' : ''}results found`} + + + } + {paginator.loading && + } diff --git a/src/components/taxonomicService/TaxonomicService.tsx b/src/components/taxonomicService/TaxonomicService.tsx index b7d9dbc..5f6b877 100644 --- a/src/components/taxonomicService/TaxonomicService.tsx +++ b/src/components/taxonomicService/TaxonomicService.tsx @@ -130,7 +130,7 @@ const TaxonomicService = () => {
{paginator.errorMessage}
{`No ${paginator.totalRecords > 0 ? 'more ' : ''}results found`}