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