Add verified administrator controls and upload abuse limits
This commit is contained in:
@@ -4,6 +4,7 @@ import type { Server } from 'socket.io';
|
||||
import type { Auth } from './auth.js';
|
||||
import type { Accounts } from './accounts.js';
|
||||
import { Storage } from './storage.js';
|
||||
import { Administration } from './administration.js';
|
||||
import { ResumableUploads } from './resumable.js';
|
||||
import { NearbyLocations } from './nearby.js';
|
||||
import { Vault } from './vault.js';
|
||||
@@ -28,12 +29,14 @@ export class Service {
|
||||
accounts!: Accounts;
|
||||
io?: Server;
|
||||
storage: Storage;
|
||||
admin: Administration;
|
||||
resumable: ResumableUploads;
|
||||
vault: Vault;
|
||||
constructor(
|
||||
readonly db: DB,
|
||||
readonly cfg: Config,
|
||||
) {
|
||||
this.admin = new Administration(this);
|
||||
this.storage = new Storage(this);
|
||||
this.resumable = new ResumableUploads(this);
|
||||
this.nearby = new NearbyLocations(cfg.locationRadiusMeters, (ids: string[]) =>
|
||||
@@ -585,6 +588,7 @@ export class Service {
|
||||
storageUserId?: string,
|
||||
) {
|
||||
this.cleanup();
|
||||
if (input.kind === 'file' && !storedSource) this.admin.assertNewUploads();
|
||||
const target = this.deviceGuest(input.targetDeviceId);
|
||||
if (
|
||||
target &&
|
||||
|
||||
Reference in New Issue
Block a user