Skip to content

Commit 7f4bc8c

Browse files
authored
Merge pull request #63 from TEIC/dev
Add new tei guidelines and stylesheets to docker image
2 parents e21b896 + 7857da5 commit 7f4bc8c

11 files changed

Lines changed: 162 additions & 54 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "maven" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/codeql.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "dev", main ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "dev" ]
20+
schedule:
21+
- cron: '28 18 * * 0'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'java' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Use only 'java' to analyze code written in Java, Kotlin or both
38+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
39+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v3
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v2
48+
with:
49+
languages: ${{ matrix.language }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
53+
54+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55+
# queries: security-extended,security-and-quality
56+
57+
- name: maven-settings
58+
uses: s4u/maven-settings-action@v2.7.0
59+
with:
60+
servers: '[{"id": "teic", "username": "${github.actor}", "password": "${GITHUB_TOKEN}"}]'
61+
62+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
63+
# If this step fails, then you should remove it and run the build manually (see below)
64+
#- name: Autobuild
65+
# uses: github/codeql-action/autobuild@v2
66+
67+
# ℹ️ Command-line programs to run using the OS shell.
68+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
69+
70+
# If the Autobuild fails above, remove it and uncomment the following three lines.
71+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
72+
- name: Build with Maven
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
run: mvn clean package --file pom.xml
76+
77+
- name: Perform CodeQL Analysis
78+
uses: github/codeql-action/analyze@v2
79+
with:
80+
category: "/language:${{matrix.language}}"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: fair-software
2+
3+
on: push
4+
5+
jobs:
6+
verify:
7+
name: "fair-software"
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: fair-software/howfairis-github-action@0.2.1
11+
name: Measure compliance with fair-software.eu recommendations
12+
env:
13+
PYCHARM_HOSTED: "Trick colorama into displaying colored output"
14+
with:
15+
MY_REPO_URL: "https://github.com/${{ github.repository }}"

.howfairis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
skip_registry_checks_reason : "will be registered in NFDI4Culture Registry for Tools & Services"
1+
skip_registry_checks_reason : "registered in NFDI4Culture Registry for Tools & Services at https://nfdi4culture.de/de/ressourcen/registry/details/teigarage"

CITATION.cff

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ authors:
2727
given-names: "Anne"
2828
title: "TEIGarage"
2929
version: 1.0.0
30-
doi:
3130
date-released: 2022-09-14
3231
url: "https://github.com/TEIC/TEIGarage"

Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# of both the ege-webclient and the TEIGarage (backend),
66
# and installs it in a Tomcat application server
77
#########################################
8-
FROM tomcat:9-jdk11-openjdk
8+
FROM tomcat:9-jdk11
99

1010
LABEL org.opencontainers.image.source=https://github.com/teic/teigarage
1111

@@ -36,6 +36,7 @@ RUN apt-get update \
3636
libgcc-10-dev \
3737
librsvg2-bin \
3838
curl \
39+
unzip \
3940
&& ln -s ${OFFICE_HOME} /usr/lib/openoffice \
4041
&& rm -rf /var/lib/apt/lists/*
4142

@@ -55,15 +56,23 @@ COPY log4j.xml /var/cache/oxgarage/log4j.xml
5556
# && unzip /tmp/webservice.zip -d /tmp/
5657

5758
# download artifacts to /tmp and deploy them at ${CATALINA_WEBAPPS}
58-
# these war-files are zipped so we need to unzip them twice
59-
#conditional copy in docker needs a strange hack
60-
COPY log4j.xml artifact/teigarage.wa[r] /tmp/
6159

60+
61+
# if the action is run on github, the war is already located in the artifact folder because of the previous github action
62+
#RUN if [ "$BUILDTYPE" = "github" ] ; then \
63+
# cp artifact/teigarage.war /tmp/ ; \
64+
# fi
65+
COPY artifac[t]/teigarage.wa[r] /tmp/
66+
67+
# if docker build is local the latest artifact needs to be downloaded using the nightly link url
6268
RUN if [ "$BUILDTYPE" = "local" ] ; then \
6369
curl -Ls ${WEBSERVICE_ARTIFACT} -o /tmp/teigarage.zip \
6470
&& unzip -o -q /tmp/teigarage.zip -d /tmp/; \
65-
fi \
66-
&& unzip -q /tmp/teigarage.war -d ${CATALINA_WEBAPPS}/ege-webservice/ \
71+
fi
72+
73+
# these war-files are zipped so we need to unzip them twice
74+
# the GUI/webclient needs to be downloaded locally and on github
75+
RUN unzip -q /tmp/teigarage.war -d ${CATALINA_WEBAPPS}/ege-webservice/ \
6776
&& rm -Rf ${CATALINA_WEBAPPS}/ROOT \
6877
&& curl -Ls ${WEBCLIENT_ARTIFACT} -o /tmp/webclient.zip \
6978
&& unzip -q /tmp/webclient.zip -d /tmp/ \

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@
44
[![GitHub license](https://img.shields.io/github/license/teic/TEIGarage.svg)](https://github.com/TEIC/TEIGarage/blob/main/LICENSE)
55
[![GitHub release](https://img.shields.io/github/v/release/TEIC/TEIGarage.svg)](https://github.com/TEIC/TEIGarage/releases)
66
[![Docker](https://img.shields.io/docker/pulls/teic/teigarage)](https://hub.docker.com/r/teic/teigarage)
7-
[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8B-yellow)](https://fair-software.eu)
7+
[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green)](https://fair-software.eu)
88
[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6925/badge)](https://bestpractices.coreinfrastructure.org/projects/6925)
9+
[![NFDI4C Registry](https://img.shields.io/badge/NFDI4Culture%20Registry-64BEA0)](https://nfdi4culture.de/id/E4102)
910

1011
<!-- TABLE OF CONTENTS -->
1112
## Table of Contents
1213

1314
* [About the Project](#about)
15+
* [How to use](#how-to-use)
1416
* [Installation](#installation)
1517
* [With Docker](#installing-with-docker)
1618
* [Without Docker](#installing-without-docker)
1719
* [Building with Maven](#building-with-maven)
1820

21+
1922
# About
2023

2124
TEIGarage is a webservice and RESTful service to transform, convert and validate various formats, focussing on the [TEI](https://tei-c.org/) format.
@@ -25,6 +28,14 @@ Further information on the **code structure** of MEIGarage and TEIGarage can be
2528

2629
A running instance of TEIGarage can be found at [teigarage.tei-c.org](https://teigarage.tei-c.org/).
2730

31+
# How to use
32+
33+
Open API documentation can be found at https://github.com/TEIC/TEIGarage/blob/main/src/main/webapp/openapi.json or at the running instance https://teigarage.tei-c.org/ege-webservice/. A curl example call to the API to convert an existing .docx to a TEI file looks like
34+
35+
```
36+
curl -o output.xml -F upload=@input.docx https://teigarage.tei-c.org/ege-webservice/Conversions/docx%3Aapplication%3Avnd.openxmlformats-officedocument.wordprocessingml.document/TEI%3Atext%3Axml/
37+
```
38+
2839
# Installation
2940

3041
## Installing with Docker

pom.xml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>pl.psnc.dl.ege.webapp</groupId>
55
<artifactId>teigarage</artifactId>
6-
<version>1.1.1</version>
6+
<version>1.2.1</version>
77
<packaging>war</packaging>
88
<name>TEI Garage</name>
99
<properties>
@@ -142,7 +142,7 @@
142142
<plugin>
143143
<groupId>org.apache.maven.plugins</groupId>
144144
<artifactId>maven-compiler-plugin</artifactId>
145-
<version>3.10.1</version>
145+
<version>3.11.0 </version>
146146
<configuration>
147147
<source>11</source>
148148
<target>11</target>
@@ -159,6 +159,28 @@
159159
<finalName>${project.artifactId}-${project.version}</finalName>
160160
</configuration>
161161
</plugin>-->
162+
<plugin>
163+
<groupId>org.apache.maven.plugins</groupId>
164+
<artifactId>maven-pmd-plugin</artifactId>
165+
<version>3.21.2</version>
166+
<configuration>
167+
<failOnViolation>false</failOnViolation>
168+
<printFailingErrors>true</printFailingErrors>
169+
<linkXRef>false</linkXRef>
170+
</configuration>
171+
</plugin>
172+
<plugin>
173+
<groupId>org.owasp</groupId>
174+
<artifactId>dependency-check-maven</artifactId>
175+
<version>9.0.1</version>
176+
<executions>
177+
<execution>
178+
<goals>
179+
<goal>check</goal>
180+
</goals>
181+
</execution>
182+
</executions>
183+
</plugin>
162184
</plugins>
163185
</build>
164186
<dependencies>
@@ -172,17 +194,17 @@
172194
<dependency>
173195
<groupId>io.swagger.core.v3</groupId>
174196
<artifactId>swagger-jaxrs2</artifactId>
175-
<version>2.2.0</version>
197+
<version>2.2.19</version>
176198
</dependency>
177199
<dependency>
178200
<groupId>io.swagger.core.v3</groupId>
179201
<artifactId>swagger-jaxrs2-servlet-initializer-v2</artifactId>
180-
<version>2.2.0</version>
202+
<version>2.2.19</version>
181203
</dependency>
182204
<dependency>
183205
<groupId>javax.ws.rs</groupId>
184206
<artifactId>javax.ws.rs-api</artifactId>
185-
<version>2.1</version>
207+
<version>2.1.1</version>
186208
</dependency>
187209
<dependency>
188210
<groupId>pl.psnc.dl.ege</groupId>
@@ -205,7 +227,7 @@
205227
<dependency>
206228
<groupId>pl.psnc.dl.ege.tei</groupId>
207229
<artifactId>tei-converter</artifactId>
208-
<version>0.6.4</version>
230+
<version>0.6.5</version>
209231
<scope>compile</scope>
210232
</dependency>
211233
<dependency>

src/main/java/pl/psnc/dl/ege/webapp/servlet/ConversionServlet.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import javax.ws.rs.GET;
1111
import javax.ws.rs.POST;
1212
import javax.ws.rs.Path;
13-
import javax.ws.rs.PathParam;
1413

1514

1615
import io.swagger.v3.oas.annotations.ExternalDocumentation;
@@ -26,8 +25,6 @@
2625

2726
import io.swagger.v3.oas.annotations.responses.ApiResponse;
2827
import io.swagger.v3.oas.annotations.tags.Tag;
29-
import org.apache.logging.log4j.Logger;
30-
import org.apache.logging.log4j.LogManager;
3128

3229
import org.json.XML;
3330

@@ -57,24 +54,6 @@
5754
)
5855
public class ConversionServlet extends HttpServlet {
5956

60-
private static final String imagesDirectory = "media";
61-
62-
private static final String EZP_EXT = ".ezp";
63-
64-
private static final String FORMAT_DOCX = "docx";
65-
66-
private static final String FORMAT_ODT = "oo";
67-
68-
private static final String APPLICATION_MSWORD = "application/msword";
69-
70-
private static final String APPLICATION_EPUB = "application/epub+zip";
71-
72-
private static final String APPLICATION_ODT = "application/vnd.oasis.opendocument.text";
73-
74-
private static final String APPLICATION_OCTET_STREAM = "application/octet-stream";
75-
76-
private static final Logger LOGGER = LogManager.getLogger(ConversionServlet.class);
77-
7857
private static final long serialVersionUID = 1L;
7958

8059
public static final String SLASH = "/";
@@ -83,16 +62,8 @@ public class ConversionServlet extends HttpServlet {
8362

8463
public static final String SEMICOLON = ";";
8564

86-
public static final String R_WRONG_METHOD = "Wrong method: GET, expected: POST.";
87-
8865
public static final String CONVERSIONS_SLICE_BASE = "Conversions/";
8966

90-
public static final String ZIP_EXT = ".zip";
91-
92-
public static final String DOCX_EXT = ".docx";
93-
94-
public static final String EPUB_EXT = ".epub";
95-
9667
public static final String ODT_EXT = ".odt";
9768

9869
Conversion conversion;
@@ -102,7 +73,6 @@ public class ConversionServlet extends HttpServlet {
10273
*/
10374
public ConversionServlet() {
10475
super();
105-
Conversion conversion = new Conversion();
10676
}
10777

10878
/**

src/main/java/pl/psnc/dl/ege/webapp/servlet/CustomizationServlet.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
import io.swagger.v3.oas.annotations.media.Schema;
99
import io.swagger.v3.oas.annotations.responses.ApiResponse;
1010
import io.swagger.v3.oas.annotations.tags.Tag;
11-
import org.apache.logging.log4j.Logger;
12-
import org.apache.logging.log4j.LogManager;
1311
import org.json.XML;
1412
import pl.psnc.dl.ege.webapp.servlethelpers.Customization;
1513

@@ -28,9 +26,6 @@
2826
})
2927
public class CustomizationServlet extends HttpServlet {
3028

31-
private static final Logger LOGGER = LogManager
32-
.getLogger(CustomizationServlet.class);
33-
3429
private static final long serialVersionUID = 1L;
3530

3631
Customization customization = new Customization();

0 commit comments

Comments
 (0)