Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 8b8e95f

Browse files
authored
Merge pull request #5 from oxygenpay/develop
merge develop into main
2 parents e0604d0 + a3bb6da commit 8b8e95f

File tree

269 files changed

+45523
-610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+45523
-610
lines changed

.dockerignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
.idea
2-
.vscode
2+
.vscode
3+
ui-dashboard/node_modules
4+
ui-payment/node_modules
5+
tmp
6+
bin
7+
docker-compose.local.yml

.github/static/cover.svg

Lines changed: 40 additions & 0 deletions
Loading

.github/static/demo.jpg

493 KB
Loading

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Lint and Test
2+
on: [ pull_request, workflow_dispatch, create ]
3+
4+
jobs:
5+
lint-go:
6+
name: Lint Golang
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
11+
- uses: actions/setup-go@v4
12+
with:
13+
go-version: '1.20'
14+
cache: false
15+
16+
- name: golangci-lint
17+
uses: golangci/golangci-lint-action@v3
18+
with:
19+
version: v1.53.3
20+
args: --config=.golangci.yml
21+
22+
lint-ui-payment:
23+
name: Lint Payment UI
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
28+
- name: Install dependencies
29+
run: npm ci --ignore-scripts
30+
working-directory: ui-payment
31+
32+
- name: ESLint
33+
run: npx eslint src --ext .js,.jsx,.ts,.tsx
34+
working-directory: ui-payment
35+
36+
- name: TS Verify
37+
run: npx tsc --noEmit --skipLibCheck -p ./tsconfig.json
38+
working-directory: ui-payment
39+
40+
lint-ui-dashboard:
41+
name: Lint Dashboard UI
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v3
45+
46+
- name: Install dependencies
47+
run: npm ci --ignore-scripts
48+
working-directory: ui-dashboard
49+
50+
- name: ESLint
51+
run: npx eslint src --ext .js,.jsx,.ts,.tsx
52+
working-directory: ui-dashboard
53+
54+
- name: TS Verify
55+
run: npx tsc --noEmit --skipLibCheck -p ./tsconfig.json
56+
working-directory: ui-dashboard

.github/workflows/release.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Build Oxygen
2+
on:
3+
release:
4+
types: [ created ]
5+
6+
env:
7+
REGISTRY: ghcr.io
8+
9+
jobs:
10+
build-ui-payment:
11+
name: Build Payment UI
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Install dependencies
17+
run: npm ci --ignore-scripts
18+
working-directory: ui-payment
19+
20+
- name: Build
21+
run: npx tsc && npx vite build --base=${{ env.VITE_ROOTPATH }}
22+
working-directory: ui-payment
23+
env:
24+
VITE_BACKEND_HOST: '//'
25+
VITE_SUPPORT_EMAIL: 'help@site.com'
26+
VITE_ROOTPATH: '/p/'
27+
VITE_SHOW_BRANDING: 'true'
28+
29+
- name: Publish dist
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: ui-payment-artifact
33+
path: ui-payment/dist/
34+
35+
build-ui-dashboard:
36+
name: Build Dashboard UI
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v3
40+
41+
- name: Install dependencies
42+
run: npm ci
43+
working-directory: ui-dashboard
44+
45+
- name: Build
46+
run: npx tsc && npx vite build --base=${{ env.VITE_ROOTPATH }}
47+
working-directory: ui-dashboard
48+
env:
49+
VITE_BACKEND_HOST: '//'
50+
VITE_ROOTPATH: '/dashboard/'
51+
52+
- name: Publish dist
53+
uses: actions/upload-artifact@v3
54+
with:
55+
name: ui-dashboard-artifact
56+
path: ui-dashboard/dist/
57+
58+
build-docker-image:
59+
name: Build Docker Image
60+
needs: [ build-ui-payment, build-ui-dashboard ]
61+
runs-on: ubuntu-latest
62+
# allow job to upload container images to ghcr
63+
permissions: write-all
64+
steps:
65+
- name: Checkout repository
66+
uses: actions/checkout@v3
67+
68+
- name: Set up Docker Buildx
69+
uses: docker/setup-buildx-action@v1
70+
71+
- name: Copy UI Payment UI artifact
72+
uses: actions/download-artifact@v3
73+
with:
74+
name: ui-payment-artifact
75+
path: ui-payment/dist/
76+
77+
- name: Copy Dashboard UI artifact
78+
uses: actions/download-artifact@v3
79+
with:
80+
name: ui-dashboard-artifact
81+
path: ui-dashboard/dist/
82+
83+
- name: Login to GitHub container registry
84+
uses: docker/login-action@v2
85+
with:
86+
registry: ${{ env.REGISTRY }}
87+
username: ${{ github.actor }}
88+
password: ${{ secrets.GITHUB_TOKEN }}
89+
90+
- name: Build and push image
91+
run: |
92+
# refs/tags/*
93+
TAG=${GITHUB_REF:10}
94+
echo "TAG=$TAG"
95+
96+
docker build -t $REGISTRY/$IMAGE:$TAG -t $REGISTRY/$IMAGE:latest .
97+
docker push $REGISTRY/$IMAGE:$TAG
98+
docker push $REGISTRY/$IMAGE:latest
99+
env:
100+
IMAGE: ${{ github.repository }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
.idea
22
.vscode
3+
!.vscode/extensions.json
34
bin/
45
config/*.yml
6+
!config/*example.yml
57
web/redoc/**/*.json
6-
docker.env
8+
docker.env
9+
.actrc

.golangci.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
run:
2-
go: '1.18'
2+
go: '1.20'
3+
timeout: 5m
34
skip-dirs:
45
- ./api/proto
56
- ./bin
67
- ./configs
78
- pkg/api-*
89
- ./tmp
910
- ./scripts
11+
- ui-dashboard
12+
- ui-payment
1013

1114
linters-settings:
1215
govet:
@@ -57,7 +60,6 @@ linters:
5760
disable-all: true
5861
enable:
5962
- bodyclose
60-
- depguard
6163
- dogsled
6264
- errcheck
6365
- funlen
@@ -83,7 +85,4 @@ linters:
8385
- unused
8486
- whitespace
8587
- prealloc
86-
- nonamedreturns
87-
88-
service:
89-
golangci-lint-version: 1.45.x # use the fixed version to not introduce new linters unexpectedly
88+
- nonamedreturns

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM golang:1.19 as builder
2+
3+
WORKDIR /src
4+
5+
COPY go.mod /src/
6+
COPY go.sum /src/
7+
8+
COPY . /src
9+
10+
RUN make build
11+
12+
ENTRYPOINT []
13+
14+
# Prepare production-ready image
15+
FROM alpine:3.17
16+
17+
RUN apk add --no-cache tzdata libc6-compat
18+
ENV TZ=UTC
19+
20+
COPY --from=builder /src/bin/oxygen /opt/
21+
22+
ENTRYPOINT ["/opt/oxygen"]

0 commit comments

Comments
 (0)