mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Merge branch 'ditto-uploaders' into 'main'
Move uploaders into @ditto/uploaders See merge request soapbox-pub/ditto!671
This commit is contained in:
commit
0202117d5d
7 changed files with 19 additions and 7 deletions
|
|
@ -5,7 +5,8 @@
|
||||||
"./packages/conf",
|
"./packages/conf",
|
||||||
"./packages/db",
|
"./packages/db",
|
||||||
"./packages/ditto",
|
"./packages/ditto",
|
||||||
"./packages/metrics"
|
"./packages/metrics",
|
||||||
|
"./packages/uploaders"
|
||||||
],
|
],
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"start": "deno run -A --env-file --deny-read=.env packages/ditto/server.ts",
|
"start": "deno run -A --env-file --deny-read=.env packages/ditto/server.ts",
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
|
import { DenoUploader, IPFSUploader, S3Uploader } from '@ditto/uploaders';
|
||||||
import { BlossomUploader, NostrBuildUploader } from '@nostrify/nostrify/uploaders';
|
import { BlossomUploader, NostrBuildUploader } from '@nostrify/nostrify/uploaders';
|
||||||
import { safeFetch } from '@soapbox/safe-fetch';
|
import { safeFetch } from '@soapbox/safe-fetch';
|
||||||
|
|
||||||
import { AppMiddleware } from '@/app.ts';
|
import { AppMiddleware } from '@/app.ts';
|
||||||
import { DenoUploader } from '@/uploaders/DenoUploader.ts';
|
|
||||||
import { IPFSUploader } from '@/uploaders/IPFSUploader.ts';
|
|
||||||
import { S3Uploader } from '@/uploaders/S3Uploader.ts';
|
|
||||||
|
|
||||||
/** Set an uploader for the user. */
|
/** Set an uploader for the user. */
|
||||||
export const uploaderMiddleware: AppMiddleware = async (c, next) => {
|
export const uploaderMiddleware: AppMiddleware = async (c, next) => {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
|
|
||||||
import { NUploader } from '@nostrify/nostrify';
|
|
||||||
import { crypto } from '@std/crypto';
|
import { crypto } from '@std/crypto';
|
||||||
import { encodeHex } from '@std/encoding/hex';
|
import { encodeHex } from '@std/encoding/hex';
|
||||||
import { extensionsByType } from '@std/media-types';
|
import { extensionsByType } from '@std/media-types';
|
||||||
|
|
||||||
|
import type { NUploader } from '@nostrify/nostrify';
|
||||||
|
|
||||||
export interface DenoUploaderOpts {
|
export interface DenoUploaderOpts {
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
dir: string;
|
dir: string;
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { NUploader } from '@nostrify/nostrify';
|
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
import type { NUploader } from '@nostrify/nostrify';
|
||||||
|
|
||||||
export interface IPFSUploaderOpts {
|
export interface IPFSUploaderOpts {
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
apiUrl?: string;
|
apiUrl?: string;
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
|
|
||||||
import { S3Client } from '@bradenmacdonald/s3-lite-client';
|
import { S3Client } from '@bradenmacdonald/s3-lite-client';
|
||||||
import { NUploader } from '@nostrify/nostrify';
|
|
||||||
import { crypto } from '@std/crypto';
|
import { crypto } from '@std/crypto';
|
||||||
import { encodeHex } from '@std/encoding/hex';
|
import { encodeHex } from '@std/encoding/hex';
|
||||||
import { extensionsByType } from '@std/media-types';
|
import { extensionsByType } from '@std/media-types';
|
||||||
|
|
||||||
|
import type { NUploader } from '@nostrify/nostrify';
|
||||||
|
|
||||||
export interface S3UploaderOpts {
|
export interface S3UploaderOpts {
|
||||||
endPoint: string;
|
endPoint: string;
|
||||||
region: string;
|
region: string;
|
||||||
7
packages/uploaders/deno.json
Normal file
7
packages/uploaders/deno.json
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"name": "@ditto/uploaders",
|
||||||
|
"version": "1.1.0",
|
||||||
|
"exports": {
|
||||||
|
".": "./mod.ts"
|
||||||
|
}
|
||||||
|
}
|
||||||
3
packages/uploaders/mod.ts
Normal file
3
packages/uploaders/mod.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
export { DenoUploader } from './DenoUploader.ts';
|
||||||
|
export { IPFSUploader } from './IPFSUploader.ts';
|
||||||
|
export { S3Uploader } from './S3Uploader.ts';
|
||||||
Loading…
Add table
Reference in a new issue