From b9569d52a42d46425af9fc2cb5533a16fe61c317 Mon Sep 17 00:00:00 2001 From: Lukas Harzenetter Date: Mon, 9 Jan 2023 16:00:12 +0100 Subject: [PATCH 1/3] update setup documentation --- .docker/docker-compose.yml | 10 ++++---- docs/dev/index.md | 31 ++++++++++++----------- src/main/resources/application.properties | 6 ++--- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 053a679..08db1ba 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -1,13 +1,13 @@ version: '3' services: db: - image: postgres:10 + image: postgres:15 environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: postgres + POSTGRES_USER: patternatlas + POSTGRES_PASSWORD: patternatlas + POSTGRES_DB: patternatlas ports: - - "5432:5432" + - "5060:5432" networks: - default networks: diff --git a/docs/dev/index.md b/docs/dev/index.md index ec62640..698158d 100644 --- a/docs/dev/index.md +++ b/docs/dev/index.md @@ -9,21 +9,22 @@ This is achieved through using the OAuth 2.0 Authentication Code Flow, additiona It runs on Port 8081 ### Development -1. Clone the repository `git clone https://github.com/PatternAtlas/pattern-pedia-auth.git`. -2. Navigate to repository directory `cd pattern-pedia-auth/`. -2. Build the repository - - `mvn package -DskipTests`(Windows) (skiping the tests for a faster build), Java 8 required. - - `./mvnw clean package -DskipTests`(Unix) (skiping the tests for a faster build), Java 8 required. -#### Docker Installation -3. Build the image `docker build -t patternpedia/auth .` ([Docker](https://docs.docker.com/get-docker/) required) - -##### Auth & DB -4. Navigate to directory `..\.docker\` -5. Insert the following commands `docker-compose -f docker-compose-with-db.yml up -d` - -##### Auth -4. Navigate to directory `..\.docker\` -5. Insert the following commands `docker-compose up -d` + +1. Run the maven build `mvn package -DskipTests` +2. Clone the contents repository `git clone https://github.com/PatternAtlas/pattern-atlas-content`. +3. Clone the Docker repository `git clone https://github.com/PatternAtlas/pattern-atlas-docker` +4. Setup IntelliJ to also use the contents repository in the deployment. :warning: you MUST use the _Applicaition_ run configuration, not _Spring Boot_! + ![Run-Configuration](IntelliJ-run-config.png) +5. Start the development configuration using docker compose: + 1. Change into the docker compose repository + 2. Run the following command `docker-compose -f docker-compose.dev.yml up -d` +6. Run the Pattern Atlas using IntelliJ +7. Go to and login with user admin and password admin +8. Add a user by ONLY specifying her name +9. Afterwards, under the _Credentials_ tab, you can set a password for this user. Make sure to set the `Temporary` flag to `false`! +10. Start the UI (either using Docker or local setup) +11. Go to and login. The first user is automatically assigned to the ADMIN role. + #### IntelliJ 3. [Follow PatternAtlasAPI from Step 5 pls](#step5) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 855a097..a3fc8f1 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ server.port=1977 -spring.datasource.url=jdbc:postgresql://localhost:5432/patternatlas +spring.datasource.url=jdbc:postgresql://localhost:5060/patternatlas spring.datasource.username=patternatlas spring.datasource.password=patternatlas spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect @@ -23,7 +23,7 @@ io.github.patternatlas.api.latexrenderer.port=5030 # Embedded Tomcat server.servlet.contextPath=/patternatlas # liquibase file -spring.liquibase.change-log=patternatlas.xml +spring.liquibase.change-log=patternatlas_full.xml # DB debug logs spring.jpa.show-sql=false -spring.jpa.properties.hibernate.show_sql=false \ No newline at end of file +spring.jpa.properties.hibernate.show_sql=false From f1ef6f3033b3375fe719de6321f882663fbc328c Mon Sep 17 00:00:00 2001 From: Lukas Harzenetter Date: Mon, 9 Jan 2023 16:00:42 +0100 Subject: [PATCH 2/3] add flags for patterns --- .../java/io/github/patternatlas/api/entities/Pattern.java | 6 ++++++ .../io/github/patternatlas/api/rest/model/PatternModel.java | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/patternatlas/api/entities/Pattern.java b/src/main/java/io/github/patternatlas/api/entities/Pattern.java index 9cad317..4bb6ab7 100644 --- a/src/main/java/io/github/patternatlas/api/entities/Pattern.java +++ b/src/main/java/io/github/patternatlas/api/entities/Pattern.java @@ -46,4 +46,10 @@ public class Pattern extends EntityWithURI { @Type(type = "jsonb") @Column(columnDefinition = "jsonb") private Object renderedContent; + + @Column(columnDefinition = "boolean default false") + private Boolean deploymentModelingStructurePattern; + + @Column(columnDefinition = "boolean default false") + private Boolean deploymentModelingBehaviorPattern; } diff --git a/src/main/java/io/github/patternatlas/api/rest/model/PatternModel.java b/src/main/java/io/github/patternatlas/api/rest/model/PatternModel.java index 600d09e..0eb54f7 100644 --- a/src/main/java/io/github/patternatlas/api/rest/model/PatternModel.java +++ b/src/main/java/io/github/patternatlas/api/rest/model/PatternModel.java @@ -3,7 +3,6 @@ import java.util.UUID; import com.fasterxml.jackson.annotation.JsonIgnore; - import io.github.patternatlas.api.entities.Pattern; import io.github.patternatlas.api.entities.PatternLanguage; import lombok.Data; @@ -27,6 +26,9 @@ public class PatternModel { protected String patternLanguageName; + private Boolean deploymentModelingBehaviorPattern; + private Boolean deploymentModelingStructurePattern; + @JsonIgnore protected Pattern pattern; @@ -39,6 +41,8 @@ private PatternModel(Pattern pattern) { PatternLanguage patternLanguage = pattern.getPatternLanguage(); this.patternLanguageId = patternLanguage.getId(); this.patternLanguageName = patternLanguage.getName(); + this.deploymentModelingBehaviorPattern = pattern.getDeploymentModelingBehaviorPattern(); + this.deploymentModelingStructurePattern = pattern.getDeploymentModelingStructurePattern(); } public static PatternModel from(Pattern pattern) { From 74cd190b02f5b69c03ac808e8c9ffe33e12b2517 Mon Sep 17 00:00:00 2001 From: Lukas Harzenetter Date: Tue, 10 Jan 2023 14:26:10 +0100 Subject: [PATCH 3/3] update new auth port --- src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a3fc8f1..7eb56f3 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -12,7 +12,7 @@ springdoc.default-produces-media-type=application/hal+json # alt: AUTH-Server # security.oauth2.resource.jwk.key-set-uri=http://localhost:8081/.well-known/jwks.json # neu: Keycloak -security.oauth2.resource.jwk.key-set-uri=http://localhost:8080/realms/patternatlas/protocol/openid-connect/certs +security.oauth2.resource.jwk.key-set-uri=http://localhost:7080/realms/patternatlas/protocol/openid-connect/certs #okta.oauth2.issuer=https://dev-918271.okta.com/oauth2/default #okta.oauth2.clientId=0oa1eflyl1wZDVLLg357 #----------------------------