-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split out moderation backend (#1970)
* mv appview * copy * finalize copy * package names * big WIP * first pass at mod servce * some tidy * tidy & fix compiler errors * rename to ozone, db migrations, add to dev-env & pds cfg * getRecord & getRepo mostly working * fix open handle * get record tests all working * moderation events working * statuses working * tidy test suite * search repos * server & db tests * moderation tests * wip daemon + push events * pds fanout working * fix db test * fanning takedowns out to appview * rm try/catch * bsky moderation test * introduce mod subject wrappers * more tidy * refactor event reversal * tidy some db stuff * tidy * rename service to mod-service * fix test * tidy config * refactor auth in bsky * wip patching up auto-mod * add label ingester in appview * fix a couple build issues * fix some timing bugs * tidy polling logic * fix up tests * fix some pds tests * eslint ignore * fix ozone tests * move seeds to dev-env * move images around * fix db schemas * use service auth admin reqs * fix remaining tests * auth tests bsky * another test * random tidy * fix up search * clean up bsky mod service * more tidy * default attempts to 0 * tidy old test * random tidy * tidy package.json * tidy logger * takedownId -> takedownRef * misc pr feedback * split daemon out from ozone application * fix blob takedown mgiration * refactor ozone config * do push event fanout on write instead of on read * make suspend error work again * add attempts check & add supporting index * fix takedown test ref * get tests working * rm old test * fix timing bug in event pusher tests * attempt another fix for timing bug * await req * service files * remove labelerDid cfg * update snaps for labeler did + some cfg changes * fix more snaps * pnpm i * build ozone images * build * make label provider optional * fix build issues * fix build * fix build * build pds * build on ghcr * fix syntax in entry * another fix * use correct import * export logger * remove event reverser * adjust push event fanout * push out multiple * remove builds
- Loading branch information
Showing
468 changed files
with
26,610 additions
and
4,857 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
packages/api/src/client | ||
packages/bsky/src/lexicon | ||
packages/pds/src/lexicon | ||
packages/ozone/src/lexicon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: build-and-push-ozone-aws | ||
on: | ||
push: | ||
branches: | ||
- main | ||
env: | ||
REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_REGISTRY }} | ||
USERNAME: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_USERNAME }} | ||
PASSWORD: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_PASSWORD }} | ||
IMAGE_NAME: ozone | ||
|
||
jobs: | ||
ozone-container-aws: | ||
if: github.repository == 'bluesky-social/atproto' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.USERNAME}} | ||
password: ${{ env.PASSWORD }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=sha,enable=true,priority=100,prefix=,suffix=,format=long | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
file: ./services/ozone/Dockerfile | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: build-and-push-ozone-ghcr | ||
on: | ||
push: | ||
branches: | ||
- main | ||
env: | ||
REGISTRY: ghcr.io | ||
USERNAME: ${{ github.actor }} | ||
PASSWORD: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# github.repository as <account>/<repo> | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
ozone-container-ghcr: | ||
if: github.repository == 'bluesky-social/atproto' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.USERNAME }} | ||
password: ${{ env.PASSWORD }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=sha,enable=true,priority=100,prefix=ozone:,suffix=,format=long | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
file: ./services/ozone/Dockerfile | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "com.atproto.admin.getAccountInfos", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get details about some accounts.", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["dids"], | ||
"properties": { | ||
"dids": { | ||
"type": "array", | ||
"items": { "type": "string", "format": "did" } | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["infos"], | ||
"properties": { | ||
"infos": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "com.atproto.admin.defs#accountView" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
packages/api/src/client/types/com/atproto/admin/getAccountInfos.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* GENERATED CODE - DO NOT MODIFY | ||
*/ | ||
import { Headers, XRPCError } from '@atproto/xrpc' | ||
import { ValidationResult, BlobRef } from '@atproto/lexicon' | ||
import { isObj, hasProp } from '../../../../util' | ||
import { lexicons } from '../../../../lexicons' | ||
import { CID } from 'multiformats/cid' | ||
import * as ComAtprotoAdminDefs from './defs' | ||
|
||
export interface QueryParams { | ||
dids: string[] | ||
} | ||
|
||
export type InputSchema = undefined | ||
|
||
export interface OutputSchema { | ||
infos: ComAtprotoAdminDefs.AccountView[] | ||
[k: string]: unknown | ||
} | ||
|
||
export interface CallOptions { | ||
headers?: Headers | ||
} | ||
|
||
export interface Response { | ||
success: boolean | ||
headers: Headers | ||
data: OutputSchema | ||
} | ||
|
||
export function toKnownErr(e: any) { | ||
if (e instanceof XRPCError) { | ||
} | ||
return e | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.