Skip to content

Commit 4a9e03a

Browse files
committed
🐎 ci: Dockerfile update
1 parent 3985646 commit 4a9e03a

File tree

8 files changed

+110
-77
lines changed

8 files changed

+110
-77
lines changed

.docker/Dockerfile

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
FROM nginx:stable-alpine
2-
LABEL com.werbot.commit _GIT_COMMIT_
3-
LABEL com.werbot.version _VERSION_
2+
LABEL org.opencontainers.image.created _DATE_
3+
LABEL org.opencontainers.image.url https://github.com/werbot/werbot.web
44
LABEL org.opencontainers.image.source https://github.com/werbot/werbot.web
5+
LABEL org.opencontainers.image.title werbot.web
6+
LABEL org.opencontainers.image.revision _GIT_COMMIT_
7+
LABEL org.opencontainers.image.version _VERSION_
58
LABEL org.opencontainers.image.description 🖥 Werbot Web Applications
9+
LABEL org.opencontainers.image.vendor Werbot, Inc.
10+
LABEL org.opencontainers.image.documentation https://github.com/werbot/werbot.web
11+
LABEL org.opencontainers.image.authors [email protected]
612
LABEL org.opencontainers.image.licenses Apache-2.0 license
713
COPY ./dist /usr/share/nginx/html
814
COPY ./.docker/nginx.conf /etc/nginx/conf.d/default.conf
15+
COPY ./.docker/entrypoint.sh /docker-entrypoint.d/90-entrypoint.sh
16+
RUN chmod +x /docker-entrypoint.d/90-entrypoint.sh
917
EXPOSE 80
1018
CMD ["nginx", "-g", "daemon off;"]

.docker/entrypoint.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [[ "${API_DSN}" ]]; then
5+
sed -i 's_https://api.werbot.net_'"${API_DSN}"'_g' /usr/share/nginx/html/assets/index-*.js
6+
fi

.docker/nginx.conf

+7-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
add_header X-XSS-Protection "1; mode=block";
88
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload";
99
add_header X-Content-Type-Options "nosniff";
10-
add_header Access-Control-Allow-Origin "*";
10+
add_header Access-Control-Allow-Origin *;
1111

1212
real_ip_header proxy_protocol;
1313
set_real_ip_from 10.0.0.0/8;
@@ -16,14 +16,17 @@ server {
1616

1717
sendfile off;
1818

19-
root /usr/share/nginx/html;
20-
index index.html index.htm;
19+
# To allow POST on static pages
20+
error_page 405 =200 $uri;
2121

2222
location / {
23+
root /usr/share/nginx/html;
24+
index index.html index.htm;
25+
2326
try_files $uri $uri/ /index.html;
2427
}
2528

26-
error_page 500 502 503 504 /50x.html;
29+
error_page 500 502 503 504 /50x.html;
2730
location = /50x.html {
2831
root /usr/share/nginx/html;
2932
}

.github/workflows/release.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ name: releaser
33
on:
44
push:
55
branches:
6-
- 'master'
6+
- "master"
77
tags:
8-
- 'v[0-9]+.[0-9]+.[0-9]+'
8+
- "v[0-9]+.[0-9]+.[0-9]+"
99

1010
permissions:
11-
contents: write # needed to write releases
12-
packages: write # needed for ghcr access
11+
contents: write # needed to write releases
12+
packages: write # needed for ghcr access
1313

1414
jobs:
15-
goreleaser:
15+
releaser:
1616
runs-on: ubuntu-latest
17+
environment: production
1718
steps:
1819
- uses: docker/login-action@v2
1920
with:
@@ -24,12 +25,15 @@ jobs:
2425
with:
2526
fetch-depth: 0
2627
- run: git fetch --force --tags
28+
- uses: mikefarah/yq@master
2729
- uses: actions/setup-node@v3
2830
with:
2931
node-version: 18
30-
cache: 'yarn'
32+
cache: "yarn"
3133
- run: yarn install
3234
- run: make build
35+
env:
36+
VITE_API_URL: ${{ vars.VITE_API_URL }}
3337
- run: make package
3438
- run: make push
3539
- uses: softprops/action-gh-release@v1

Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SHELL:= /bin/bash
2-
ROOT_PATH:=$(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))
2+
ROOT_PATH:=$(shell git rev-parse --show-toplevel)
33

44
DATE=$(shell date '+%Y-%m-%d-%H:%M:%S')
55
GIT_COMMIT=$(shell cd "${ROOT_PATH}" && git rev-parse --short HEAD)
@@ -50,6 +50,8 @@ version: ## Building new version to git
5050
.PHONY: build
5151
build: ## Building project
5252
$(msg) "$(GREEN)Building project$(RESET)"
53+
@yq -i -p=json -o=json '.commit = "${GIT_COMMIT}"' ${ROOT_PATH}/package.json
54+
@yq -i -p=json -o=json '.version = "${VERSION}"' ${ROOT_PATH}/package.json
5355
@yarn vite build --mode production
5456
#############################################################################
5557

@@ -59,8 +61,9 @@ build: ## Building project
5961
package: ## Building a docker container
6062
$(msg) "$(GREEN)Building a docker container$(RESET)"
6163
@cat ${ROOT_PATH}/.docker/Dockerfile > ${ROOT_PATH}/Dockerfile
64+
@sed -i -E "s/_DATE_/${DATE}/g" ${ROOT_PATH}/Dockerfile
6265
@sed -i -E "s/_GIT_COMMIT_/${GIT_COMMIT}/g" ${ROOT_PATH}/Dockerfile
63-
@sed -i -E "s/_VERSION_/v${VERSION}/g" ${ROOT_PATH}/Dockerfile
66+
@sed -i -E "s/_VERSION_/${VERSION}/g" ${ROOT_PATH}/Dockerfile
6467
docker build -f ${ROOT_PATH}/Dockerfile -t ghcr.io/werbot/werbot.web:latest .
6568
docker tag ghcr.io/werbot/werbot.web:latest ghcr.io/werbot/werbot.web:v${VERSION}
6669
rm -rf ${ROOT_PATH}/dist

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
"click-outside-vue3": "^4.0.1",
2323
"cssnano": "^6.0.1",
2424
"ip-address": "^8.1.0",
25-
"ipaddr.js": "^2.0.1",
25+
"ipaddr.js": "^2.1.0",
2626
"less": "^4.1.3",
27-
"less-loader": "^11.1.0",
27+
"less-loader": "^11.1.2",
2828
"notiwind": "^2.0.1",
2929
"nprogress": "^0.2.0",
3030
"pinia": "^2.1.3",
31-
"postcss": "^8.4.23",
31+
"postcss": "^8.4.24",
3232
"postcss-import": "^15.1.0",
3333
"prettier": "^2.8.8",
3434
"prettier-plugin-tailwindcss": "^0.3.0",
@@ -42,10 +42,10 @@
4242
"vite-plugin-svg-icons": "^2.0.1",
4343
"vite-plugin-vue-layouts": "^0.8.0",
4444
"vue": "^3.3.4",
45-
"vue-router": "^4.2.1",
45+
"vue-router": "^4.2.2",
4646
"vue-tsc": "^1.6.5"
4747
},
4848
"dependencies": {
49-
"@bufbuild/buf": "^1.19.0-1"
49+
"@bufbuild/buf": "^1.20.0-1"
5050
}
5151
}

src/store/modules/system.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const useSystemStore = defineStore("system", {
4141
async getVersion() {
4242
this.versions.ui = `${pkg.version} (${pkg.commit})`; // set the UI version based on the values in 'package.json'
4343
const res = await getVersion(); // call the 'getVersion()' function to get the API version
44-
this.versions.api = res.data.result; // set the API version based on the response from the API
44+
this.versions.api = res.data.result.api; // set the API version based on the response from the API
4545
},
4646
},
4747
});

yarn.lock

+66-57
Original file line numberDiff line numberDiff line change
@@ -208,47 +208,47 @@
208208
"@babel/helper-validator-identifier" "^7.19.1"
209209
to-fast-properties "^2.0.0"
210210

211-
"@bufbuild/buf-darwin-arm64@1.19.0-1":
212-
version "1.19.0-1"
213-
resolved "https://registry.yarnpkg.com/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.19.0-1.tgz#8258dbf24a7a53c44b6c808a6e38c4cf7c22f72b"
214-
integrity sha512-HsWPii21wm3QSyuxrNq9+Yf8iAgpnC4rNCy4x3d6P1fd/LmgE1NPzQW0ghEZvl9dgAQKkL/4S5bKhlm7kbUdmQ==
215-
216-
"@bufbuild/buf-darwin-x64@1.19.0-1":
217-
version "1.19.0-1"
218-
resolved "https://registry.yarnpkg.com/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.19.0-1.tgz#4854048167399a148f6628af848b78a6ac97f7cc"
219-
integrity sha512-2+Ig7ylYpVh4kms/OeJJVY+X0KX4awPA6hYr7L7aZOIcHwZEM8lWtSTO/se5pQc7dc8FXNiC4YUqHC8yfxxX6Q==
220-
221-
"@bufbuild/buf-linux-aarch64@1.19.0-1":
222-
version "1.19.0-1"
223-
resolved "https://registry.yarnpkg.com/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.19.0-1.tgz#dd1ee13c666fbc65526efe2dbdd0ab67ce99ae02"
224-
integrity sha512-g/Vxg3WiBr3nhsxsRr2Q81xXJD+0ktHIO3ZJggTG2Sbbl3dh8kyg1iKM6MjJiMP7su5RKCylLigzoEJzVTShyA==
225-
226-
"@bufbuild/buf-linux-x64@1.19.0-1":
227-
version "1.19.0-1"
228-
resolved "https://registry.yarnpkg.com/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.19.0-1.tgz#ba2c02c8e4b0ebf00597d8c915cf5f26e5800f54"
229-
integrity sha512-anYuGx8k/2kp8GPX3eHNUf3IY/01Zpnyw0HaLPXK1Btqyy6XkapVywrDqg7YUzMd1ySFEp1wD9UqRNdEFNCQ4A==
230-
231-
"@bufbuild/buf-win32-arm64@1.19.0-1":
232-
version "1.19.0-1"
233-
resolved "https://registry.yarnpkg.com/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.19.0-1.tgz#55e8bff16028e8c66107f6875555366e819eed73"
234-
integrity sha512-xXgF1qYnCfRKbGx1FqvPbpZ6ajh4ddxpXhSxI3VCeb3MsMBuIbiLqX4fQAL3ls/Zwz8tVIITuSwOhYmSEGcpBA==
235-
236-
"@bufbuild/buf-win32-x64@1.19.0-1":
237-
version "1.19.0-1"
238-
resolved "https://registry.yarnpkg.com/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.19.0-1.tgz#e0fbb691ee48c98b0c82ef9fb0c94e77b55365de"
239-
integrity sha512-futmqgpMQCR1lcAzZJEGjPr7ECw1gYTPIV8crm5SY+iCJ7sOeStOBNt7q5hV4LKmmeWmvm03XIMZPjhQzjH5NQ==
240-
241-
"@bufbuild/buf@^1.19.0-1":
242-
version "1.19.0-1"
243-
resolved "https://registry.yarnpkg.com/@bufbuild/buf/-/buf-1.19.0-1.tgz#60aeb1df5e38b7253f9cccc375956a170cebce1a"
244-
integrity sha512-TIsLTTQUntr/Xq/IMSULv3dlC3/ZsVwQtWgxmJ++IzSuOW79TFQfq59vFeTWrPa6+QXFMz5t6jkMyD4ghzO5nw==
211+
"@bufbuild/buf-darwin-arm64@1.20.0-1":
212+
version "1.20.0-1"
213+
resolved "https://registry.yarnpkg.com/@bufbuild/buf-darwin-arm64/-/buf-darwin-arm64-1.20.0-1.tgz#cd2d6c04c9a199208bb1437cc48024ada8b782fa"
214+
integrity sha512-zLX9BPSfg4ny3tyFBesQrraMHXCnLT9rG+p8ijLa+uihipfhxAiXmNChrVF6Pi6qYpAOffc582zB7PVHGRG7yA==
215+
216+
"@bufbuild/buf-darwin-x64@1.20.0-1":
217+
version "1.20.0-1"
218+
resolved "https://registry.yarnpkg.com/@bufbuild/buf-darwin-x64/-/buf-darwin-x64-1.20.0-1.tgz#714eff911feee19b58504757652c31680b873008"
219+
integrity sha512-mMulq+3hhNYDYPhz/oZLgxcDUGoixnVIjlvyVeU84WmzvV/p5MxgRWRnalEd8IHt+newjeM0h4QZh5cbewjWjg==
220+
221+
"@bufbuild/buf-linux-aarch64@1.20.0-1":
222+
version "1.20.0-1"
223+
resolved "https://registry.yarnpkg.com/@bufbuild/buf-linux-aarch64/-/buf-linux-aarch64-1.20.0-1.tgz#f5c166b7bb6d7bc67664370c21ae987e9ff8ef38"
224+
integrity sha512-S2DR3x2gxT4vItP0pWeG3TdBqLdELtL3uZQrUVq9kHm1jbeuRiUn8RomGOVvWzMRQIkcInqH26i0QAg+dki77g==
225+
226+
"@bufbuild/buf-linux-x64@1.20.0-1":
227+
version "1.20.0-1"
228+
resolved "https://registry.yarnpkg.com/@bufbuild/buf-linux-x64/-/buf-linux-x64-1.20.0-1.tgz#32412d69ab53e7621730127fab630e40deb214a7"
229+
integrity sha512-q9ThJ02hNRdPzufOFB8KZxerER08JGPE0NDO+4IRAM3v8kA/AetToPtnZ3JvZ4vUHQhJ7n3cfFtNpOapHNhFqw==
230+
231+
"@bufbuild/buf-win32-arm64@1.20.0-1":
232+
version "1.20.0-1"
233+
resolved "https://registry.yarnpkg.com/@bufbuild/buf-win32-arm64/-/buf-win32-arm64-1.20.0-1.tgz#4c6aa268099efbd102848f3fe5c612ef6aa2b53b"
234+
integrity sha512-Syk5NLbmy/fW0sqGetykfjJamTVZ16hTCXVHASQRp9sOMZrAai2uNDzQDzTmIGgheFbQN0aZh7MdCQYvGGSAlA==
235+
236+
"@bufbuild/buf-win32-x64@1.20.0-1":
237+
version "1.20.0-1"
238+
resolved "https://registry.yarnpkg.com/@bufbuild/buf-win32-x64/-/buf-win32-x64-1.20.0-1.tgz#04137c87823ebc5e1f18a9c762d13ac401ca91c1"
239+
integrity sha512-NyMjh9EVchxWRPphEXEdF2U+a7DrDaTwn6e2g0JY/1+d8PK8fkEZgUQs8zyRIXpldjFQDsjzXj+ScblwH28ZhQ==
240+
241+
"@bufbuild/buf@^1.20.0-1":
242+
version "1.20.0-1"
243+
resolved "https://registry.yarnpkg.com/@bufbuild/buf/-/buf-1.20.0-1.tgz#aba916663fc0f9c89c72bf2490bcb90687b4d283"
244+
integrity sha512-968pFRseb+YjdI+6tt6GxOir7+366ZVIS0uZAEkcbhMP7MK/qBI6KIgbldnMwRmhFKmVQ+H3mPK49tKMjylGhg==
245245
optionalDependencies:
246-
"@bufbuild/buf-darwin-arm64" "1.19.0-1"
247-
"@bufbuild/buf-darwin-x64" "1.19.0-1"
248-
"@bufbuild/buf-linux-aarch64" "1.19.0-1"
249-
"@bufbuild/buf-linux-x64" "1.19.0-1"
250-
"@bufbuild/buf-win32-arm64" "1.19.0-1"
251-
"@bufbuild/buf-win32-x64" "1.19.0-1"
246+
"@bufbuild/buf-darwin-arm64" "1.20.0-1"
247+
"@bufbuild/buf-darwin-x64" "1.20.0-1"
248+
"@bufbuild/buf-linux-aarch64" "1.20.0-1"
249+
"@bufbuild/buf-linux-x64" "1.20.0-1"
250+
"@bufbuild/buf-win32-arm64" "1.20.0-1"
251+
"@bufbuild/buf-win32-x64" "1.20.0-1"
252252

253253
"@esbuild/[email protected]":
254254
version "0.17.12"
@@ -2690,10 +2690,10 @@ ip-address@^8.1.0:
26902690
jsbn "1.1.0"
26912691
sprintf-js "1.1.2"
26922692

2693-
ipaddr.js@^2.0.1:
2694-
version "2.0.1"
2695-
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.0.1.tgz#eca256a7a877e917aeb368b0a7497ddf42ef81c0"
2696-
integrity sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==
2693+
ipaddr.js@^2.1.0:
2694+
version "2.1.0"
2695+
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.1.0.tgz#2119bc447ff8c257753b196fc5f1ce08a4cdf39f"
2696+
integrity sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==
26972697

26982698
is-accessor-descriptor@^0.1.6:
26992699
version "0.1.6"
@@ -3127,10 +3127,10 @@ kind-of@^6.0.0, kind-of@^6.0.2:
31273127
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
31283128
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
31293129

3130-
klona@^2.0.4:
3131-
version "2.0.5"
3132-
resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.5.tgz#d166574d90076395d9963aa7a928fabb8d76afbc"
3133-
integrity sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==
3130+
klona@^2.0.6:
3131+
version "2.0.6"
3132+
resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.6.tgz#85bffbf819c03b2f53270412420a4555ef882e22"
3133+
integrity sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==
31343134

31353135
koa-compose@^4.1.0:
31363136
version "4.1.0"
@@ -3199,12 +3199,12 @@ launch-editor@^2.2.1:
31993199
picocolors "^1.0.0"
32003200
shell-quote "^1.7.3"
32013201

3202-
less-loader@^11.1.0:
3203-
version "11.1.0"
3204-
resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-11.1.0.tgz#a452384259bdf8e4f6d5fdcc39543609e6313f82"
3205-
integrity sha512-C+uDBV7kS7W5fJlUjq5mPBeBVhYpTIm5gB09APT9o3n/ILeaXVsiSFTbZpTJCJwQ/Crczfn3DmfQFwxYusWFug==
3202+
less-loader@^11.1.2:
3203+
version "11.1.2"
3204+
resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-11.1.2.tgz#ff1ea68ce60347a0a1ec67f998ac1e56b204f6da"
3205+
integrity sha512-2bSaN2j13bUh/5BuwJKuY2DDWVmfBsS6oWRe8v1mGj7F0EpcL+WyWkDQVoEfsVRE4ac5/OuP44ZCaVsXWrQQ9A==
32063206
dependencies:
3207-
klona "^2.0.4"
3207+
klona "^2.0.6"
32083208

32093209
less@^4.1.3:
32103210
version "4.1.3"
@@ -4156,6 +4156,15 @@ postcss@^8.4.23:
41564156
picocolors "^1.0.0"
41574157
source-map-js "^1.0.2"
41584158

4159+
postcss@^8.4.24:
4160+
version "8.4.24"
4161+
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.24.tgz#f714dba9b2284be3cc07dbd2fc57ee4dc972d2df"
4162+
integrity sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==
4163+
dependencies:
4164+
nanoid "^3.3.6"
4165+
picocolors "^1.0.0"
4166+
source-map-js "^1.0.2"
4167+
41594168
posthtml-parser@^0.2.0, posthtml-parser@^0.2.1:
41604169
version "0.2.1"
41614170
resolved "https://registry.yarnpkg.com/posthtml-parser/-/posthtml-parser-0.2.1.tgz#35d530de386740c2ba24ff2eb2faf39ccdf271dd"
@@ -5145,10 +5154,10 @@ vue-demi@>=0.14.5:
51455154
resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.14.5.tgz#676d0463d1a1266d5ab5cba932e043d8f5f2fbd9"
51465155
integrity sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==
51475156

5148-
vue-router@^4.2.1:
5149-
version "4.2.1"
5150-
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.2.1.tgz#f8ab85c89e74682cad71519480fdf2b855e8c9e0"
5151-
integrity sha512-nW28EeifEp8Abc5AfmAShy5ZKGsGzjcnZ3L1yc2DYUo+MqbBClrRP9yda3dIekM4I50/KnEwo1wkBLf7kHH5Cw==
5157+
vue-router@^4.2.2:
5158+
version "4.2.2"
5159+
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.2.2.tgz#b0097b66d89ca81c0986be03da244c7b32a4fd81"
5160+
integrity sha512-cChBPPmAflgBGmy3tBsjeoe3f3VOSG6naKyY5pjtrqLGbNEXdzCigFUHgBvp9e3ysAtFtEx7OLqcSDh/1Cq2TQ==
51525161
dependencies:
51535162
"@vue/devtools-api" "^6.5.0"
51545163

0 commit comments

Comments
 (0)