diff --git a/.gitignore b/.gitignore index 8cbc32e753bd32ffcb4261ad4042712763b94830..d55534663d2c76719f53a0105f91bcbc7b0e0017 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,237 @@ +# Created by https://www.toptal.com/developers/gitignore/api/java,windows,linux,macos,maven,intellij+all,visualstudiocode,node +# Edit at https://www.toptal.com/developers/gitignore?templates=java,windows,linux,macos,maven,intellij+all,visualstudiocode,node + +### Intellij+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij+all Patch ### +# Ignore everything but code style settings and run configurations +# that are supposed to be shared within teams. + +.idea/* + +!.idea/codeStyles +!.idea/runConfigurations + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +# Eclipse m2e generated files +# Eclipse Core +.project +# JDT-specific (Eclipse Java Development Tools) +.classpath + +### Node ### # Logs logs -*.log npm-debug.log* yarn-debug.log* yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov +# Coverage directory used by tools like istanbul +coverage +*.lcov -# Compiled binary addons (http://nodejs.org/api/addons.html) +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ -# Distribution directories -dist/ +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ -# Typescript v1 declaration files -typings/ +# TypeScript cache +*.tsbuildinfo # Optional npm cache directory .npm @@ -25,6 +239,15 @@ typings/ # Optional eslint cache .eslintcache +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + # Optional REPL history .node_repl_history @@ -34,5 +257,120 @@ typings/ # Yarn Integrity file .yarn-integrity -# Mac Directory -.DS_Store \ No newline at end of file +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +### Node Patch ### +# Serverless Webpack directories +.webpack/ + +# Optional stylelint cache + +# SvelteKit build / generate output +.svelte-kit + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# Support for Project snippet scope +.vscode/*.code-snippets + +# Ignore code-workspaces +*.code-workspace + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/java,windows,linux,macos,maven,intellij+all,visualstudiocode,node \ No newline at end of file diff --git a/Frontend/src/App.js b/Frontend/src/App.js index 47f22730c6617d0bb7ddd9cb7b1da61c57279592..e53232abe39650c826e2861a8696ae69715f4594 100644 --- a/Frontend/src/App.js +++ b/Frontend/src/App.js @@ -1,8 +1,8 @@ -import Navbar from "./components/Navbar"; +import Navbar from "./components/navbar"; import { Routes, Route } from "react-router-dom"; //https://reactrouter.com/docs/en -import Landingpage from "./components/Landingpage"; -import RegisterWork from "./components/Registerwork"; -import SearchWorks from "./components/Searchworks"; +import Landingpage from "./components/landingpage"; +import RegisterWork from "./components/registerwork"; +import SearchWorks from "./components/searchworks"; import Tailwindcss from "./components/Tailwindcss"; import MyWorks from "./components/MyWorks"; diff --git a/Frontend/src/components/registerwork.jsx b/Frontend/src/components/registerwork.jsx index 7903a3c13acf47cc40370083cca867ae77e885cf..bb6bff1b300ffc3a534f41bd0ba4205f7b18f946 100644 --- a/Frontend/src/components/registerwork.jsx +++ b/Frontend/src/components/registerwork.jsx @@ -1,9 +1,9 @@ import React, { useState } from "react"; -import RegisterWorkFileUpload from "./registerwork/RegisterworkFileUpload"; -import RegisterWorkInformation from "./registerwork/RegisterworkInformation"; -import RegisterWorkLicence from "./registerwork/RegisterworkLicence"; -import RegisterWorkSave from "./registerwork/RegisterworkSave"; -import RegisterWorkConfirmation from "./registerwork/RegisterworkConfirmation"; +import RegisterWorkFileUpload from "./registerwork/registerworkFileUpload"; +import RegisterWorkInformation from "./registerwork/registerworkInformation"; +import RegisterWorkLicence from "./registerwork/registerworkLicence"; +import RegisterWorkSave from "./registerwork/registerworkSave"; +import RegisterWorkConfirmation from "./registerwork/registerworkConfirmation"; import { postAssets } from "../api"; //TODO häufig verwendete Tags abfragen diff --git a/faircommons-services/.mvn/wrapper/maven-wrapper.properties b/faircommons-services/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..b74bf7fcd640440a49eb602158547670ef907772 --- /dev/null +++ b/faircommons-services/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar diff --git a/faircommons-services/HELP.md b/faircommons-services/HELP.md new file mode 100644 index 0000000000000000000000000000000000000000..359a54fab25b04273fe83f246e6c1ae15147ff56 --- /dev/null +++ b/faircommons-services/HELP.md @@ -0,0 +1,9 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.7.2/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.7.2/maven-plugin/reference/html/#build-image) + diff --git a/faircommons-services/api-service/pom.xml b/faircommons-services/api-service/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..55f491d646f74d8570b2cb01e2223bfaeb9b0355 --- /dev/null +++ b/faircommons-services/api-service/pom.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>faircommons-services</artifactId> + <groupId>eu.fairkom.faircommons</groupId> + <version>0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>api-service</artifactId> + <packaging>jar</packaging> + + <dependencies> + <dependency> + <groupId>eu.fairkom.faircommons</groupId> + <artifactId>common</artifactId> + <version>0-SNAPSHOT</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <excludes> + <exclude> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </exclude> + </excludes> + </configuration> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file diff --git a/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/ApiServiceApplication.java b/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/ApiServiceApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..a2fc92e899c10e5bdf7aa8ac63ad983ae663637d --- /dev/null +++ b/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/ApiServiceApplication.java @@ -0,0 +1,12 @@ +package eu.fairkom.faircommons.api_service; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ApiServiceApplication { + + public static void main(String[] args) { + SpringApplication.run(ApiServiceApplication.class, args); + } +} diff --git a/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/api/WorkFilesApi.java b/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/api/WorkFilesApi.java new file mode 100644 index 0000000000000000000000000000000000000000..ea220a0ca0f3f9402de830e39f1f4c7de71eb790 --- /dev/null +++ b/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/api/WorkFilesApi.java @@ -0,0 +1,23 @@ +package eu.fairkom.faircommons.api_service.api; + +import eu.fairkom.faircommons.common.minio.MinioException; +import eu.fairkom.faircommons.common.minio.MinioService; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/files") +public class WorkFilesApi { + private final MinioService minioService; + + public WorkFilesApi(MinioService minioService) { + this.minioService = minioService; + } + + @GetMapping("/upload/presigned-url") + public String generatePresignedUploadUrl(@RequestParam String userId, @RequestParam String filename) throws MinioException { + return minioService.generatePresignedUploadUrl(userId, filename); + } +} diff --git a/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/api/WorksApi.java b/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/api/WorksApi.java new file mode 100644 index 0000000000000000000000000000000000000000..1662208e5a2511177a6062f0cec128c6dd60ee9d --- /dev/null +++ b/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/api/WorksApi.java @@ -0,0 +1,46 @@ +package eu.fairkom.faircommons.api_service.api; + +import eu.fairkom.faircommons.common.model.WorkCreateView; +import eu.fairkom.faircommons.common.model.WorkView; +import eu.fairkom.faircommons.common.rabbitmq.RabbitMqService; +import eu.fairkom.faircommons.common.rabbitmq.message.HashingMessage; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/{userId}/works") +public class WorksApi { + + private final RabbitMqService rabbitMqService; + + public WorksApi(RabbitMqService rabbitMqService) { + this.rabbitMqService = rabbitMqService; + } + + + @GetMapping + public ResponseEntity<List<WorkView>> getWorksByUserId(@PathVariable String userId) { + return null; + } + + @GetMapping("/{workId}") + public ResponseEntity<WorkView> getWorkById(@PathVariable String userId, @PathVariable String workId) { + return null; + } + + @PutMapping("/{workId}") + public ResponseEntity<Void> updateWork(@PathVariable String userId, @PathVariable String workId) { + return null; + } + + @PostMapping("/register") + public ResponseEntity<Void> registerWork(@PathVariable String userId, @RequestBody WorkCreateView workCreateView) { + var message = new HashingMessage(); + + rabbitMqService.sendMessage(message); + + return ResponseEntity.ok().build(); + } +} diff --git a/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/config/ApiServiceConfiguration.java b/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/config/ApiServiceConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..e9b08a9e51c9eecc9e0f847d91a81b7382569892 --- /dev/null +++ b/faircommons-services/api-service/src/main/java/eu/fairkom/faircommons/api_service/config/ApiServiceConfiguration.java @@ -0,0 +1,12 @@ +package eu.fairkom.faircommons.api_service.config; + +import eu.fairkom.faircommons.common.minio.MinioConfiguration; +import eu.fairkom.faircommons.common.rabbitmq.RabbitMqConfiguration; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ComponentScan(basePackageClasses = + { MinioConfiguration.class, RabbitMqConfiguration.class }) +public class ApiServiceConfiguration { +} diff --git a/faircommons-services/api-service/src/main/resources/application-local.yml b/faircommons-services/api-service/src/main/resources/application-local.yml new file mode 100644 index 0000000000000000000000000000000000000000..e0b3084fd6c0e33382fd16de7ee6044a25a9ce43 --- /dev/null +++ b/faircommons-services/api-service/src/main/resources/application-local.yml @@ -0,0 +1,11 @@ +spring: + rabbitmq: + host: localhost + username: user + password: password + port: 5672 + +minio: + url: http://localhost:9000 + accessKey: r12kaxQS56GrGHfZ + secretKey: YiM6r4ySUdJfEzqBbCAZfNYFs4FssM7Q \ No newline at end of file diff --git a/faircommons-services/api-service/src/main/resources/application.yml b/faircommons-services/api-service/src/main/resources/application.yml new file mode 100644 index 0000000000000000000000000000000000000000..0023b22639adb568659ff1b4fa989bdf91a940bb --- /dev/null +++ b/faircommons-services/api-service/src/main/resources/application.yml @@ -0,0 +1,8 @@ +spring: + application: + name: api-service + +server: + port: 8080 + servlet: + context-path: /${spring.application.name} \ No newline at end of file diff --git a/faircommons-services/common/pom.xml b/faircommons-services/common/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..af16ca6cd38731ffec9c263603ab26cd35c71c55 --- /dev/null +++ b/faircommons-services/common/pom.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>faircommons-services</artifactId> + <groupId>eu.fairkom.faircommons</groupId> + <version>0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>common</artifactId> + <packaging>jar</packaging> + + <properties> + <minio.version>8.4.3</minio.version> + </properties> + + <dependencies> + <dependency> + <groupId>io.minio</groupId> + <artifactId>minio</artifactId> + <version>${minio.version}</version> + </dependency> + </dependencies> + +</project> \ No newline at end of file diff --git a/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioConfiguration.java b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..393345145aab57705fe48abfcc5a880bdf8342fe --- /dev/null +++ b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioConfiguration.java @@ -0,0 +1,27 @@ +package eu.fairkom.faircommons.common.minio; + +import eu.fairkom.faircommons.common.minio.model.MinioConfigurationProperties; +import io.minio.MinioClient; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ConditionalOnClass(MinioClient.class) +@EnableConfigurationProperties(MinioConfigurationProperties.class) +public class MinioConfiguration { + private final MinioConfigurationProperties properties; + + public MinioConfiguration(MinioConfigurationProperties minioConfigurationProperties) { + this.properties = minioConfigurationProperties; + } + + @Bean + public MinioClient minioClient() { + return MinioClient.builder() + .endpoint(properties.getUrl()) + .credentials(properties.getAccessKey(), properties.getSecretKey()) + .build(); + } +} diff --git a/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioException.java b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioException.java new file mode 100644 index 0000000000000000000000000000000000000000..96f8f619f46b50535aaebfa571e04db778bab9a4 --- /dev/null +++ b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioException.java @@ -0,0 +1,10 @@ +package eu.fairkom.faircommons.common.minio; + +/** + * Wrapper exception for all Minio errors that occurs while fetching, removing, uploading an object to Minio. + */ +public class MinioException extends Exception { + public MinioException(String message, Throwable cause) { + super(message, cause); + } +} \ No newline at end of file diff --git a/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioService.java b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioService.java new file mode 100644 index 0000000000000000000000000000000000000000..83e9da3506f318aa8be62876598bc8655d43f5cf --- /dev/null +++ b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/minio/MinioService.java @@ -0,0 +1,79 @@ +package eu.fairkom.faircommons.common.minio; + +import io.minio.*; +import io.minio.http.Method; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import java.io.InputStream; + +@Service +public class MinioService { + private static final Logger logger = LoggerFactory.getLogger(MinioService.class); + private final MinioClient minioClient; + + public MinioService(MinioClient minioClient) { + this.minioClient = minioClient; + } + + public String generatePresignedUploadUrl(String userId, String filename) throws MinioException { + var bucketExists = bucketExists(userId); + + if (!bucketExists) { + createBucket(userId); + } + + return getPresignedObjectUrl(userId, filename, Method.PUT); + } + + public String generatePresignedDownloadUrl(String userId, String filename) throws MinioException { + return getPresignedObjectUrl(userId, filename, Method.GET); + } + public InputStream downloadFile(String userId, String filename) throws MinioException { + try { + var downloadFileArgs = GetObjectArgs.builder() + .bucket(userId) + .object(filename) + .build(); + + return minioClient.getObject(downloadFileArgs); + } catch (Exception e) { + throw new MinioException(e.getMessage(), e.getCause()); + } + } + + private void createBucket(String userId) throws MinioException { + try { + minioClient.makeBucket( + MakeBucketArgs.builder() + .bucket(userId) + .build()); + } catch (Exception e) { + throw new MinioException(e.getMessage(), e.getCause()); + } + } + + private boolean bucketExists(String userId) throws MinioException { + try { + return minioClient.bucketExists(BucketExistsArgs.builder() + .bucket(userId).build()); + } catch (Exception e) { + throw new MinioException(e.getMessage(), e.getCause()); + } + } + + private String getPresignedObjectUrl(String userId, String filename, Method method) throws MinioException { + try { + return minioClient.getPresignedObjectUrl( + GetPresignedObjectUrlArgs.builder() + .bucket(userId) + .object(filename) + .method(method) + //.expiry(1, TimeUnit.DAYS) + .build()); + } catch (Exception e) { + throw new MinioException(e.getMessage(), e.getCause()); + } + } +} diff --git a/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/rabbitmq/RabbitMqConfiguration.java b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/rabbitmq/RabbitMqConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..c7cc2aae7f66942120fe0799e3b08e481d3af272 --- /dev/null +++ b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/rabbitmq/RabbitMqConfiguration.java @@ -0,0 +1,17 @@ +package eu.fairkom.faircommons.common.rabbitmq; + +import org.springframework.amqp.core.Queue; +import org.springframework.amqp.rabbit.annotation.EnableRabbit; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableRabbit +public class RabbitMqConfiguration { + public static final String HASHING_QUEUE = "hashing-queue"; + + @Bean + Queue hashingQueue() { + return new Queue(HASHING_QUEUE, true); + } +} diff --git a/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/rabbitmq/RabbitMqReceiver.java b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/rabbitmq/RabbitMqReceiver.java new file mode 100644 index 0000000000000000000000000000000000000000..abc1b62bfbea6a4ef60c669066a2be378e48759b --- /dev/null +++ b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/rabbitmq/RabbitMqReceiver.java @@ -0,0 +1,8 @@ +package eu.fairkom.faircommons.common.rabbitmq; + +import org.springframework.amqp.rabbit.annotation.RabbitHandler; + +public interface RabbitMqReceiver<T> { + @RabbitHandler + void receive(T message) throws InterruptedException; +} diff --git a/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/rabbitmq/RabbitMqService.java b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/rabbitmq/RabbitMqService.java new file mode 100644 index 0000000000000000000000000000000000000000..d68102ed8be161bd2d00ca664ed4d4292c42db83 --- /dev/null +++ b/faircommons-services/common/src/main/java/eu/fairkom/faircommons/common/rabbitmq/RabbitMqService.java @@ -0,0 +1,20 @@ +package eu.fairkom.faircommons.common.rabbitmq; + +import eu.fairkom.faircommons.common.rabbitmq.message.HashingMessage; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.stereotype.Service; + +import static eu.fairkom.faircommons.common.rabbitmq.RabbitMqConfiguration.HASHING_QUEUE; + +@Service +public class RabbitMqService { + private final RabbitTemplate rabbitTemplate; + + public RabbitMqService(RabbitTemplate rabbitTemplate) { + this.rabbitTemplate = rabbitTemplate; + } + + public void sendMessage(HashingMessage hashingFileMessage) { + rabbitTemplate.convertAndSend(HASHING_QUEUE, hashingFileMessage); + } +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/minio/model/MinioConfigurationProperties.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/minio/model/MinioConfigurationProperties.java new file mode 100644 index 0000000000000000000000000000000000000000..6b70e0ab9e0d3c8217ccfa2d3c523526a3fc6f8c --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/minio/model/MinioConfigurationProperties.java @@ -0,0 +1,14 @@ +package eu.fairkom.faircommons.common.minio.model; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +@Data +@ConfigurationProperties("minio") +public class MinioConfigurationProperties { + private String url; + private String accessKey; + private String secretKey; + private boolean secure; + +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/HashCode.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/HashCode.java new file mode 100644 index 0000000000000000000000000000000000000000..a7a36b1af506fd5425ea2352f7e41b6eb5dcbb99 --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/HashCode.java @@ -0,0 +1,6 @@ +package eu.fairkom.faircommons.common.model; + +public class HashCode { + private String algorithm; + private String hexValue; +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/IpfsEntry.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/IpfsEntry.java new file mode 100644 index 0000000000000000000000000000000000000000..2ef33f6a6fa9cd598c5dfba53ac4e0103c1db74b --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/IpfsEntry.java @@ -0,0 +1,6 @@ +package eu.fairkom.faircommons.common.model; + +public class IpfsEntry { + private String cid; + private String path; +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/StorageOption.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/StorageOption.java new file mode 100644 index 0000000000000000000000000000000000000000..428d23043559e86be353d178fd76c5283488b244 --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/StorageOption.java @@ -0,0 +1,5 @@ +package eu.fairkom.faircommons.common.model; + +public enum StorageOption { + OBJECT_STORAGE, IPFS +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkCreateView.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkCreateView.java new file mode 100644 index 0000000000000000000000000000000000000000..80f693c42ddae8fee6c01c13847d0fcd03537fa5 --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkCreateView.java @@ -0,0 +1,23 @@ +package eu.fairkom.faircommons.common.model; + +import java.time.ZonedDateTime; +import java.util.List; + +public class WorkCreateView { + private WorkType type; + private String title; + private String description; + private List<String> tags; + private String language; + private ZonedDateTime creationDate; + private String registrar; + private String creator; //TODO clarify if the attribute is needed + private String creatorUrl; + private String publisher; //TODO what data are collected? email, name? + private List<String> attribution; //TODO what data are collected? email, name? + private String workUrl; //TODO ?? + private String identifier; + private String filename; + private WorkVisibility visibility; + private List<StorageOption> storageOptions; +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkEntity.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkEntity.java new file mode 100644 index 0000000000000000000000000000000000000000..f0029be7b69a823c8104c72ca53afe9b50696d29 --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkEntity.java @@ -0,0 +1,33 @@ +package eu.fairkom.faircommons.common.model; + +import java.time.ZonedDateTime; +import java.util.List; + +public class WorkEntity { + private WorkType type; + private String title; //immutable + private String description; + private List<String> tags; + private String language; + private ZonedDateTime creationDate; //immutable + private ZonedDateTime registrationDate; //immutable + private ZonedDateTime publishingDate; //TODO ?? + private String registrar; //keycloak userId, immutable + private String publisher; //immutable + private List<String> attribution; + + private String identifier; + + + private String fileUrl; + private String filename; + private String visibility; //PRIVATE, PUBLIC + private HashCode hashFile; //immutable + private HashCode hashMeta; //immutable + private IpfsEntry ipfsFile; //immutable + private IpfsEntry ipfsMeta; //immutable + private String status; + + + private String publicCertificate; //immutable, TODO url to pdf?? +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkType.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkType.java new file mode 100644 index 0000000000000000000000000000000000000000..95a3cd9b7daeae7ab8ea71bc7f0fc697eb03e20c --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkType.java @@ -0,0 +1,5 @@ +package eu.fairkom.faircommons.common.model; + +public enum WorkType { + DOCUMENT, AUDIO, PICTURE, VIDEO, SOFTWARE +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkView.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkView.java new file mode 100644 index 0000000000000000000000000000000000000000..2fa501f7ed5f836bd52433085f4cc7edc19c95b2 --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkView.java @@ -0,0 +1,4 @@ +package eu.fairkom.faircommons.common.model; + +public class WorkView { +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkVisibility.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkVisibility.java new file mode 100644 index 0000000000000000000000000000000000000000..36caee6bd6595e27e6fe7397a36dd8890699c215 --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/model/WorkVisibility.java @@ -0,0 +1,5 @@ +package eu.fairkom.faircommons.common.model; + +public enum WorkVisibility { + PUBLIC, PRIVATE +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/HashingMessage.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/HashingMessage.java new file mode 100644 index 0000000000000000000000000000000000000000..722b0dc95d453cfd44003a992bdbe422c74d57b8 --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/HashingMessage.java @@ -0,0 +1,12 @@ +package eu.fairkom.faircommons.common.rabbitmq.message; + +import eu.fairkom.faircommons.common.model.WorkCreateView; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class HashingMessage implements Serializable { + private HashingMessageType type; + private WorkCreateView workCreateView; +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/HashingMessageType.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/HashingMessageType.java new file mode 100644 index 0000000000000000000000000000000000000000..6d06a1267ccf1394c19c775b839f09f3e5e81850 --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/HashingMessageType.java @@ -0,0 +1,7 @@ +package eu.fairkom.faircommons.common.rabbitmq.message; + +import java.io.Serializable; + +public enum HashingMessageType implements Serializable { + FILE, META +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/IpfsMessage.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/IpfsMessage.java new file mode 100644 index 0000000000000000000000000000000000000000..2c37e4f42e300c99420b9d6046b2306974b7330f --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/IpfsMessage.java @@ -0,0 +1,4 @@ +package eu.fairkom.faircommons.common.rabbitmq.message; + +public class IpfsMessage { +} diff --git a/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/IpfsMessageType.java b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/IpfsMessageType.java new file mode 100644 index 0000000000000000000000000000000000000000..e8a1011b5566d105f681b31fc6a63371f3ae70ca --- /dev/null +++ b/faircommons-services/common/src/main/lombok/eu/fairkom/faircommons/common/rabbitmq/message/IpfsMessageType.java @@ -0,0 +1,7 @@ +package eu.fairkom.faircommons.common.rabbitmq.message; + +import java.io.Serializable; + +public enum IpfsMessageType implements Serializable { + FILE, META +} diff --git a/faircommons-services/docker-compose.yml b/faircommons-services/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..583330750fdfa7e76e10d902ee193c3469229b6d --- /dev/null +++ b/faircommons-services/docker-compose.yml @@ -0,0 +1,83 @@ +version: '3.7' + +# Settings and configurations that are common for all containers +x-minio-common: &minio-common + image: quay.io/minio/minio:RELEASE.2022-07-08T00-05-23Z + command: server --console-address ":9001" http://minio{1...4}/data{1...2} + expose: + - "9000" + - "9001" + # environment: + # MINIO_ROOT_USER: minioadmin + # MINIO_ROOT_PASSWORD: minioadmin + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + +# starts 4 docker containers running minio server instances. +# using nginx reverse proxy, load balancing, you can access +# it through port 9000. +services: + minio1: + <<: *minio-common + hostname: minio1 + volumes: + - data1-1:/data1 + - data1-2:/data2 + + minio2: + <<: *minio-common + hostname: minio2 + volumes: + - data2-1:/data1 + - data2-2:/data2 + + minio3: + <<: *minio-common + hostname: minio3 + volumes: + - data3-1:/data1 + - data3-2:/data2 + + minio4: + <<: *minio-common + hostname: minio4 + volumes: + - data4-1:/data1 + - data4-2:/data2 + + nginx: + image: nginx:1.19.2-alpine + hostname: nginx + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + ports: + - "9000:9000" + - "9001:9001" + depends_on: + - minio1 + - minio2 + - minio3 + - minio4 + + rabbitmq: + image: rabbitmq:3-management + ports: + - "5672:5672" + - "15672:15672" + environment: + - RABBITMQ_DEFAULT_USER=user + - RABBITMQ_DEFAULT_PASS=password + +## By default this config uses default local driver, +volumes: + data1-1: + data1-2: + data2-1: + data2-2: + data3-1: + data3-2: + data4-1: + data4-2: \ No newline at end of file diff --git a/faircommons-services/hashing-service/pom.xml b/faircommons-services/hashing-service/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..5049fd3ce3a53066a11c197dc7506327f8bfb45c --- /dev/null +++ b/faircommons-services/hashing-service/pom.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>faircommons-services</artifactId> + <groupId>eu.fairkom.faircommons</groupId> + <version>0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>hashing-service</artifactId> + <dependencies> + <dependency> + <groupId>eu.fairkom.faircommons</groupId> + <artifactId>common</artifactId> + <version>0-SNAPSHOT</version> + <scope>compile</scope> + </dependency> + </dependencies> + + <properties> + <maven.compiler.source>17</maven.compiler.source> + <maven.compiler.target>17</maven.compiler.target> + </properties> + +</project> \ No newline at end of file diff --git a/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/HashingServiceApplication.java b/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/HashingServiceApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..1e35bd1d33a191bc338682b34722b2f28f17e7e9 --- /dev/null +++ b/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/HashingServiceApplication.java @@ -0,0 +1,11 @@ +package eu.fairkom.faircommons.hashing_service; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class HashingServiceApplication { + public static void main(String[] args) { + SpringApplication.run(HashingServiceApplication.class, args); + } +} diff --git a/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/config/HashingServiceConfiguration.java b/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/config/HashingServiceConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..962c93e35210a87c6d7e0b34c7ac7bc5959bf6d7 --- /dev/null +++ b/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/config/HashingServiceConfiguration.java @@ -0,0 +1,11 @@ +package eu.fairkom.faircommons.hashing_service.config; + +import eu.fairkom.faircommons.common.rabbitmq.RabbitMqConfiguration; +import org.springframework.amqp.rabbit.annotation.EnableRabbit; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ComponentScan(basePackageClasses = RabbitMqConfiguration.class) +public class HashingServiceConfiguration { +} diff --git a/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/service/HashingService.java b/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/service/HashingService.java new file mode 100644 index 0000000000000000000000000000000000000000..aec3622c0ce351d915ff54b3f2969d446e93066e --- /dev/null +++ b/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/service/HashingService.java @@ -0,0 +1,35 @@ +package eu.fairkom.faircommons.hashing_service.service; + +import org.springframework.stereotype.Service; + +import java.io.InputStream; +import java.security.DigestInputStream; +import java.security.MessageDigest; + +@Service +public class HashingService { + + public String getChecksum(InputStream inputStream, String algorithm) { + try { + var messageDigest = MessageDigest.getInstance("SHA-256"); + + try (InputStream is = inputStream) { + var digestInputStream = new DigestInputStream(is, messageDigest); + while (digestInputStream.read() != -1) ; //empty loop to clear the data + messageDigest = digestInputStream.getMessageDigest(); + } + + return bytesToHex(messageDigest.digest()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private String bytesToHex(byte[] bytes) { + StringBuilder sb = new StringBuilder(); + for (byte b : bytes) { + sb.append(String.format("%02x", b)); + } + return sb.toString(); + } +} diff --git a/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/service/HashingServiceReceiver.java b/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/service/HashingServiceReceiver.java new file mode 100644 index 0000000000000000000000000000000000000000..54f2da46ce024f054150e92a174c8a5a008f8c12 --- /dev/null +++ b/faircommons-services/hashing-service/src/main/java/eu/fairkom/faircommons/hashing_service/service/HashingServiceReceiver.java @@ -0,0 +1,27 @@ +package eu.fairkom.faircommons.hashing_service.service; + +import eu.fairkom.faircommons.common.rabbitmq.RabbitMqReceiver; +import eu.fairkom.faircommons.common.rabbitmq.message.HashingMessage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.stereotype.Component; + +import static eu.fairkom.faircommons.common.rabbitmq.RabbitMqConfiguration.HASHING_QUEUE; + +@Component +@RabbitListener(queues = HASHING_QUEUE) +public class HashingServiceReceiver implements RabbitMqReceiver<HashingMessage> { + private final HashingService hashingService; + + public HashingServiceReceiver(HashingService hashingService) { + this.hashingService = hashingService; + } + + private final Logger logger = LoggerFactory.getLogger(HashingServiceReceiver.class); + + @Override + public void receive(HashingMessage message) { + logger.info("Message received: " + message.toString()); + } +} diff --git a/faircommons-services/hashing-service/src/main/resources/application-local.yml b/faircommons-services/hashing-service/src/main/resources/application-local.yml new file mode 100644 index 0000000000000000000000000000000000000000..7f59de91baf53c56144d74a1bb2e1619a4e02d0f --- /dev/null +++ b/faircommons-services/hashing-service/src/main/resources/application-local.yml @@ -0,0 +1,6 @@ +spring: + rabbitmq: + host: localhost + username: user + password: password + port: 5672 \ No newline at end of file diff --git a/faircommons-services/hashing-service/src/main/resources/application.yml b/faircommons-services/hashing-service/src/main/resources/application.yml new file mode 100644 index 0000000000000000000000000000000000000000..90612549ba465a1da4d231d5c2a3211407e5a0bf --- /dev/null +++ b/faircommons-services/hashing-service/src/main/resources/application.yml @@ -0,0 +1,8 @@ +spring: + application: + name: hashing-service + +server: + port: 8081 + servlet: + context-path: /${spring.application.name} \ No newline at end of file diff --git a/faircommons-services/ipfs-service/pom.xml b/faircommons-services/ipfs-service/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..9b28acf7ea8280299aeb03eb131974f45bbb39df --- /dev/null +++ b/faircommons-services/ipfs-service/pom.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <parent> + <artifactId>faircommons-services</artifactId> + <groupId>eu.fairkom.faircommons</groupId> + <version>0-SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + + <artifactId>ipfs-service</artifactId> + + <properties> + <maven.compiler.source>17</maven.compiler.source> + <maven.compiler.target>17</maven.compiler.target> + </properties> + +</project> \ No newline at end of file diff --git a/faircommons-services/mvnw b/faircommons-services/mvnw new file mode 100755 index 0000000000000000000000000000000000000000..8a8fb2282df5b8f7263470a5a2dc0e196f35f35f --- /dev/null +++ b/faircommons-services/mvnw @@ -0,0 +1,316 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`\\unset -f command; \\command -v java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/faircommons-services/mvnw.cmd b/faircommons-services/mvnw.cmd new file mode 100644 index 0000000000000000000000000000000000000000..1d8ab018eaf11d9b3a4a90e7818ace373dfbb380 --- /dev/null +++ b/faircommons-services/mvnw.cmd @@ -0,0 +1,188 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/faircommons-services/nginx.conf b/faircommons-services/nginx.conf new file mode 100644 index 0000000000000000000000000000000000000000..015ffeef538ea5067ed90f7a5a835030516f6ad5 --- /dev/null +++ b/faircommons-services/nginx.conf @@ -0,0 +1,106 @@ +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 4096; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + sendfile on; + keepalive_timeout 65; + + # include /etc/nginx/conf.d/*.conf; + + upstream minio { + server minio1:9000; + server minio2:9000; + server minio3:9000; + server minio4:9000; + } + + upstream console { + ip_hash; + server minio1:9001; + server minio2:9001; + server minio3:9001; + server minio4:9001; + } + + server { + listen 9000; + listen [::]:9000; + server_name localhost; + + # To allow special characters in headers + ignore_invalid_headers off; + # Allow any size file to be uploaded. + # Set to a value such as 1000m; to restrict file size to a specific value + client_max_body_size 0; + # To disable buffering + proxy_buffering off; + proxy_request_buffering off; + + location / { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_connect_timeout 300; + # Default is HTTP/1, keepalive is only enabled in HTTP/1.1 + proxy_http_version 1.1; + proxy_set_header Connection ""; + chunked_transfer_encoding off; + + proxy_pass http://minio; + } + } + + server { + listen 9001; + listen [::]:9001; + server_name localhost; + + # To allow special characters in headers + ignore_invalid_headers off; + # Allow any size file to be uploaded. + # Set to a value such as 1000m; to restrict file size to a specific value + client_max_body_size 0; + # To disable buffering + proxy_buffering off; + proxy_request_buffering off; + + location / { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-NginX-Proxy true; + + # This is necessary to pass the correct IP to be hashed + real_ip_header X-Real-IP; + + proxy_connect_timeout 300; + + # To support websocket + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + chunked_transfer_encoding off; + + proxy_pass http://console; + } + } +} diff --git a/faircommons-services/pom.xml b/faircommons-services/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..2a84a4ca8eda0d6f75dddf701c025e3af0dfd018 --- /dev/null +++ b/faircommons-services/pom.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <packaging>pom</packaging> + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>2.7.1</version> + <relativePath/> <!-- lookup parent from repository --> + </parent> + + <groupId>eu.fairkom.faircommons</groupId> + <artifactId>faircommons-services</artifactId> + <version>0-SNAPSHOT</version> + + <modules> + <module>api-service</module> + <module>common</module> + <module>hashing-service</module> + <module>ipfs-service</module> + </modules> + + <properties> + <java.version>17</java.version> + <org.mapstruct.version>1.5.2.Final</org.mapstruct.version> + </properties> + + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-configuration-processor</artifactId> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-amqp</artifactId> + </dependency> + + <dependency> + <groupId>org.springframework.amqp</groupId> + <artifactId>spring-rabbit-test</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.mapstruct</groupId> + <artifactId>mapstruct</artifactId> + <version>${org.mapstruct.version}</version> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> + </dependencies> +</project>