mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Compare commits
3
Commits
1.2.4
...
1.2.5-rc.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db1a0235ed | ||
|
|
2cd6a7cae0 | ||
|
|
bd80fdc960 |
+2
-2
@@ -26,5 +26,5 @@ keywords:
|
|||||||
- web-ui
|
- web-ui
|
||||||
- agent
|
- agent
|
||||||
license: Apache-2.0
|
license: Apache-2.0
|
||||||
version: 1.2.4
|
version: 1.2.5-rc.1
|
||||||
date-released: "2026-01-29"
|
date-released: "2026-01-31"
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
EDGE_KEY="eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiOWNhODU3MDQtYmM5MC00Mzg3LTgxYzUtYjIyZWI3MTNiMDM3IiwicHVibGljS2V5IjoiLS0tLS1CRUdJTiBSU0EgUFVCTElDIEtFWS0tLS0tXG5NSUlCQ2dLQ0FRRUF5UmhJaXdOTnVFWVhxV1VaQXlVdkZjajl5SDJyWHVJM055ZHVpN0F0NzlIZ1JEV1BFWHVnXG5HMytBNVdtKzZROFE2c1l1YVEzT05tVUw3VzZGZDlvNjYvZ3cxbjBmTHZDMFV2c2JRbHB5L3ZTeGx5eVFreWNoXG5aR3lBY09IcmpMVGhpcmJ0aGQzT1NxR1paYlZrcnFsSnErZytrdksrcU5VV0QvdzU5amZtVmtvU3ByRlVBRi91XG5jUW96aFdFd3hVVjBsYlRHOXhzNnFPdE5pMjlhbklESjI3eTNVNnkrUk95NUNnQVk3MmNwRUdCelhSUzNQY0ZGXG5vMG5iejR2VlN1SHJkZ05tWDZPcjNoSXVEdHJPdnAyMWVXTU5kc05KTDdJQm1BbFFzbGNMdzRNTGluTzg5eUZxXG53bkFSZXJ1Yk1CTlhjM2FEZFo5NG02Z1k4b1BBbERiRHBRSURBUUFCXG4tLS0tLUVORCBSU0EgUFVCTElDIEtFWS0tLS0tXG4ifQ"
|
||||||
|
PROJECT_NAME="my-agent"
|
||||||
|
DB_PG_E009_PORT="63200"
|
||||||
|
DB_PG_E009_DB="pg_a4e81399"
|
||||||
|
DB_PG_E009_USER="admin"
|
||||||
|
DB_PG_E009_PASS="0d147e4485751e80"
|
||||||
|
DB_MARIADB_3896_PORT="63206"
|
||||||
|
DB_MARIADB_3896_DB="mysql_d82be2e8"
|
||||||
|
DB_MARIADB_3896_USER="admin"
|
||||||
|
DB_MARIADB_3896_PASS="5c3c1050728af0ba"
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"databases": [
|
||||||
|
{
|
||||||
|
"name": "pg_a4e81399",
|
||||||
|
"database": "pg_a4e81399",
|
||||||
|
"type": "postgresql",
|
||||||
|
"username": "admin",
|
||||||
|
"password": "0d147e4485751e80",
|
||||||
|
"port": 63200,
|
||||||
|
"host": "localhost",
|
||||||
|
"generated_id": "d79b86c2-6c70-4d44-99cc-22243f36f539"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mysql_d82be2e8",
|
||||||
|
"database": "mysql_d82be2e8",
|
||||||
|
"type": "mysql",
|
||||||
|
"username": "admin",
|
||||||
|
"password": "5c3c1050728af0ba",
|
||||||
|
"port": 63206,
|
||||||
|
"host": "localhost",
|
||||||
|
"generated_id": "4beda7df-1370-4613-b98a-4f47fe7132be"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
name: my-agent
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
container_name: my-agent-app
|
||||||
|
restart: always
|
||||||
|
image: portabase/agent:latest
|
||||||
|
volumes:
|
||||||
|
- ./databases.json:/config/config.json
|
||||||
|
extra_hosts:
|
||||||
|
- "localhost:host-gateway"
|
||||||
|
environment:
|
||||||
|
TZ: "Europe/Paris"
|
||||||
|
EDGE_KEY: "${EDGE_KEY}"
|
||||||
|
LOG: info
|
||||||
|
networks:
|
||||||
|
- portabase
|
||||||
|
|
||||||
|
|
||||||
|
db-pg-e009:
|
||||||
|
container_name: my-agent-db-pg-e009
|
||||||
|
image: postgres:17-alpine
|
||||||
|
networks:
|
||||||
|
- portabase
|
||||||
|
- default
|
||||||
|
ports:
|
||||||
|
- "${DB_PG_E009_PORT}:5432"
|
||||||
|
volumes:
|
||||||
|
- db-pg-e009-data:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
- POSTGRES_DB=${DB_PG_E009_DB}
|
||||||
|
- POSTGRES_USER=${DB_PG_E009_USER}
|
||||||
|
- POSTGRES_PASSWORD=${DB_PG_E009_PASS}
|
||||||
|
|
||||||
|
db-mariadb-3896:
|
||||||
|
container_name: my-agent-db-mariadb-3896
|
||||||
|
image: mariadb:latest
|
||||||
|
ports:
|
||||||
|
- "${DB_MARIADB_3896_PORT}:3306"
|
||||||
|
environment:
|
||||||
|
- MYSQL_DATABASE=${DB_MARIADB_3896_DB}
|
||||||
|
- MYSQL_USER=${DB_MARIADB_3896_USER}
|
||||||
|
- MYSQL_PASSWORD=${DB_MARIADB_3896_PASS}
|
||||||
|
- MYSQL_RANDOM_ROOT_PASSWORD=yes
|
||||||
|
volumes:
|
||||||
|
- db-mariadb-3896-data:/var/lib/mysql
|
||||||
|
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db-pg-e009-data:
|
||||||
|
db-mariadb-3896-data:
|
||||||
|
|
||||||
|
|
||||||
|
networks:
|
||||||
|
portabase:
|
||||||
|
name: portabase_network
|
||||||
|
external: true
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "portabase",
|
"name": "portabase",
|
||||||
"version": "1.2.4",
|
"version": "1.2.5-rc.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbopack -p 8887",
|
"dev": "next dev --turbopack -p 8887",
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export const LoginForm = (props: loginFormProps) => {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Email Address</FormLabel>
|
<FormLabel>Email Address</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input autoComplete="email" autoFocus placeholder="exemple@portabase.io" {...field} />
|
<Input autoComplete="email" autoFocus placeholder="example@portabase.io" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage/>
|
<FormMessage/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export const RegisterForm = (props: registerFormProps) => {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Email</FormLabel>
|
<FormLabel>Email</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="exemple@portabase.io" {...field} />
|
<Input placeholder="example@portabase.io" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage/>
|
<FormMessage/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import {
|
|||||||
ChannelOrganisationForm
|
ChannelOrganisationForm
|
||||||
} from "@/components/wrappers/dashboard/admin/channels/organization/channels-organization-form";
|
} from "@/components/wrappers/dashboard/admin/channels/organization/channels-organization-form";
|
||||||
|
|
||||||
|
|
||||||
type ChannelAddModalProps = {
|
type ChannelAddModalProps = {
|
||||||
channel?: NotificationChannelWith | StorageChannelWith
|
channel?: NotificationChannelWith | StorageChannelWith
|
||||||
organization?: OrganizationWithMembers;
|
organization?: OrganizationWithMembers;
|
||||||
|
|||||||
+5
-4
@@ -34,6 +34,7 @@ import {
|
|||||||
addNotificationChannelAction, updateNotificationChannelAction
|
addNotificationChannelAction, updateNotificationChannelAction
|
||||||
} from "@/components/wrappers/dashboard/admin/channels/channel/channel-form/providers/notifications/action";
|
} from "@/components/wrappers/dashboard/admin/channels/channel/channel-form/providers/notifications/action";
|
||||||
|
|
||||||
|
|
||||||
type NotifierFormProps = {
|
type NotifierFormProps = {
|
||||||
onSuccessAction?: () => void;
|
onSuccessAction?: () => void;
|
||||||
organization?: OrganizationWithMembers;
|
organization?: OrganizationWithMembers;
|
||||||
@@ -54,7 +55,7 @@ export const ChannelForm = ({onSuccessAction, organization, defaultValues, kind}
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
form.reset(defaultValues ? {...defaultValues} : {});
|
form.reset(defaultValues ? {...defaultValues} : {enabled: true});
|
||||||
}, [defaultValues]);
|
}, [defaultValues]);
|
||||||
|
|
||||||
const mutationAddNotificationChannel = useMutation({
|
const mutationAddNotificationChannel = useMutation({
|
||||||
@@ -118,7 +119,7 @@ export const ChannelForm = ({onSuccessAction, organization, defaultValues, kind}
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
||||||
{type.preview && (
|
{type.preview && (
|
||||||
<div
|
<div
|
||||||
className="absolute bottom-0 right-0 overflow-hidden w-20 h-20 pointer-events-none">
|
className="absolute bottom-0 right-0 overflow-hidden w-20 h-20 pointer-events-none">
|
||||||
<div
|
<div
|
||||||
@@ -223,11 +224,11 @@ export const ChannelForm = ({onSuccessAction, organization, defaultValues, kind}
|
|||||||
|
|
||||||
<div className="flex justify-between mt-4">
|
<div className="flex justify-between mt-4">
|
||||||
<div>
|
<div>
|
||||||
{defaultValues && (
|
{kind == "storage" && (
|
||||||
<ChannelTestButton
|
<ChannelTestButton
|
||||||
kind={kind}
|
kind={kind}
|
||||||
organizationId={organization?.id}
|
organizationId={organization?.id}
|
||||||
channel={defaultValues}
|
channel={form.getValues()}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+12
-8
@@ -1,18 +1,21 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import {Button} from "@/components/ui/button";
|
|
||||||
import {NotificationChannel} from "@/db/schema/09_notification-channel";
|
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {dispatchNotification} from "@/features/notifications/dispatch";
|
|
||||||
import {EventPayload} from "@/features/notifications/types";
|
|
||||||
import {Send, ShieldCheck} from "lucide-react";
|
import {Send, ShieldCheck} from "lucide-react";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
|
|
||||||
|
import {Button} from "@/components/ui/button";
|
||||||
|
import {NotificationChannel} from "@/db/schema/09_notification-channel";
|
||||||
|
import {dispatchNotification} from "@/features/notifications/dispatch";
|
||||||
|
import {EventPayload} from "@/features/notifications/types";
|
||||||
import {useIsMobile} from "@/hooks/use-mobile";
|
import {useIsMobile} from "@/hooks/use-mobile";
|
||||||
import {cn} from "@/lib/utils";
|
import {cn} from "@/lib/utils";
|
||||||
import {StorageChannel} from "@/db/schema/12_storage-channel";
|
import {StorageChannel} from "@/db/schema/12_storage-channel";
|
||||||
import {ChannelKind, getChannelTextBasedOnKind} from "@/components/wrappers/dashboard/admin/channels/helpers/common";
|
import {ChannelKind} from "@/components/wrappers/dashboard/admin/channels/helpers/common";
|
||||||
import type {StorageInput} from "@/features/storages/types";
|
import type {StorageInput} from "@/features/storages/types";
|
||||||
import {dispatchStorage} from "@/features/storages/dispatch";
|
import {dispatchStorage} from "@/features/storages/dispatch";
|
||||||
|
|
||||||
|
|
||||||
type NotifierTestChannelButtonProps = {
|
type NotifierTestChannelButtonProps = {
|
||||||
channel: NotificationChannel | StorageChannel;
|
channel: NotificationChannel | StorageChannel;
|
||||||
organizationId?: string;
|
organizationId?: string;
|
||||||
@@ -20,8 +23,9 @@ type NotifierTestChannelButtonProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const ChannelTestButton = ({channel, organizationId, kind}: NotifierTestChannelButtonProps) => {
|
export const ChannelTestButton = ({channel, organizationId, kind}: NotifierTestChannelButtonProps) => {
|
||||||
const channelText = getChannelTextBasedOnKind(kind)
|
|
||||||
const isMobile = useIsMobile()
|
const isMobile = useIsMobile()
|
||||||
|
|
||||||
const mutation = useMutation({
|
const mutation = useMutation({
|
||||||
mutationFn: async () => {
|
mutationFn: async () => {
|
||||||
if (kind === "notification") {
|
if (kind === "notification") {
|
||||||
@@ -30,7 +34,7 @@ export const ChannelTestButton = ({channel, organizationId, kind}: NotifierTestC
|
|||||||
message: `We are testing channel ${channel.name}`,
|
message: `We are testing channel ${channel.name}`,
|
||||||
level: 'info',
|
level: 'info',
|
||||||
};
|
};
|
||||||
const result = await dispatchNotification(payload, undefined, channel.id, organizationId);
|
const result = await dispatchNotification(payload, undefined, channel, organizationId);
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
toast.success(result.message);
|
toast.success(result.message);
|
||||||
@@ -41,7 +45,7 @@ export const ChannelTestButton = ({channel, organizationId, kind}: NotifierTestC
|
|||||||
const input: StorageInput = {
|
const input: StorageInput = {
|
||||||
action: "ping",
|
action: "ping",
|
||||||
};
|
};
|
||||||
const result = await dispatchStorage(input, undefined, channel.id);
|
const result = await dispatchStorage(input, undefined, undefined, channel);
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
toast.success("Successfully connected to storage channel");
|
toast.success("Successfully connected to storage channel");
|
||||||
|
|||||||
+2
-2
@@ -47,7 +47,7 @@ export const NotifierSmtpForm = ({form}: NotifierSmtpFormProps) => {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Username</FormLabel>
|
<FormLabel>Username</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="contact@exemple.com" {...field} value={field.value ?? ""}/>
|
<Input placeholder="contact@example.com" {...field} value={field.value ?? ""}/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage/>
|
<FormMessage/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@@ -77,7 +77,7 @@ export const NotifierSmtpForm = ({form}: NotifierSmtpFormProps) => {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>From Email</FormLabel>
|
<FormLabel>From Email</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder={`"Portabase" <exemple@portabase.io>`} {...field}
|
<Input placeholder={`"Portabase" <example@portabase.io>`} {...field}
|
||||||
value={field.value ?? ""}/>
|
value={field.value ?? ""}/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage/>
|
<FormMessage/>
|
||||||
|
|||||||
+15
-2
@@ -19,9 +19,22 @@ export const StorageS3Form = ({form}: StorageS3FormProps) => {
|
|||||||
name="config.endPointUrl"
|
name="config.endPointUrl"
|
||||||
render={({field}) => (
|
render={({field}) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Endpoind URL</FormLabel>
|
<FormLabel>Endpoint URL</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input {...field} placeholder="s3.exemple.com"/>
|
<Input {...field} placeholder="s3.amazonaws.com"/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage/>
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="config.region"
|
||||||
|
render={({field}) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Region</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} placeholder="us-east-1"/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage/>
|
<FormMessage/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export const EmailForm = (props: EmailFormProps) => {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>From Email *</FormLabel>
|
<FormLabel>From Email *</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder={"exemple@portabase.com"} {...field} />
|
<Input placeholder={"example@portabase.com"} {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>{"The email from where the email will be send"}</FormDescription>
|
<FormDescription>{"The email from where the email will be send"}</FormDescription>
|
||||||
<FormMessage/>
|
<FormMessage/>
|
||||||
@@ -172,7 +172,7 @@ export const EmailForm = (props: EmailFormProps) => {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>User Email *</FormLabel>
|
<FormLabel>User Email *</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder={"exemple@portabase.com"} {...field} />
|
<Input placeholder={"example@portabase.com"} {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>{"The email server user"}</FormDescription>
|
<FormDescription>{"The email server user"}</FormDescription>
|
||||||
<FormMessage/>
|
<FormMessage/>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export const AgentForm = (props: agentFormProps) => {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Description</FormLabel>
|
<FormLabel>Description</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="This agent is for the client exemple.com" {...field}
|
<Input placeholder="This agent is for the client example.com" {...field}
|
||||||
value={field.value ?? ""}/>
|
value={field.value ?? ""}/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>Enter your project agent description</FormDescription>
|
<FormDescription>Enter your project agent description</FormDescription>
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import {eq} from 'drizzle-orm';
|
import {eq} from 'drizzle-orm';
|
||||||
|
import {Json} from "drizzle-zod";
|
||||||
|
|
||||||
import * as drizzleDb from '@/db';
|
import * as drizzleDb from '@/db';
|
||||||
import {db} from '@/db';
|
import {db} from '@/db';
|
||||||
import type {StorageInput, StorageProviderKind, StorageResult,} from './types';
|
import type {StorageInput, StorageProviderKind, StorageResult,} from './types';
|
||||||
import {dispatchViaProvider} from "@/features/storages/providers";
|
import {dispatchViaProvider} from "@/features/storages/providers";
|
||||||
import {StorageChannel} from "@/db/schema/12_storage-channel";
|
import {StorageChannel} from "@/db/schema/12_storage-channel";
|
||||||
import {Json} from "drizzle-zod";
|
import {
|
||||||
|
StorageChannelFormType
|
||||||
|
} from "@/components/wrappers/dashboard/admin/channels/channel/channel-form/channel-form.schema";
|
||||||
|
|
||||||
|
|
||||||
export async function dispatchStorage(
|
export async function dispatchStorage(
|
||||||
input: StorageInput,
|
input: StorageInput,
|
||||||
policyId?: string,
|
policyId?: string,
|
||||||
channelId?: string,
|
channelId?: string,
|
||||||
|
channelData?: StorageChannelFormType,
|
||||||
organizationId?: string
|
organizationId?: string
|
||||||
): Promise<StorageResult> {
|
): Promise<StorageResult> {
|
||||||
try {
|
try {
|
||||||
@@ -68,6 +74,8 @@ export async function dispatchStorage(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (channelData) channel = {...channelData, config: channelData.config as Json};
|
||||||
|
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
return {
|
return {
|
||||||
success: false,
|
success: false,
|
||||||
@@ -90,7 +98,6 @@ export async function dispatchStorage(
|
|||||||
channel.provider as StorageProviderKind,
|
channel.provider as StorageProviderKind,
|
||||||
channel.config,
|
channel.config,
|
||||||
input,
|
input,
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {generateFileUrl} from "@/features/storages/helpers";
|
|||||||
|
|
||||||
type S3Config = {
|
type S3Config = {
|
||||||
endPointUrl: string;
|
endPointUrl: string;
|
||||||
|
region?: string;
|
||||||
accessKey: string;
|
accessKey: string;
|
||||||
secretKey: string;
|
secretKey: string;
|
||||||
bucketName: string;
|
bucketName: string;
|
||||||
@@ -14,6 +15,7 @@ type S3Config = {
|
|||||||
async function getS3Client(config: S3Config) {
|
async function getS3Client(config: S3Config) {
|
||||||
return new Minio.Client({
|
return new Minio.Client({
|
||||||
endPoint: config.endPointUrl,
|
endPoint: config.endPointUrl,
|
||||||
|
region: config.region ?? "us-east-1",
|
||||||
accessKey: config.accessKey,
|
accessKey: config.accessKey,
|
||||||
secretKey: config.secretKey,
|
secretKey: config.secretKey,
|
||||||
port: config.port ?? 443,
|
port: config.port ?? 443,
|
||||||
@@ -32,7 +34,7 @@ async function ensureBucket(config: S3Config) {
|
|||||||
|
|
||||||
export async function uploadS3(
|
export async function uploadS3(
|
||||||
config: S3Config,
|
config: S3Config,
|
||||||
input: { data: StorageUploadInput, metadata?: StorageMetaData }
|
input: { data: StorageUploadInput, metadata?: StorageMetaData }
|
||||||
): Promise<StorageResult> {
|
): Promise<StorageResult> {
|
||||||
const client = await getS3Client(config);
|
const client = await getS3Client(config);
|
||||||
await ensureBucket(config);
|
await ensureBucket(config);
|
||||||
@@ -72,7 +74,10 @@ export async function uploadS3(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getS3(config: S3Config, input: { data: StorageGetInput, metadata: StorageMetaData }): Promise<StorageResult> {
|
export async function getS3(config: S3Config, input: {
|
||||||
|
data: StorageGetInput,
|
||||||
|
metadata: StorageMetaData
|
||||||
|
}): Promise<StorageResult> {
|
||||||
const client = await getS3Client(config);
|
const client = await getS3Client(config);
|
||||||
|
|
||||||
const key = `${BASE_DIR}${input.data.path}`;
|
const key = `${BASE_DIR}${input.data.path}`;
|
||||||
@@ -97,7 +102,10 @@ export async function getS3(config: S3Config, input: { data: StorageGetInput, me
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteS3(config: S3Config, input: { data: StorageDeleteInput, metadata?: StorageMetaData }): Promise<StorageResult> {
|
export async function deleteS3(config: S3Config, input: {
|
||||||
|
data: StorageDeleteInput,
|
||||||
|
metadata?: StorageMetaData
|
||||||
|
}): Promise<StorageResult> {
|
||||||
const client = await getS3Client(config);
|
const client = await getS3Client(config);
|
||||||
const key = `${BASE_DIR}${input.data.path}`;
|
const key = `${BASE_DIR}${input.data.path}`;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
EDGE_KEY="eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiZDYxMTBiZjItODQ2OS00MWRlLTkxMDItMzA3NmE4NDlhMmNjIiwicHVibGljS2V5IjoiLS0tLS1CRUdJTiBSU0EgUFVCTElDIEtFWS0tLS0tXG5NSUlCQ2dLQ0FRRUF5UmhJaXdOTnVFWVhxV1VaQXlVdkZjajl5SDJyWHVJM055ZHVpN0F0NzlIZ1JEV1BFWHVnXG5HMytBNVdtKzZROFE2c1l1YVEzT05tVUw3VzZGZDlvNjYvZ3cxbjBmTHZDMFV2c2JRbHB5L3ZTeGx5eVFreWNoXG5aR3lBY09IcmpMVGhpcmJ0aGQzT1NxR1paYlZrcnFsSnErZytrdksrcU5VV0QvdzU5amZtVmtvU3ByRlVBRi91XG5jUW96aFdFd3hVVjBsYlRHOXhzNnFPdE5pMjlhbklESjI3eTNVNnkrUk95NUNnQVk3MmNwRUdCelhSUzNQY0ZGXG5vMG5iejR2VlN1SHJkZ05tWDZPcjNoSXVEdHJPdnAyMWVXTU5kc05KTDdJQm1BbFFzbGNMdzRNTGluTzg5eUZxXG53bkFSZXJ1Yk1CTlhjM2FEZFo5NG02Z1k4b1BBbERiRHBRSURBUUFCXG4tLS0tLUVORCBSU0EgUFVCTElDIEtFWS0tLS0tXG4ifQ"
|
||||||
|
PROJECT_NAME="test-1"
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"databases": [
|
||||||
|
{
|
||||||
|
"name": "Test database 3 - rust",
|
||||||
|
"database": "mariadb",
|
||||||
|
"type": "mysql",
|
||||||
|
"username": "mariadb",
|
||||||
|
"password": "changeme",
|
||||||
|
"port": 3306,
|
||||||
|
"host": "db2",
|
||||||
|
"generated_id": "16678124-ff7e-4c97-8c83-0adeff214681"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
name: test-1
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
container_name: test-1-app
|
||||||
|
restart: always
|
||||||
|
image: portabase/agent:1.0.1-rc.1
|
||||||
|
volumes:
|
||||||
|
- ./databases.json:/config/config.json
|
||||||
|
extra_hosts:
|
||||||
|
- "localhost:host-gateway"
|
||||||
|
environment:
|
||||||
|
TZ: "Europe/Paris"
|
||||||
|
EDGE_KEY: "${EDGE_KEY}"
|
||||||
|
LOG: info
|
||||||
|
|
||||||
|
db2:
|
||||||
|
image: mariadb:latest
|
||||||
|
environment:
|
||||||
|
- MYSQL_DATABASE=mariadb
|
||||||
|
- MYSQL_USER=mariadb
|
||||||
|
- MYSQL_PASSWORD=changeme
|
||||||
|
- MYSQL_RANDOM_ROOT_PASSWORD=yes
|
||||||
|
volumes:
|
||||||
|
- mariadb-data:/var/lib/mysql
|
||||||
|
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mariadb-data:
|
||||||
Reference in New Issue
Block a user