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

Initial release #1

Merged
merged 3 commits into from
Aug 8, 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
26 changes: 13 additions & 13 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright Jiaqi Liu
# Copyright Paion Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,18 +39,18 @@
steps:
- uses: actions/checkout@v3
- uses: actionshub/markdownlint@main
markdown-link-check:
name: Markdown Link Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: "yes"
# markdown-link-check:

Check warning on line 42 in .github/workflows/ci-cd.yml

View workflow job for this annotation

GitHub Actions / YAML Style Check

42:1 [comments-indentation] comment not indented like content
# name: Markdown Link Check
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: gaurav-nelson/github-action-markdown-link-check@v1
# with:
# use-verbose-mode: "yes"

tests:
name: Unit & Integration Tests
needs: [yaml-lint, markdown-lint, markdown-link-check]
needs: [yaml-lint, markdown-lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -85,7 +85,7 @@
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B -Pcoverage sonar:sonar org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.java.binaries=target/classes -Dsonar.projectKey=QubitPi_jersey-ws-template
run: mvn -B -Pcoverage sonar:sonar org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.java.binaries=target/classes -Dsonar.projectKey=paion-data_astraios

documentation:
name: Test & Release Documentation (including Javadoc)
Expand Down Expand Up @@ -151,11 +151,11 @@
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/jersey-ws-template:latest
tags: ${{ secrets.DOCKERHUB_USERNAME }}/astraios:latest

hashicorp:
name: Publish Jersey WS AMI Image and Deploy it to EC2 through HashiCorp
if: ${{ github.event.repository.name != 'jersey-ws-template' }}
if: ${{ github.event.repository.name != 'astraios' }}
needs: tests
runs-on: ubuntu-latest
defaults:
Expand Down
2 changes: 1 addition & 1 deletion .yamllint
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright Jiaqi Liu
# Copyright Paion Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<code_scheme name="Jersey-WS-Template-Project">
<code_scheme name="Astraios-Project">
<option name="GENERATE_FINAL_LOCALS" value="true" />
<option name="GENERATE_FINAL_PARAMETERS" value="true" />
<option name="USE_EXTERNAL_ANNOTATIONS" value="true" />
Expand All @@ -9,7 +9,7 @@
<emptyLine />
<package name="" withSubpackages="true" static="true" />
<emptyLine />
<package name="com.qubitpi" withSubpackages="true" static="false" />
<package name="com.paion-data" withSubpackages="true" static="false" />
<emptyLine />
<package name="com" withSubpackages="true" static="false" />
<emptyLine />
Expand Down Expand Up @@ -38,7 +38,7 @@
<emptyLine />
<package name="" withSubpackages="true" static="true" />
<emptyLine />
<package name="com.qubitpi" withSubpackages="true" static="false" />
<package name="com.paion-data" withSubpackages="true" static="false" />
<emptyLine />
<package name="com" withSubpackages="true" static="false" />
<emptyLine />
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright Jiaqi Liu
# Copyright Paion Data
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,4 +20,4 @@ ARG WS_VERSION=1.0-SNAPSHOT

ENV JETTY_WEBAPPS_DIR /var/lib/jetty/webapps

COPY ./target/jersey-ws-template-$WS_VERSION.war $JETTY_WEBAPPS_DIR/ROOT.war
COPY ./target/astraios-$WS_VERSION.war $JETTY_WEBAPPS_DIR/ROOT.war
66 changes: 30 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
Jersey Webservice Template <sup>![Java Version Badge][Java Version Badge]</sup>
Astraios <sup>![Java Version Badge][Java Version Badge]</sup>
===============================================================================

[![GitHub Workflow Status][GitHub Workflow Status]](https://github.com/QubitPi/jersey-ws-template/actions/workflows/ci-cd.yml)
![Last Commit](https://img.shields.io/github/last-commit/QubitPi/jersey-ws-template/master?logo=github&style=for-the-badge)
[![GitHub Workflow Status][GitHub Workflow Status]](https://github.com/paion-data/astraios/actions/workflows/ci-cd.yml)
![Last Commit](https://img.shields.io/github/last-commit/paion-data/astraios/master?logo=github&style=for-the-badge)
[![Apache License Badge]](https://www.apache.org/licenses/LICENSE-2.0)
![GitHub Actions Badge][GitHub Actions Badge]
![HashiCorp Packer Badge][HashiCorp Packer Badge]
![HashiCorp Terraform Badge][HashiCorp Terraform Badge]

<a href="https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template">
<a href="https://sonarcloud.io/summary/new_code?id=paion-data_astraios">
<img
align="left"
width="17%"
alt="SonarCloud Quality Gate"
src="https://sonarcloud.io/api/project_badges/quality_gate?project=QubitPi_jersey-ws-template"
src="https://sonarcloud.io/api/project_badges/quality_gate?project=paion-data_astraios"
>
</a>

[![Bugs][Sonar Bugs]](https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template)
[![Vulnerabilities][Sonar Vulnerabilities]](https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template)
[![Security Rating][Sonar Security Rating]](https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template)
[![Bugs][Sonar Bugs]](https://sonarcloud.io/summary/new_code?id=paion-data_astraios)
[![Vulnerabilities][Sonar Vulnerabilities]](https://sonarcloud.io/summary/new_code?id=paion-data_astraios)
[![Security Rating][Sonar Security Rating]](https://sonarcloud.io/summary/new_code?id=paion-data_astraios)

[![Coverage][Sonar Coverage]](https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template)
[![Code Smells][Sonar Code Smells]](https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template)
[![Maintainability Rating][Sonar Maintainability Rating]](https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template)
[![Coverage][Sonar Coverage]](https://sonarcloud.io/summary/new_code?id=paion-data_astraios)
[![Code Smells][Sonar Code Smells]](https://sonarcloud.io/summary/new_code?id=paion-data_astraios)
[![Maintainability Rating][Sonar Maintainability Rating]](https://sonarcloud.io/summary/new_code?id=paion-data_astraios)

[![Lines of Code][Sonar Lines of Code]](https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template)
[![Duplicated Lines (%)][Sonar Duplicated Lines (%)]](https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template)
[![Reliability Rating][Sonar Reliability Rating]](https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template)
[![Technical Debt][Sonar Technical Debt]](https://sonarcloud.io/summary/new_code?id=QubitPi_jersey-ws-template)
[![Lines of Code][Sonar Lines of Code]](https://sonarcloud.io/summary/new_code?id=paion-data_astraios)
[![Duplicated Lines (%)][Sonar Duplicated Lines (%)]](https://sonarcloud.io/summary/new_code?id=paion-data_astraios)
[![Reliability Rating][Sonar Reliability Rating]](https://sonarcloud.io/summary/new_code?id=paion-data_astraios)
[![Technical Debt][Sonar Technical Debt]](https://sonarcloud.io/summary/new_code?id=paion-data_astraios)

Documentation
-------------
Expand All @@ -39,38 +39,32 @@ Documentation
License
-------

The use and distribution terms for [jersey-ws-template][jersey-ws-template] are covered by the
The use and distribution terms for [astraios][astraios] are covered by the
[Apache License, Version 2.0][Apache License, Version 2.0].

<div align="center">
<a href="https://opensource.org/licenses">
<img align="center" width="50%" alt="License Illustration" src="https://github.com/QubitPi/QubitPi/blob/master/img/apache-2.png?raw=true">
</a>
</div>

[Apache License Badge]: https://img.shields.io/badge/Apache%202.0-F25910.svg?style=for-the-badge&logo=Apache&logoColor=white
[Apache License, Version 2.0]: http://www.apache.org/licenses/LICENSE-2.0.html

[Documentation]: https://qubitpi.github.io/jersey-ws-template/
[Documentation]: https://paion-data.github.io/astraios/

[How to set up GitHub Action Secrets]: https://docs.github.com/en/actions/security-guides/encrypted-secrets

[GitHub Actions Badge]: https://img.shields.io/badge/GitHub%20Actions-2088FF?style=for-the-badge&logo=githubactions&logoColor=white
[GitHub Workflow Status]: https://img.shields.io/github/actions/workflow/status/QubitPi/jersey-ws-template/ci-cd.yml?branch=master&logo=github&style=for-the-badge
[GitHub Workflow Status]: https://img.shields.io/github/actions/workflow/status/paion-data/astraios/ci-cd.yml?branch=master&logo=github&style=for-the-badge

[HashiCorp Packer Badge]: https://img.shields.io/badge/Packer-02A8EF?style=for-the-badge&logo=Packer&logoColor=white
[HashiCorp Terraform Badge]: https://img.shields.io/badge/Terraform-7B42BC?style=for-the-badge&logo=terraform&logoColor=white

[Java Version Badge]: https://img.shields.io/badge/Java-11-brightgreen?style=for-the-badge&logo=OpenJDK&logoColor=white
[Javadoc]: https://qubitpi.github.io/jersey-ws-template/apidocs/

[Sonar Bugs]: https://sonarcloud.io/api/project_badges/measure?project=QubitPi_jersey-ws-template&metric=bugs
[Sonar Vulnerabilities]: https://sonarcloud.io/api/project_badges/measure?project=QubitPi_jersey-ws-template&metric=vulnerabilities
[Sonar Security Rating]: https://sonarcloud.io/api/project_badges/measure?project=QubitPi_jersey-ws-template&metric=security_rating
[Sonar Coverage]: https://sonarcloud.io/api/project_badges/measure?project=QubitPi_jersey-ws-template&metric=coverage
[Sonar Code Smells]: https://sonarcloud.io/api/project_badges/measure?project=QubitPi_jersey-ws-template&metric=code_smells
[Sonar Maintainability Rating]: https://sonarcloud.io/api/project_badges/measure?project=QubitPi_jersey-ws-template&metric=sqale_rating
[Sonar Lines of Code]: https://sonarcloud.io/api/project_badges/measure?project=QubitPi_jersey-ws-template&metric=ncloc
[Sonar Duplicated Lines (%)]: https://sonarcloud.io/api/project_badges/measure?project=QubitPi_jersey-ws-template&metric=duplicated_lines_density
[Sonar Reliability Rating]: https://sonarcloud.io/api/project_badges/measure?project=QubitPi_jersey-ws-template&metric=reliability_rating
[Sonar Technical Debt]: https://sonarcloud.io/api/project_badges/measure?project=QubitPi_jersey-ws-template&metric=sqale_index
[Javadoc]: https://paion-data.github.io/astraios/apidocs/

[Sonar Bugs]: https://sonarcloud.io/api/project_badges/measure?project=paion-data_astraios&metric=bugs
[Sonar Vulnerabilities]: https://sonarcloud.io/api/project_badges/measure?project=paion-data_astraios&metric=vulnerabilities
[Sonar Security Rating]: https://sonarcloud.io/api/project_badges/measure?project=paion-data_astraios&metric=security_rating
[Sonar Coverage]: https://sonarcloud.io/api/project_badges/measure?project=paion-data_astraios&metric=coverage
[Sonar Code Smells]: https://sonarcloud.io/api/project_badges/measure?project=paion-data_astraios&metric=code_smells
[Sonar Maintainability Rating]: https://sonarcloud.io/api/project_badges/measure?project=paion-data_astraios&metric=sqale_rating
[Sonar Lines of Code]: https://sonarcloud.io/api/project_badges/measure?project=paion-data_astraios&metric=ncloc
[Sonar Duplicated Lines (%)]: https://sonarcloud.io/api/project_badges/measure?project=paion-data_astraios&metric=duplicated_lines_density
[Sonar Reliability Rating]: https://sonarcloud.io/api/project_badges/measure?project=paion-data_astraios&metric=reliability_rating
[Sonar Technical Debt]: https://sonarcloud.io/api/project_badges/measure?project=paion-data_astraios&metric=sqale_index
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
</module>
<!-- Headers -->
<module name="Header">
<property name="header" value="/*\n * Copyright Jiaqi Liu"/>
<property name="header" value="/*\n * Copyright Paion Data"/>
<property name="fileExtensions" value="java,groovy,g4" />
<property name="severity" value="error"/>
</module>
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Jersey Webservice Template Documentation
Astraios Documentation
========================================

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/authors.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jiaqi:
name: Jack
title: Maintainer of Jersey Webservice Template
title: Maintainer of Astraios
url: https://github.com/QubitPi
image_url: https://avatars.githubusercontent.com/u/16126939?v=4
18 changes: 6 additions & 12 deletions docs/docs/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,22 @@ title: CI/CD

The following [GitHub Secrets][How to set up GitHub Action Secrets] needs to be defined

- [**SONAR_TOKEN**](https://sonarcloud.io/project/overview?id=QubitPi_jersey-ws-template)
- **SSL_CERTIFICATE** SSL certificate file content (for [exposing webservice endpoints over HTTPS][Nginx SSL Config])
- **SSL_CERTIFICATE_KEY** SSL certificate key file content (for
[exposing webservice endpoints over HTTPS][Nginx SSL Config])
- [**SONAR_TOKEN**](https://sonarcloud.io/project/overview?id=paion-data_astraios)
- [**AWS_ACCESS_KEY_ID**](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)
- [**AWS_SECRET_ACCESS_KEY**](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)
- [**AWS_REGION**](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)
- **ZONE_ID** AWS Route 53 hosted zone ID (DNS routing)
- **DOCKERHUB_USERNAME** The [Dockerfile][jersey-ws-template Dockerfile], in [CI/CD][jersey-ws-template CI/CD], got
- **DOCKERHUB_USERNAME** The [Dockerfile][astraios Dockerfile], in [CI/CD][astraios CI/CD], got
pushed to a [personal DockerHub][docker hub] account. The _DOCKERHUB_USERNAME_ if it needs to go to a different
account, should be set accordingly
- [**DOCKERHUB_TOKEN**](https://docs.docker.com/docker-hub/access-tokens/) for pushing the
[aforementioned image][jersey-ws-template Dockerfile]
[aforementioned image][astraios Dockerfile]
<!-- markdown-link-check-disable -->

- [**SENTRY_DSN**](sentry)

<!-- markdown-link-check-enable -->

[docker hub]: https://hub.docker.com/r/jack20191124/jersey-ws-template/
[docker hub]: https://hub.docker.com/r/jack20191124/astraios/

[jersey-ws-template CI/CD]: https://github.com/QubitPi/jersey-ws-template/blob/master/.github/workflows/ci-cd.yml
[jersey-ws-template Dockerfile]: https://github.com/QubitPi/jersey-ws-template/blob/master/Dockerfile

[Nginx SSL Config]: https://github.com/QubitPi/jersey-ws-template/blob/master/hashicorp/images/nginx-ssl.conf
[astraios CI/CD]: https://github.com/paion-data/astraios/blob/master/.github/workflows/ci-cd.yml
[astraios Dockerfile]: https://github.com/paion-data/astraios/blob/master/Dockerfile
28 changes: 14 additions & 14 deletions docs/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ Packaging
mvn clean package
```

A [**WAR** file](https://en.wikipedia.org/wiki/WAR_(file_format)) named `jersey-ws-template-1.0-SNAPSHOT.war` will
beJersey Webservice Template generated under _target_ directory for [running in Jetty](#running-in-standalone-jetty)
A [**WAR** file](https://en.wikipedia.org/wiki/WAR_(file_format)) named `astraios-1.0-SNAPSHOT.war` will
be generated under _target_ directory for [running in Jetty](#running-in-standalone-jetty)

Running Webservice in Docker (Development)
------------------------------------------

:::caution

Support [running this template webservice in Docker][jersey-ws-template Dockerfile] is NOT for production deployment.
Support [running this template webservice in Docker][astraios Dockerfile] is NOT for production deployment.
It's intended usage is for **development** where developer can easily stand up a webservice instance for dev and
testing purpose.

Production deployment for [jersey-ws-template][jersey-ws-template] assumes
Production deployment for [astraios][astraios] assumes
[Jetty-based scheme](#running-webservice-in-standalone-jetty-production)

:::
Expand All @@ -41,17 +41,17 @@ Production deployment for [jersey-ws-template][jersey-ws-template] assumes
We can pull the image from [its docker hub][docker hub]:

```bash
docker pull jack20191124/jersey-ws-template
docker pull jack20191124/astraios
```

#### GitHub

We could also build the image from [source][jersey-ws-template Dockerfile]:
We could also build the image from [source][astraios Dockerfile]:

```bash
https://github.com/QubitPi/jersey-ws-template.git
cd jersey-ws-template
docker build -t qubitpi/jersey-ws-template
https://github.com/paion-data/astraios.git
cd astraios
docker build -t paiondata/astraios
```

:::tip
Expand All @@ -62,7 +62,7 @@ If we need to pass one or more runtime environment variables into docker image,
export MY_ENV_VARIABLE=foo
export MY_OTHER_ENV_VARIABLE=bar

docker build -t qubitpi/jersey-ws-template \
docker build -t paiondata/astraios \
--build-arg MY_ENV_VARIABLE=$MY_ENV_VARIABLE \
--build-arg MY_OTHER_ENV_VARIABLE=$MY_OTHER_ENV_VARIABLE \
.
Expand All @@ -85,7 +85,7 @@ ENV MY_OTHER_ENV_VARIABLE $MY_OTHER_ENV_VARIABLE
When image is on our machine (either by pulling or building), we can spin up an instance using

```bash
docker run -d --name=jersey-ws-template -p 8080:8080 qubitpi/jersey-ws-template
docker run -d --name=astraios -p 8080:8080 paiondata/astraios
```

At this moment, the healthcheck endpoint `GET localhost:8080/v1/data/healthcheck` should return 200 status code
Expand Down Expand Up @@ -142,7 +142,7 @@ java -jar $JETTY_HOME/start.jar

The webservice will run on port **8080**

[docker hub]: https://hub.docker.com/r/jack20191124/jersey-ws-template/
[docker hub]: https://hub.docker.com/r/jack20191124/astraios/

[jersey-ws-template]: https://github.com/QubitPi/jersey-ws-template
[jersey-ws-template Dockerfile]: https://github.com/QubitPi/jersey-ws-template/blob/master/Dockerfile
[astraios]: https://github.com/paion-data/astraios
[astraios Dockerfile]: https://github.com/paion-data/astraios/blob/master/Dockerfile
4 changes: 2 additions & 2 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
sidebar_position: 1
title: Jersey Webservice Template Documentation
title: Astraios Documentation
---

Welcome to Jersey Webservice Template's documentation hub! We're still building out documentation on many aspects of
Welcome to Astraios's documentation hub! We're still building out documentation on many aspects of
JWT, but here one'll find what documentation we do have.
29 changes: 2 additions & 27 deletions docs/docs/sentry.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,9 @@
---
sidebar_position: 5
title: Setting Up Sentry.io
title: Sentry-based Monitorning
---

Sentry is a developer-first error tracking and performance monitoring platform that helps developers see what actually
matters, solve quicker, and learn continuously about their applications.

<p align="center">
<img src="https://github.com/getsentry/sentry/raw/master/.github/screenshots/projects.png" width="270" />
<img src="https://github.com/getsentry/sentry/raw/master/.github/screenshots/issue-details.png" width="270" />
<img src="https://github.com/getsentry/sentry/raw/master/.github/screenshots/transaction-summary.png" width="270" />
<img src="https://github.com/getsentry/sentry/raw/master/.github/screenshots/releases.png" width="270" />
</p>

:::note

The logging framework has to be <b>Logback</b>, which is the logging library used in
[jersey-ws-template][jersey-ws-template]

![Error loading setup-sentry-1.png](./img/setup-sentry-1.png)
![Error loading setup-sentry-2.png](./img/setup-sentry-2.png)
![Error loading setup-sentry-3.png](./img/setup-sentry-3.png)

:::

### Hiding [Sentry DSN](https://docs.sentry.io/platforms/java/guides/logback/#dsn-configuration)
Hiding [Sentry DSN](https://docs.sentry.io/platforms/java/guides/logback/#dsn-configuration)

It is recommended to simply define **SENTRY_DSN** environment variable via CI/CD so that Sentry SDK can pick it up
automatically

[jersey-ws-template]: https://github.com/QubitPi/jersey-ws-template

[Sentry DSN]: https://docs.sentry.io/platforms/java/guides/logback/#dsn-configuration
Loading
Loading