Compare commits
No commits in common. "main" and "v1.0.2" have entirely different histories.
|
@ -1,9 +1,9 @@
|
||||||
FROM --platform=$BUILDPLATFORM node:23.4-alpine AS install
|
FROM --platform=$BUILDPLATFORM node:23-alpine AS install
|
||||||
RUN mkdir -p /temp/prod
|
RUN mkdir -p /temp/prod
|
||||||
COPY package*.json /temp/prod/
|
COPY package*.json /temp/prod/
|
||||||
RUN cd /temp/prod && npm install --frozen-lockfile
|
RUN cd /temp/prod && npm install --frozen-lockfile
|
||||||
COPY . /temp/prod/
|
COPY . /temp/prod/
|
||||||
RUN cd /temp/prod && npm run build
|
RUN cd /temp/prod && npm run build
|
||||||
|
|
||||||
FROM nginx:1.27.3-alpine3.20-slim AS release
|
FROM nginx AS release
|
||||||
COPY --from=install /temp/prod/dist /usr/share/nginx/html
|
COPY --from=install /temp/prod/dist /usr/share/nginx/html
|
||||||
|
|
12
compose.yaml
12
compose.yaml
|
@ -1,7 +1,7 @@
|
||||||
services:
|
services:
|
||||||
mongodb:
|
mongodb:
|
||||||
image: mongo:bionic
|
image: mongo:bionic
|
||||||
container_name: mongodb-fe
|
container_name: mongodb
|
||||||
ports:
|
ports:
|
||||||
- "27017:27017"
|
- "27017:27017"
|
||||||
environment:
|
environment:
|
||||||
|
@ -14,9 +14,9 @@ services:
|
||||||
|
|
||||||
bot-api:
|
bot-api:
|
||||||
image: git.fai.st/fedi-image-bot/bot-api:latest
|
image: git.fai.st/fedi-image-bot/bot-api:latest
|
||||||
container_name: bot-api-fe
|
container_name: bot-api
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- "8080:8080"
|
||||||
depends_on:
|
depends_on:
|
||||||
- mongodb
|
- mongodb
|
||||||
environment:
|
environment:
|
||||||
|
@ -28,9 +28,9 @@ services:
|
||||||
|
|
||||||
fe-middleware:
|
fe-middleware:
|
||||||
image: git.fai.st/fedi-image-bot/fe-middleware:latest
|
image: git.fai.st/fedi-image-bot/fe-middleware:latest
|
||||||
container_name: fe-middleware-fe
|
container_name: fe-middleware
|
||||||
ports:
|
ports:
|
||||||
- 8081:8081
|
- "8081:8081"
|
||||||
depends_on:
|
depends_on:
|
||||||
- bot-api
|
- bot-api
|
||||||
environment:
|
environment:
|
||||||
|
@ -43,7 +43,7 @@ services:
|
||||||
build: .
|
build: .
|
||||||
container_name: bot-image-moderation-fe
|
container_name: bot-image-moderation-fe
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- "80:80"
|
||||||
develop:
|
develop:
|
||||||
watch:
|
watch:
|
||||||
- action: rebuild
|
- action: rebuild
|
||||||
|
|
|
@ -8,12 +8,14 @@
|
||||||
"name": "bot-image-moderation-fe",
|
"name": "bot-image-moderation-fe",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react-dom": "^19.0.0",
|
"react": "^18.2.0",
|
||||||
|
"react-dom": "^18.2.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"vite": "^6.0.0"
|
"vite": "^6.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react-dom": "^19.0.0",
|
"@types/react": "^18.2.43",
|
||||||
|
"@types/react-dom": "^18.2.17",
|
||||||
"@vitejs/plugin-react-swc": "^3.5.0"
|
"@vitejs/plugin-react-swc": "^3.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -146,25 +148,26 @@
|
||||||
"undici-types": "~5.26.4"
|
"undici-types": "~5.26.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/prop-types": {
|
||||||
|
"version": "15.7.13",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@types/react": {
|
"node_modules/@types/react": {
|
||||||
"version": "19.0.1",
|
"version": "18.3.12",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.1.tgz",
|
|
||||||
"integrity": "sha512-YW6614BDhqbpR5KtUYzTA+zlA7nayzJRA9ljz9CQoxthR0sDisYZLuvSMsil36t4EH/uAt8T52Xb4sVw17G+SQ==",
|
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@types/prop-types": "*",
|
||||||
"csstype": "^3.0.2"
|
"csstype": "^3.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/react-dom": {
|
"node_modules/@types/react-dom": {
|
||||||
"version": "19.0.2",
|
"version": "18.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.0.2.tgz",
|
|
||||||
"integrity": "sha512-c1s+7TKFaDRRxr1TxccIX2u7sfCnc3RxkVyBIUA2lCpyqCF+QoAwQ/CBg7bsMdVwP120HEH143VQezKtef5nCg==",
|
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"dependencies": {
|
||||||
"@types/react": "^19.0.0"
|
"@types/react": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vitejs/plugin-react-swc": {
|
"node_modules/@vitejs/plugin-react-swc": {
|
||||||
|
@ -181,8 +184,7 @@
|
||||||
"node_modules/csstype": {
|
"node_modules/csstype": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.3",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"peer": true
|
|
||||||
},
|
},
|
||||||
"node_modules/esbuild": {
|
"node_modules/esbuild": {
|
||||||
"version": "0.24.0",
|
"version": "0.24.0",
|
||||||
|
@ -221,6 +223,20 @@
|
||||||
"@esbuild/win32-x64": "0.24.0"
|
"@esbuild/win32-x64": "0.24.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/js-tokens": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/loose-envify": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"js-tokens": "^3.0.0 || ^4.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"loose-envify": "cli.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/nanoid": {
|
"node_modules/nanoid": {
|
||||||
"version": "3.3.8",
|
"version": "3.3.8",
|
||||||
"funding": [
|
"funding": [
|
||||||
|
@ -268,25 +284,24 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react": {
|
"node_modules/react": {
|
||||||
"version": "19.0.0",
|
"version": "18.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz",
|
|
||||||
"integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
"dependencies": {
|
||||||
|
"loose-envify": "^1.1.0"
|
||||||
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-dom": {
|
"node_modules/react-dom": {
|
||||||
"version": "19.0.0",
|
"version": "18.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.0.0.tgz",
|
|
||||||
"integrity": "sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"scheduler": "^0.25.0"
|
"loose-envify": "^1.1.0",
|
||||||
|
"scheduler": "^0.23.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^19.0.0"
|
"react": "^18.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/rollup": {
|
"node_modules/rollup": {
|
||||||
|
@ -325,10 +340,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/scheduler": {
|
"node_modules/scheduler": {
|
||||||
"version": "0.25.0",
|
"version": "0.23.2",
|
||||||
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.25.0.tgz",
|
"license": "MIT",
|
||||||
"integrity": "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==",
|
"dependencies": {
|
||||||
"license": "MIT"
|
"loose-envify": "^1.1.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/source-map-js": {
|
"node_modules/source-map-js": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
|
@ -355,9 +371,9 @@
|
||||||
"peer": true
|
"peer": true
|
||||||
},
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "6.0.3",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-6.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/vite/-/vite-6.0.2.tgz",
|
||||||
"integrity": "sha512-Cmuo5P0ENTN6HxLSo6IHsjCLn/81Vgrp81oaiFFMRa8gGDj5xEjIcEpf2ZymZtZR8oU0P2JX5WuUp/rlXcHkAw==",
|
"integrity": "sha512-XdQ+VsY2tJpBsKGs0wf3U/+azx8BBpYRHFAyKm5VeEZNOJZRB63q7Sc8Iup3k0TrN3KO6QgyzFf+opSbfY1y0g==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.24.0",
|
"esbuild": "^0.24.0",
|
||||||
|
|
|
@ -8,12 +8,14 @@
|
||||||
"build": "tsc && vite build"
|
"build": "tsc && vite build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react-dom": "^19.0.0",
|
"react": "^18.2.0",
|
||||||
|
"react-dom": "^18.2.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"vite": "^6.0.0"
|
"vite": "^6.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react-dom": "^19.0.0",
|
"@types/react": "^18.2.43",
|
||||||
|
"@types/react-dom": "^18.2.17",
|
||||||
"@vitejs/plugin-react-swc": "^3.5.0"
|
"@vitejs/plugin-react-swc": "^3.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
18
src/App.tsx
18
src/App.tsx
|
@ -11,14 +11,20 @@ function App() {
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
return (
|
return (
|
||||||
<ImageModerator
|
<>
|
||||||
token={token}
|
<ImageModerator
|
||||||
apiUrl={apiUrl}
|
token={token}
|
||||||
middlewareUrl={middlewareUrl}
|
apiUrl={apiUrl}
|
||||||
/>
|
middlewareUrl={middlewareUrl}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return <Login setRemote={setRemote} />;
|
return (
|
||||||
|
<>
|
||||||
|
<Login setRemote={setRemote} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,6 @@ export default function ImageModerator({
|
||||||
const url = data.url;
|
const url = data.url;
|
||||||
const tags = data.tags;
|
const tags = data.tags;
|
||||||
setImageData({ url, tags });
|
setImageData({ url, tags });
|
||||||
setImageAlt(url);
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setImageAlt("Error");
|
setImageAlt("Error");
|
||||||
|
|
Loading…
Reference in New Issue