Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: Build

on:
push:
branches:
- master
paths-ignore:
- 'docs/**'

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@4
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -50,21 +53,30 @@ jobs:
ports:
- 9200:9200
- 9300:9300
options: -e="discovery.type=single-node" -e="xpack.security.enabled=false" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
options: >-
-e="discovery.type=single-node"
-e="xpack.security.enabled=false"
--health-cmd="curl http://localhost:9200/_cluster/health"
--health-interval=10s
--health-timeout=5s
--health-retries=10

minio:
image: docker.io/bawix/minio:2022
ports:
- 9000:9000
- 9001:9001
options: -e="MINIO_ROOT_USER=root" -e="MINIO_ROOT_PASSWORD=password" -e="MINIO_DEFAULT_BUCKETS=default"
options: >-
-e="MINIO_ROOT_USER=root"
-e="MINIO_ROOT_PASSWORD=password"
-e="MINIO_DEFAULT_BUCKETS=default"

steps:
- name: Test Database
- name: Test Elasticsearch health
env:
ELASTIC_SEARCH_URL: http://localhost:${{ job.services.elasticsearch.ports[9200] }}
Comment thread
machacjozef marked this conversation as resolved.
run: |
echo $ELASTIC_SEARCH_URL
echo "Elasticsearch URL: $ELASTIC_SEARCH_URL"
curl -fsSL "$ELASTIC_SEARCH_URL/_cat/health?h=status"

- uses: actions/checkout@v4
Expand Down Expand Up @@ -92,7 +104,12 @@ jobs:
restore-keys: ${{ runner.os }}-m2

- name: Generate certificates
run: cd application-engine/src/main/resources/certificates && openssl genrsa -out keypair.pem 4096 && openssl rsa -in keypair.pem -pubout -out public.crt && openssl pkcs8 -topk8 -inform PEM -outform DER -nocrypt -in keypair.pem -out private.der && cd ../../../../..
run: |
cd application-engine/src/main/resources/certificates
openssl genrsa -out keypair.pem 4096
openssl rsa -in keypair.pem -pubout -out public.crt
openssl pkcs8 -topk8 -inform PEM -outform DER -nocrypt -in keypair.pem -out private.der
cd ../../../../..
Comment thread
machacjozef marked this conversation as resolved.

- name: Build
run: mvn clean package install -DskipTests=true
Expand All @@ -103,7 +120,7 @@ jobs:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=netgrif_application-engine

- name: Build, test
- name: Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -B verify
Expand Down Expand Up @@ -139,8 +156,10 @@ jobs:
mvn javadoc:javadoc
cp -r ./application-engine/target/reports/apidocs/* ./docs/javadoc/

- uses: EndBug/add-and-commit@v9
with:
add: docs
pathspec_error_handling: exitImmediately
message: 'CI - Update documentation'
- name: Commit docs if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add docs
git diff --staged --quiet || git commit -m "CI - Update documentation"
git push
13 changes: 7 additions & 6 deletions application-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencyManagement>
Expand Down Expand Up @@ -359,9 +355,14 @@

<!-- QR code -->
<dependency>
<groupId>com.github.kenglxn.qrgen</groupId>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.5.4</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.0.1</version>
<version>3.5.4</version>
</dependency>

<!-- ElasticSearch -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,35 @@
@Data
public class QrCode {

public static final double DEFAULT_LOGO_RATIO = 0.15;
public static final int DEFAULT_LOGO_BACKGROUND_PADDING = 4;
public static final int DEFAULT_LOGO_BACKGROUND_ARC = 8;
public static final QrImageType DEFAULT_IMAGE_TYPE = QrImageType.PNG;

private String content;

private String fileName;

private ImageType imageType = ImageType.JPG;
private QrImageType imageType = DEFAULT_IMAGE_TYPE;

private int width = 250;

private int height = 250;

private ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel.L;
private ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel.H;

private int onColor = 0xFF000000;

private int offColor = 0xFFFFFFFF;

private String charset = "ISO-8859-1";

private double logoRatio = DEFAULT_LOGO_RATIO;

private int logoBackgroundPadding = DEFAULT_LOGO_BACKGROUND_PADDING;

private int logoBackgroundArc = DEFAULT_LOGO_BACKGROUND_ARC;

public QrCode(String fileName, String content) {
this.fileName = fileName;
this.content = content;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.netgrif.application.engine.business.qr;

public enum QrImageType {

PNG("png"),
JPG("jpg"),
JPEG("jpeg"),
GIF("gif"),
BMP("bmp");

private final String format;

QrImageType(String format) {
this.format = format;
}

public String getFormat() {
return format;
}
}
Loading
Loading