Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meico Converter, Code Quality Analyzers, NFDI4C Registry #69

Merged
merged 20 commits into from
Jun 27, 2023
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
80 changes: 80 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "dev", main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "dev" ]
schedule:
- cron: '28 18 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# 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
# queries: security-extended,security-and-quality

- name: maven-settings
uses: s4u/[email protected]
with:
servers: '[{"id": "edirom", "username": "${github.actor}", "password": "${GITHUB_TOKEN}"},{"id": "teic", "username": "${github.actor}", "password": "${GITHUB_TOKEN}"}]'

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
#- name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
- name: Build with Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn clean package --file pom.xml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
15 changes: 15 additions & 0 deletions .github/workflows/fair-software.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: fair-software

on: push

jobs:
verify:
name: "fair-software"
runs-on: ubuntu-latest
steps:
- uses: fair-software/[email protected]
name: Measure compliance with fair-software.eu recommendations
env:
PYCHARM_HOSTED: "Trick colorama into displaying colored output"
with:
MY_REPO_URL: "https://github.com/${{ github.repository }}"
1 change: 1 addition & 0 deletions .howfairis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
skip_registry_checks_reason : "registered in NFDI4Culture Registry for Tools & Services at https://nfdi4culture.de/de/ressourcen/registry/details/meigarage"
2 changes: 0 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
authors:
- family-names: "Parkoła"
given-names: "Tomasz"
- family-names: "Stanisławczyk"
Expand All @@ -28,6 +27,5 @@ authors:
given-names: "Anne"
title: "MEIGarage"
version: 0.5.2
doi:
date-released: 2022-09-08
url: "https://github.com/Edirom/MEIGarage"
88 changes: 88 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Want to contribute?

That's awesome, thank you!

The following is a set of guidelines for contributing to the MEIGarage. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.


## I don't want to read this whole thing I just have a question!!!

The best way to initially get in touch with the MEIGarage community is via the `mei-garage` [Slack channel] on music-encoding.slack.com.
Or you can start a discussion here at [GitHub Discussions].


## Bug reports and feature requests

If you've noticed a bug or have a feature request, please open a [GitHub issue] (well, you might want to look through the open issues before to avoid creating duplicates)! It's generally best if you get confirmation of your bug or approval for your feature request this way before starting to code.


## Create a branch

If this is something you think you can fix, then create a branch with a descriptive name, either in a [fork of this repo] (if it is clear that you will be the only one working on issue in the new branch), or in this repo directly.

Please keep in mind that before coding along there should be a ticket for the task you want to accomplish.

A good branch name would be (where issue #33 is the ticket you're working on):

```sh
git checkout -b issue-33
```

## Build and test your branch locally

With [Docker installed] you simply tell it to build your locally checked out branch ("issue-33") with

```sh
docker build --tag meigarage:issue-33 .
```

and then you run it like

```sh
docker run --name meigarage-issue-33 -p 8080:8080 -d meigarage:issue-33
```

## Make a Pull Request

If everything works as expected, you should switch back to your dev branch and make sure it's up to date with our dev (= our default) branch:
```sh
git remote add upstream [email protected]:edirom/MEIGarage.git
git checkout dev
git pull upstream dev
```

Then update your feature branch from your local copy of develop, and push it

```sh
git checkout issue-33
git rebase dev
git push --set-upstream origin issue-33
```

Finally, go to GitHub and [make a Pull Request]

## Merging a PR (maintainers only)

A PR can only be merged into main by a maintainer if:

* The branch is building ok on [DockerHub].
* It has been approved by at least two people. If it was a maintainer who opened the PR, only one extra approval is needed.
* It has no requested changes.
* It has no conflicts with current develop. (Even better: it is up to date with current develop)

Any maintainer is allowed to merge a PR if all of these conditions are
met.


## Acknowledgements

Large portions of these Contributing Guidelines were copied from [ActiveAdmin]. Thanks!

[Slack channel]: https://music-encoding.slack.com/archives/C02RXAU582D
[GitHub Discussions]: https://github.com/Edirom/MEIGarage/discussions
[GitHub issue]: https://github.com/Edirom/MEIGarage/issues/new
[fork this repo]: https://help.github.com/articles/fork-a-repo
[Docker installed]: https://docs.docker.com/get-docker/
[make a pull request]: https://help.github.com/articles/creating-a-pull-request
[ActiveAdmin]: https://github.com/activeadmin/activeadmin/blob/HEAD/CONTRIBUTING.md
[DockerHub]: https://hub.docker.com/r/edirom/meigarage
22 changes: 16 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# of the MEIGarage (backend),
# and installs it in a Tomcat application server
#########################################
FROM tomcat:9-jdk11-openjdk
FROM tomcat:9-jdk11


LABEL org.opencontainers.image.source=https://github.com/edirom/meigarage
Expand Down Expand Up @@ -43,6 +43,8 @@ RUN apt-get install -y --no-install-recommends fonts-dejavu \
librsvg2-bin \
curl \
libxml2-utils \
unzip \
git \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt \
&& apt-get clean
Expand All @@ -68,15 +70,23 @@ COPY docker-entrypoint.sh /my-docker-entrypoint.sh
COPY log4j.xml /var/cache/oxgarage/log4j.xml

# download artifacts to /tmp and deploy them at ${CATALINA_WEBAPPS}
# the war-file is zipped so we need to unzip it twice at the next stage
#conditional copy in docker needs a strange hack
COPY log4j.xml artifact/meigarage.wa[r] /tmp/

#if the action is run on github, the war is already located in the artifact folder because of the previous github action
#RUN if [ "$BUILDTYPE" = "github" ] ; then \
# cp artifact/meigarage.war /tmp/; \
# fi
#need to use strange hack for this conditional copy
COPY artifac[t]/meigarage.wa[r] /tmp/

# if docker build is local the latest artifact needs to be downloaded using the nightly link url
RUN if [ "$BUILDTYPE" = "local" ] ; then \
curl -Ls ${WEBSERVICE_ARTIFACT} -o /tmp/meigarage.zip \
&& unzip -q /tmp/meigarage.zip -d /tmp/; \
fi \
&& unzip -q /tmp/meigarage.war -d ${CATALINA_WEBAPPS}/ege-webservice/ \
fi

# these war-files are zipped so we need to unzip them twice
# the GUI/webclient needs to be downloaded locally and on github
RUN unzip -q /tmp/meigarage.war -d ${CATALINA_WEBAPPS}/ege-webservice/ \
&& rm -Rf ${CATALINA_WEBAPPS}/ROOT \
&& cp ${CATALINA_WEBAPPS}/ege-webservice/WEB-INF/lib/oxgarage.properties /etc/ \
&& rm -f /tmp/*.war \
Expand Down
File renamed without changes.
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
[![GitHub license](https://img.shields.io/github/license/teic/TEIGarage.svg)](https://github.com/Edirom/MEIGarage/blob/main/LICENSE)
[![GitHub release](https://img.shields.io/github/v/release/Edirom/MEIGarage.svg)](https://github.com/Edirom/MEIGarage/releases)
[![Docker](https://img.shields.io/docker/pulls/edirom/meigarage)](https://hub.docker.com/r/edirom/meigarage)
[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8B%20%20%E2%97%8F%20%20%E2%97%8F-yellow)](https://fair-software.eu)
[![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)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6279/badge)](https://bestpractices.coreinfrastructure.org/projects/6279)
[![NFDI4C Registry](https://img.shields.io/badge/included%20in%20NFDI4C%20registry-64BEA0 )](https://nfdi4culture.de/resources/registry/details/meigarage)

<!-- TABLE OF CONTENTS -->
## Table of Contents

* [About the Project](#about)
* [How to use](#how-to-use)
* [Installation](#installation)
* [With Docker](#installing-with-docker)
* [Without Docker](#installing-without-docker)
Expand All @@ -26,19 +28,28 @@ Further information on the *code structure* of MEIGarage and TEIGarage can be fo

A running instance of MEIGarage can be found at [meigarage.edirom.de](https://meigarage.edirom.de/).

# How to use

Open API documentation can be found at https://github.com/Edirom/MEIGarage/blob/main/src/main/webapp/openapi.json or at the running instance https://meigarage.edirom.de/ege-webservice/. A curl example call to the API to convert an existing MEI 3.0 document to an MEI 4.0 document looks like

```
curl -o 4.0.0.mei -F [email protected] https://meigarage.edirom.de/ege-webservice/Conversions/mei30%3Atext%3Axml/mei40%3Atext%3Axml/
```

# Installation

## Installing with Docker

With Docker installed, a readymade image can be fetched from the [GitHub Container](https://github.com/Edirom/MEIGarage/pkgs/container/meigarage).
With Docker installed, a readymade image can be fetched from the [GitHub Docker Registry](https://github.com/Edirom/MEIGarage/pkgs/container/meigarage) or [DockerHub](https://hub.docker.com/r/edirom/meigarage).

`docker pull ghcr.io/edirom/meigarage:latest` or `docker pull edirom/meigarage:latest`

`docker pull ghcr.io/edirom/meigarage:latest`
A container can be run using:

```bash
docker run --rm \
-p 8080:8080 \
-e WEBSERVICE_URL=http://localhost:8080/ege-webservice/ \
--name meigarage ghcr.io/edirom/meigarage
--name meigarage edirom/meigarage:latest
```

Once it's running, you can point your browser at `http://localhost:8080/ege-webservice` for the webservice.
Expand All @@ -47,8 +58,6 @@ You can also get the development version from DockerHub with `docker pull edirom

### available parameters

* **WEBSERVICE_URL** : The full URL of the RESTful *web service*. This is relevant for the *web client* (aka the GUI) if you are running the docker container on a different port or with a different URL.

* **-v** Stylesheet paths : The local path to the stylesheets and sources can be mounted to /usr/share/xml/tei/ using the --volume parameter, using e.g. `-v /your/path/to/Stylesheets:/usr/share/xml/tei/stylesheet \
-v /your/path/to/TEI/P5:/usr/share/xml/tei/odd`

Expand Down
7 changes: 4 additions & 3 deletions log4j.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
<TimeBasedTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy max="5" />
</RollingFile> -->
</RollingFile>
</Appenders>
<Loggers>
<Logger name="debug" level="debug">
<Logger name="de.edirom.meigarage" level="debug" additivity="false">
<AppenderRef ref="rollingFile"/>
</Logger>
<Root level="info" additivity="false">
<Root level="warn">
<AppenderRef ref="console"/>
<AppenderRef ref="rollingFile"/>
</Root>
</Loggers>
</Configuration>
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@
<version>0.6.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.edirom.meigarage</groupId>
<artifactId>meico-converter</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/WEB-INF/config/fileExt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@
<mime-ext mime="application/postscript" ext=".ps" />
<mime-ext mime="image/svg+xml" ext=".svg" />
<mime-ext mime="audio/x-midi" ext=".mid" />
<mime-ext mime="audio/mp3" ext=".mp3" />
</file-extensions-map>