fix: minio and main links

This commit is contained in:
Ivan Rezchikov
2026-07-12 16:47:49 +03:00
parent eaaf552ae6
commit 039cb4d2d3
4 changed files with 52 additions and 55 deletions
+16 -4
View File
@@ -24,21 +24,27 @@ export default async function Home() {
</h2> </h2>
</div> </div>
</Link> </Link>
<Link href="/page/government">
<div className="flex items-end h-28 p-2.5 rounded-lg bg-muted"> <div className="flex items-end h-28 p-2.5 rounded-lg bg-muted">
<h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer"> <h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer">
Acknowledge with the Federal Government Learn more about the Federal Government
</h2> </h2>
</div> </div>
</Link>
<Link href="/page/regions">
<div className="flex items-end h-28 p-2.5 rounded-lg bg-muted"> <div className="flex items-end h-28 p-2.5 rounded-lg bg-muted">
<h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer"> <h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer">
Regions of the Federation Regions of the Federation
</h2> </h2>
</div> </div>
</Link>
<Link href="/page/foreign-missions">
<div className="flex items-end h-28 p-2.5 rounded-lg bg-muted"> <div className="flex items-end h-28 p-2.5 rounded-lg bg-muted">
<h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer"> <h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer">
Receive consular services abroad Foreign missions of Europe
</h2> </h2>
</div> </div>
</Link>
</div> </div>
<div className="hidden md:grid grid-cols-[2fr_1fr_1fr_1fr] gap-8"> <div className="hidden md:grid grid-cols-[2fr_1fr_1fr_1fr] gap-8">
<Link href="/page/citizenship"> <Link href="/page/citizenship">
@@ -56,23 +62,29 @@ export default async function Home() {
</h2> </h2>
</div> </div>
</Link> </Link>
<Link href="/page/government">
<div className="flex items-end h-28 p-2.5 rounded-lg bg-muted"> <div className="flex items-end h-28 p-2.5 rounded-lg bg-muted">
<h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer"> <h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer">
Acknowledge with the Federal Government Learn more about the Federal Government
</h2> </h2>
</div> </div>
</Link>
</div> </div>
<div className="grid grid-rows-2 gap-8"> <div className="grid grid-rows-2 gap-8">
<Link href="/page/regions">
<div className="flex items-end h-28 p-2.5 rounded-lg bg-muted"> <div className="flex items-end h-28 p-2.5 rounded-lg bg-muted">
<h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer"> <h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer">
Regions of the Federation Regions of the Federation
</h2> </h2>
</div> </div>
</Link>
<Link href="/page/foreign-missions">
<div className="flex items-end h-28 p-2.5 rounded-lg bg-muted"> <div className="flex items-end h-28 p-2.5 rounded-lg bg-muted">
<h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer"> <h2 className="flex flex-row items-center gap-2 hover:gap-4 hover:duration-200 cursor-pointer">
Receive consular services abroad Foreign missions of Europe
</h2> </h2>
</div> </div>
</Link>
</div> </div>
</div> </div>
<div className="flex flex-col gap-8 mt-4 lg:mt-8"> <div className="flex flex-col gap-8 mt-4 lg:mt-8">
+2 -2
View File
@@ -2,6 +2,8 @@ services:
eu: eu:
image: localhost:5000/eu:latest image: localhost:5000/eu:latest
restart: unless-stopped restart: unless-stopped
extra_hosts:
- "assets.dusiburg.ru:172.18.0.4"
environment: environment:
PUBLIC_URL: ${PUBLIC_URL} PUBLIC_URL: ${PUBLIC_URL}
DATABASE_URL: ${DATABASE_URL} DATABASE_URL: ${DATABASE_URL}
@@ -14,8 +16,6 @@ services:
JWT_SECRET: ${JWT_SECRET} JWT_SECRET: ${JWT_SECRET}
SESSION_MAX_AGE: 604800 SESSION_MAX_AGE: 604800
MINIO_URL: ${MINIO_URL}
MINIO_PORT: 9000
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY} MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY} MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
MINIO_PUBLIC_URL: ${MINIO_PUBLIC_URL} MINIO_PUBLIC_URL: ${MINIO_PUBLIC_URL}
+2 -2
View File
@@ -2,7 +2,7 @@ import crypto from "crypto";
import sharp from "sharp"; import sharp from "sharp";
import { AppError } from "@/lib/action-result"; import { AppError } from "@/lib/action-result";
import { getMinioClient, getMinioPublicClient } from "@/lib/minio"; import { getMinioClient } from "@/lib/minio";
const BUCKET = "uploads"; const BUCKET = "uploads";
const MAX_FILE_SIZE = 5 * 1024 * 1024; const MAX_FILE_SIZE = 5 * 1024 * 1024;
@@ -51,7 +51,7 @@ export async function removeImage(key: string) {
} }
export async function getImageUrl(key: string): Promise<string> { export async function getImageUrl(key: string): Promise<string> {
return getMinioPublicClient().presignedGetObject( return getMinioClient().presignedGetObject(
BUCKET, BUCKET,
key, key,
60 * 5 60 * 5
+5 -20
View File
@@ -1,32 +1,17 @@
import { Client } from "minio"; import { Client } from "minio";
let _internalClient: Client | null = null; let _client: Client | null = null;
let _publicClient: Client | null = null;
export function getMinioClient(): Client { export function getMinioClient(): Client {
if (!_internalClient) { if (!_client) {
_internalClient = new Client({
endPoint: process.env.MINIO_URL!,
port: Number(process.env.MINIO_PORT),
useSSL: false,
accessKey: process.env.MINIO_ACCESS_KEY!,
secretKey: process.env.MINIO_SECRET_KEY!,
});
}
return _internalClient;
}
export function getMinioPublicClient(): Client {
if (!_publicClient) {
const url = new URL(process.env.MINIO_PUBLIC_URL!); const url = new URL(process.env.MINIO_PUBLIC_URL!);
_client = new Client({
_publicClient = new Client({
endPoint: url.hostname, endPoint: url.hostname,
port: url.port ? Number(url.port) : (url.protocol === "https:" ? 443 : 80), port: url.port ? Number(url.port) : 443,
useSSL: url.protocol === "https:", useSSL: url.protocol === "https:",
accessKey: process.env.MINIO_ACCESS_KEY!, accessKey: process.env.MINIO_ACCESS_KEY!,
secretKey: process.env.MINIO_SECRET_KEY!, secretKey: process.env.MINIO_SECRET_KEY!,
}); });
} }
return _publicClient; return _client;
} }