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

Feature/env error controls #5216

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e292f4b
add docker build for apifant editor
Mar 30, 2023
cc3d809
feat: Do spectral validation calls
Mar 30, 2023
6e27df7
add docker build for apifant editor
Mar 30, 2023
3835457
trigger only when main branch has changed
Mar 30, 2023
830f7a5
linting fixes
Mar 30, 2023
9b425bc
npm build before docker build
Mar 30, 2023
af85f97
add apifant branch
Mar 30, 2023
93acff4
Allow using a local spectral server by setting the SPECTRAL_HOST
Mar 30, 2023
bdda5e6
working docker build
Mar 30, 2023
31de7f3
yet another try
Mar 30, 2023
b54378c
fix docker image
Mar 30, 2023
cfea52d
Merge pull request #1 from HUK-COBURG/feature/integrate-valigator
Harry93 Mar 30, 2023
94ff9c4
Merge pull request #2 from HUK-COBURG/apifant
Harry93 Mar 30, 2023
cfc1187
clean up trigger branches
Mar 30, 2023
b0dba29
rename branch from main to master
Mar 30, 2023
808f1ce
routing to valigator via proxy_pass
Mar 31, 2023
d15bfe8
fix line offset & severity errors
Mar 31, 2023
99a71a4
nginx
Mar 31, 2023
7e5b74a
add VALIGATOR_SCHEME option
Mar 31, 2023
6bc47d8
set ruleset to v10
Apr 4, 2023
ac31e43
First draft: Dropdown for spectral rules
Apr 4, 2023
893e1af
v10 as default
Apr 4, 2023
f54a4f1
Merge remote-tracking branch 'origin/master' into feature/add-dropdow…
Apr 4, 2023
b95c534
removed wrapactions
Apr 4, 2023
6324d30
fix: upgrade react-redux from 7.2.8 to 7.2.9
snyk-bot Apr 7, 2023
87ece14
Merge pull request #4 from HUK-COBURG/snyk-upgrade-377ad767651395ee60…
cniweb Apr 13, 2023
4c42f18
Merge pull request #3 from HUK-COBURG/feature/add-dropdown-for-spectr…
beji Apr 18, 2023
d8a5f8a
fix: upgrade swagger-client from 3.19.2 to 3.19.3
snyk-bot Apr 19, 2023
40734db
fix(spectral): Fix validation crashing the UI
Apr 25, 2023
2d0d448
Merge pull request #8 from HUK-COBURG/bugfix/reading-toUpperCase-unde…
beji Apr 25, 2023
a98fc54
feat(spectral): Cancel in-flight fetch calls (#9)
beji May 5, 2023
e2430c3
Merge pull request #5 from HUK-COBURG/snyk-upgrade-359c55002f2d5d5dc5…
cniweb Jun 16, 2023
4750c4c
Link to the internal payload validation tool
Oct 19, 2023
895a717
Add Controls for Environment and Display only Errors
Aug 23, 2024
58491a5
revert stuff
Aug 23, 2024
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
4 changes: 1 addition & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/.git
/.github
/dev-helpers
/docs
/src
/swagger-editor-dist-package
/test
/node_modules
/node_modules
38 changes: 38 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docker Image
run-name: ${{ github.actor }} builds a new image for apifant swagger editor

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
EDITOR_IMAGE: ghcr.io/huk-coburg/apifant-editor

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Generate Docker Image Tag
run: echo "EDITOR_TAG=$(date +%Y%m%d-%H%M%S)" >> $GITHUB_ENV

- name: Build the Docker Image
run: docker build --file Dockerfile --tag ${EDITOR_IMAGE}:${EDITOR_TAG} .

- name: Tag the Docker Image
run: docker tag ${EDITOR_IMAGE}:${EDITOR_TAG} ${EDITOR_IMAGE}:latest

- name: Docker Login
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username "${{ github.actor }}" --password-stdin

- name: Push CI Tag
run: docker push ${EDITOR_IMAGE}:${EDITOR_TAG}

- name: Push Latest Tag
run: docker push ${EDITOR_IMAGE}:latest
33 changes: 25 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
FROM nginx:1.23.3-alpine
FROM node:16.16-alpine as build

LABEL maintainer="fehguy"
RUN apk add git

WORKDIR /apifant-editor

COPY package.json .
COPY package-lock.json .

RUN npm ci --force

COPY . .

RUN npm run build

FROM nginxinc/nginx-unprivileged:alpine

LABEL maintainer="[email protected]"

ENV BASE_URL="/" \
PORT="8080"

COPY nginx.conf /etc/nginx/templates/default.conf.template
COPY --from=build --chown=101:101 /apifant-editor/nginx.conf /etc/nginx/templates/default.conf.template

COPY ./index.html /usr/share/nginx/html/
COPY ./dist/oauth2-redirect.html /usr/share/nginx/html/
COPY ./dist/* /usr/share/nginx/html/dist/
COPY ./docker-run.sh /docker-entrypoint.d/91-docker-run.sh
COPY --from=build --chown=101:101 /apifant-editor/index.html /usr/share/nginx/html/
COPY --from=build --chown=101:101 /apifant-editor/dist/oauth2-redirect.html /usr/share/nginx/html/
COPY --from=build --chown=101:101 /apifant-editor/dist/* /usr/share/nginx/html/dist/
COPY --from=build --chown=101:101 /apifant-editor/docker-run.sh /docker-entrypoint.d/91-docker-run.sh

USER root
RUN chmod +x /docker-entrypoint.d/91-docker-run.sh
USER nginx

EXPOSE 8080
EXPOSE $PORT
15 changes: 13 additions & 2 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@

gzip_vary on;
gzip_types text/plain text/css application/javascript;

add_header X-Frame-Options deny;
server_tokens off; # Hide Nginx version

upstream apifant_valigator {
server $VALIGATOR_HOST:$VALIGATOR_PORT;
}

server {
listen $PORT;
server_name localhost;
server_name 0.0.0.0;

location ~* /(valigator/.*) {
proxy_pass $VALIGATOR_SCHEME://apifant_valigator/$1$is_args$args;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location $BASE_URL {
absolute_redirect off;
Expand Down
Loading