Compare commits
10 Commits
open-api
...
c942450e86
| Author | SHA1 | Date | |
|---|---|---|---|
| c942450e86 | |||
| 00759473f2 | |||
| d9acd72d7b | |||
| 2639a5301a | |||
| 460b7aee72 | |||
| 3c393a1e0b | |||
| 0189b0db15 | |||
| 78b8c60329 | |||
| 48bbc03a91 | |||
| d493800226 |
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.gitignore
|
||||||
|
openapitools.json
|
||||||
|
README.md
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
.gitea
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
name: Create and Push Release
|
name: Create and Push Release
|
||||||
|
run-name: Create and Push Release
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@@ -13,6 +14,9 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get version
|
- name: Get version
|
||||||
id: get-version
|
id: get-version
|
||||||
run: |
|
run: |
|
||||||
@@ -26,14 +30,16 @@ jobs:
|
|||||||
username: ${{ secrets.CI_SERVICE_ACCOUNT }}
|
username: ${{ secrets.CI_SERVICE_ACCOUNT }}
|
||||||
password: ${{ secrets.CI_SERVICE_ACCOUNT_PASSWORD }}
|
password: ${{ secrets.CI_SERVICE_ACCOUNT_PASSWORD }}
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Build & Push Image
|
- name: Build & Push Image
|
||||||
env:
|
env:
|
||||||
TAG: ${{ steps.get-version.outputs.version }}
|
TAG: ${{ steps.get-version.outputs.version }}
|
||||||
QUARKUS_CONTAINER_IMAGE_USERNAME: ${{ secrets.CI_SERVICE_ACCOUNT }}
|
QUARKUS_CONTAINER_IMAGE_USERNAME: ${{ secrets.CI_SERVICE_ACCOUNT }}
|
||||||
QUARKUS_CONTAINER_IMAGE_PASSWORD: ${{ secrets.CI_SERVICE_ACCOUNT_PASSWORD }}
|
QUARKUS_CONTAINER_IMAGE_PASSWORD: ${{ secrets.CI_SERVICE_ACCOUNT_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
docker build -t $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_IMAGE:$TAG .
|
docker build -f docker/Dockerfile \
|
||||||
docker push $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_IMAGE:$TAG
|
-t $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_NAME:$TAG \
|
||||||
|
-t $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_NAME:latest \
|
||||||
|
.
|
||||||
|
|
||||||
|
docker push $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_NAME:$TAG
|
||||||
|
docker push $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_NAME:latest
|
||||||
29
Dockerfile
29
Dockerfile
@@ -1,29 +0,0 @@
|
|||||||
# Stage 1: Build application
|
|
||||||
FROM node:22-bookworm-slim AS builder
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm ci --omit=dev
|
|
||||||
COPY . .
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Stage 2: Prepare static web server
|
|
||||||
FROM alpine:3.19 AS server-prep
|
|
||||||
RUN wget -O /tmp/sws.tar.gz \
|
|
||||||
https://github.com/static-web-server/static-web-server/releases/download/v2.17.0/static-web-server-v2.17.0-x86_64-unknown-linux-musl.tar.gz
|
|
||||||
RUN tar -xzf /tmp/sws.tar.gz -C /tmp \
|
|
||||||
--strip-components=1
|
|
||||||
|
|
||||||
# Stage 3: Create runtime image
|
|
||||||
FROM gcr.io/distroless/static-debian12:nonroot
|
|
||||||
|
|
||||||
COPY --from=builder --chown=nonroot:nonroot /app/dist /app
|
|
||||||
|
|
||||||
COPY --from=server-prep --chown=nonroot:nonroot /tmp/static-web-server /usr/local/bin/
|
|
||||||
|
|
||||||
USER nonroot
|
|
||||||
WORKDIR /app
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/static-web-server"]
|
|
||||||
CMD ["--port", "8080", "--root", "/app", "--log-level", "warn"]
|
|
||||||
36
docker/Dockerfile
Normal file
36
docker/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# Stage 1: Build application
|
||||||
|
FROM node:22-bookworm-slim AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Stage 2: Create runtime image
|
||||||
|
FROM nginxinc/nginx-unprivileged:1.25-alpine
|
||||||
|
|
||||||
|
# Create writable directories
|
||||||
|
USER root
|
||||||
|
RUN mkdir -p /runtime-config && \
|
||||||
|
chown nginx:nginx /runtime-config && \
|
||||||
|
chown -R nginx:nginx /var/cache/nginx && \
|
||||||
|
chown -R nginx:nginx /var/run
|
||||||
|
USER nginx
|
||||||
|
|
||||||
|
# Copy built assets
|
||||||
|
COPY --from=builder --chown=nginx:nginx /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
|
# Copy our custom nginx config
|
||||||
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
# Copy entrypoint script
|
||||||
|
COPY docker/entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
# Make entrypoint executable
|
||||||
|
USER root
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
USER nginx
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
13
docker/entrypoint.sh
Normal file
13
docker/entrypoint.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Create runtime config file in writable location
|
||||||
|
cat > /runtime-config/config.js <<EOF
|
||||||
|
window.__APP_CONFIG__ = {
|
||||||
|
API_BASE_URL: "${API_BASE_URL}",
|
||||||
|
OTHER_VAR: "${OTHER_VAR}"
|
||||||
|
};
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Start Nginx
|
||||||
|
exec nginx -g "daemon off;"
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
<script src="/config.js"></script>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|||||||
51
nginx.conf
Normal file
51
nginx.conf
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# Main nginx configuration
|
||||||
|
worker_processes auto;
|
||||||
|
error_log /dev/stderr warn;
|
||||||
|
pid /tmp/nginx.pid; # Use writable location for PID
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
access_log /dev/stdout;
|
||||||
|
client_body_temp_path /tmp/client_temp;
|
||||||
|
proxy_temp_path /tmp/proxy_temp;
|
||||||
|
fastcgi_temp_path /tmp/fastcgi_temp;
|
||||||
|
uwsgi_temp_path /tmp/uwsgi_temp;
|
||||||
|
scgi_temp_path /tmp/scgi_temp;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 8080;
|
||||||
|
server_name localhost;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
# Handle client-side routing
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Serve config.js from the writable location
|
||||||
|
location = /config.js {
|
||||||
|
alias /runtime-config/config.js;
|
||||||
|
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Cache static assets
|
||||||
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||||
|
expires 1y;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Security headers
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -1,15 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "dex-ui-vue",
|
"name": "dex-ui-vue",
|
||||||
"version": "0.0.0",
|
"version": "0.0.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "dex-ui-vue",
|
"name": "dex-ui-vue",
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@primeuix/themes": "^1.2.1",
|
"@primeuix/themes": "^1.2.1",
|
||||||
"@tailwindcss/vite": "^4.1.11",
|
"@tailwindcss/vite": "^4.1.11",
|
||||||
|
"@types/node": "^24.0.14",
|
||||||
"@vueuse/core": "^13.5.0",
|
"@vueuse/core": "^13.5.0",
|
||||||
"axios": "^1.10.0",
|
"axios": "^1.10.0",
|
||||||
"oidc-client-ts": "^3.3.0",
|
"oidc-client-ts": "^3.3.0",
|
||||||
@@ -23,7 +24,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openapitools/openapi-generator-cli": "^2.20.2",
|
"@openapitools/openapi-generator-cli": "^2.20.2",
|
||||||
"@types/node": "^24.0.14",
|
|
||||||
"@vitejs/plugin-vue": "^6.0.0",
|
"@vitejs/plugin-vue": "^6.0.0",
|
||||||
"@vue/tsconfig": "^0.7.0",
|
"@vue/tsconfig": "^0.7.0",
|
||||||
"typescript": "~5.7.2",
|
"typescript": "~5.7.2",
|
||||||
@@ -1386,7 +1386,6 @@
|
|||||||
"version": "24.0.14",
|
"version": "24.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.14.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.14.tgz",
|
||||||
"integrity": "sha512-4zXMWD91vBLGRtHK3YbIoFMia+1nqEz72coM42C5ETjnNCa/heoj7NT1G67iAfOqMmcfhuCZ4uNpyz8EjlAejw==",
|
"integrity": "sha512-4zXMWD91vBLGRtHK3YbIoFMia+1nqEz72coM42C5ETjnNCa/heoj7NT1G67iAfOqMmcfhuCZ4uNpyz8EjlAejw==",
|
||||||
"devOptional": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~7.8.0"
|
"undici-types": "~7.8.0"
|
||||||
@@ -4546,7 +4545,6 @@
|
|||||||
"version": "7.8.0",
|
"version": "7.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||||
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
|
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
|
||||||
"devOptional": true,
|
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/universalify": {
|
"node_modules/universalify": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "dex-ui-vue",
|
"name": "dex-ui-vue",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@primeuix/themes": "^1.2.1",
|
"@primeuix/themes": "^1.2.1",
|
||||||
"@tailwindcss/vite": "^4.1.11",
|
"@tailwindcss/vite": "^4.1.11",
|
||||||
|
"@types/node": "^24.0.14",
|
||||||
"@vueuse/core": "^13.5.0",
|
"@vueuse/core": "^13.5.0",
|
||||||
"axios": "^1.10.0",
|
"axios": "^1.10.0",
|
||||||
"oidc-client-ts": "^3.3.0",
|
"oidc-client-ts": "^3.3.0",
|
||||||
@@ -25,7 +26,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openapitools/openapi-generator-cli": "^2.20.2",
|
"@openapitools/openapi-generator-cli": "^2.20.2",
|
||||||
"@types/node": "^24.0.14",
|
|
||||||
"@vitejs/plugin-vue": "^6.0.0",
|
"@vitejs/plugin-vue": "^6.0.0",
|
||||||
"@vue/tsconfig": "^0.7.0",
|
"@vue/tsconfig": "^0.7.0",
|
||||||
"typescript": "~5.7.2",
|
"typescript": "~5.7.2",
|
||||||
|
|||||||
3
public/config.template.js
Normal file
3
public/config.template.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
window.__RUNTIME_CONFIG__ = {
|
||||||
|
API_URL: "__API_URL__"
|
||||||
|
};
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {userManager} from "../stores/auth.ts";
|
import {userManager} from "../stores/auth.ts";
|
||||||
|
|
||||||
const axiosInstance = axios.create({
|
const axiosInstance = axios.create()
|
||||||
baseURL: import.meta.env.VITE_API_URL || 'http://localhost:8080'
|
|
||||||
})
|
|
||||||
|
|
||||||
axiosInstance.interceptors.request.use(async (config) => {
|
axiosInstance.interceptors.request.use(async (config) => {
|
||||||
const user = await userManager.getUser()
|
const user = await userManager.getUser()
|
||||||
|
|||||||
17
src/main.ts
17
src/main.ts
@@ -10,7 +10,8 @@ import {
|
|||||||
AccordionContent,
|
AccordionContent,
|
||||||
AccordionHeader,
|
AccordionHeader,
|
||||||
AccordionPanel,
|
AccordionPanel,
|
||||||
DatePicker, Fluid,
|
DatePicker,
|
||||||
|
Fluid,
|
||||||
ToastService
|
ToastService
|
||||||
} from "primevue";
|
} from "primevue";
|
||||||
import {createPinia} from "pinia";
|
import {createPinia} from "pinia";
|
||||||
@@ -26,6 +27,10 @@ import axiosInstance from "./api";
|
|||||||
import SetsView from "./views/set/SetsView.vue";
|
import SetsView from "./views/set/SetsView.vue";
|
||||||
import JobsView from "./views/JobsView.vue";
|
import JobsView from "./views/JobsView.vue";
|
||||||
import {definePreset} from "@primeuix/themes";
|
import {definePreset} from "@primeuix/themes";
|
||||||
|
import {initConfig} from "@/util/config.ts";
|
||||||
|
|
||||||
|
// Initialize configuration from window object
|
||||||
|
initConfig((window as any).__APP_CONFIG__ || {})
|
||||||
|
|
||||||
export const DeckServiceKey = Symbol("deckServiceKey")
|
export const DeckServiceKey = Symbol("deckServiceKey")
|
||||||
export const CardServiceKey = Symbol("cardServiceKey")
|
export const CardServiceKey = Symbol("cardServiceKey")
|
||||||
@@ -134,11 +139,11 @@ router.beforeEach(async (to) => {
|
|||||||
app.use(router);
|
app.use(router);
|
||||||
app.use(ToastService)
|
app.use(ToastService)
|
||||||
|
|
||||||
const deckService: DeckService = new DeckService(undefined, "http://localhost:8080", axiosInstance)
|
const deckService: DeckService = new DeckService(undefined, "/api", axiosInstance)
|
||||||
const cardService: CardService = new CardService(undefined, "http://localhost:8080", axiosInstance)
|
const cardService: CardService = new CardService(undefined, "/api", axiosInstance)
|
||||||
const setService: SetService = new SetService(undefined, "http://localhost:8080", axiosInstance)
|
const setService: SetService = new SetService(undefined, "/api", axiosInstance)
|
||||||
const cardPrintService: CardPrintService = new CardPrintService(undefined, "http://localhost:8080", axiosInstance)
|
const cardPrintService: CardPrintService = new CardPrintService(undefined, "/api", axiosInstance)
|
||||||
const jobService: JobService = new JobService(undefined, "http://localhost:8080", axiosInstance)
|
const jobService: JobService = new JobService(undefined, "/api", axiosInstance)
|
||||||
|
|
||||||
app.provide(DeckServiceKey, deckService)
|
app.provide(DeckServiceKey, deckService)
|
||||||
app.provide(CardServiceKey, cardService)
|
app.provide(CardServiceKey, cardService)
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
import darkAttribute from "/src/assets/DARK.svg"
|
|
||||||
import divineAttribute from "/src/assets/DIVINE.svg"
|
|
||||||
import earthAttribute from "/src/assets/EARTH.svg"
|
|
||||||
import fireAttribute from "/src/assets/FIRE.svg"
|
|
||||||
import laughAttribute from "/src/assets/LAUGH.svg"
|
|
||||||
import lightAttribute from "/src/assets/LIGHT.svg"
|
|
||||||
import waterAttribute from "/src/assets/WATER.svg"
|
|
||||||
import windAttribute from "/src/assets/WIND.svg"
|
|
||||||
|
|
||||||
export {
|
|
||||||
darkAttribute,
|
|
||||||
divineAttribute,
|
|
||||||
earthAttribute,
|
|
||||||
fireAttribute,
|
|
||||||
laughAttribute,
|
|
||||||
lightAttribute,
|
|
||||||
waterAttribute,
|
|
||||||
windAttribute
|
|
||||||
}
|
|
||||||
20
src/util/config.ts
Normal file
20
src/util/config.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
export interface AppConfig {
|
||||||
|
API_BASE_URL: string;
|
||||||
|
OTHER_VAR: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
let runtimeConfig: AppConfig = {
|
||||||
|
API_BASE_URL: import.meta.env.VITE_API_BASE_URL || '',
|
||||||
|
OTHER_VAR: import.meta.env.VITE_OTHER_VAR || ''
|
||||||
|
};
|
||||||
|
|
||||||
|
export function initConfig(config: Partial<AppConfig>) {
|
||||||
|
runtimeConfig = {
|
||||||
|
...runtimeConfig,
|
||||||
|
...config
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getConfig(): AppConfig {
|
||||||
|
return runtimeConfig;
|
||||||
|
}
|
||||||
@@ -24,6 +24,16 @@ export default defineConfig({
|
|||||||
'@': path.resolve(__dirname, './src'),
|
'@': path.resolve(__dirname, './src'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://localhost:8080',
|
||||||
|
changeOrigin: true,
|
||||||
|
secure: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
build: {
|
build: {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
assetsInclude: [
|
assetsInclude: [
|
||||||
|
|||||||
Reference in New Issue
Block a user