-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split out moderation backend #1970
Changes from 81 commits
03a1557
1d80936
ef55a87
36ba182
5aaf7f3
a72ba16
fb3161e
6b682ab
b8af648
df4d40b
b121af1
731473c
ecb163e
6fb8d5b
efa90c0
bb86a0f
c7d6f7a
965669b
5c4b172
5ecbe43
4834ea9
f49ba1e
c133c4b
23ea84d
c8312f5
8016357
c1df5af
c880002
8ff0b5b
995f75d
2b33089
4ad7e24
fc32b36
f208397
f4df71d
f617fe0
626a06a
dcfc21f
dfc2332
20fee31
a445424
9208635
1d07ad5
54b1710
929bd63
9b638bc
0422450
fdb312a
2ab6b24
c1e29e3
d2987a8
24944b9
4cae7ef
47241d5
4b1b0eb
0880d40
04068ee
ccbcd6e
bd5abdb
7af7199
c26b9f7
26511a7
617595e
00978ae
b0c0d44
a796638
e9ff8cf
232a4c8
70536aa
a2f41ca
f312271
808fa19
4b9c782
9ed220e
e764792
b11086e
de48f83
2660c6a
867310e
59cde5a
9010abd
58ab837
83a0c23
6ef1a9b
8bd7a0c
82fe321
2e3afd9
de6518d
5704ea5
b2a1c9d
bbffac2
f827502
728a37c
d5cea8e
c7a7470
7d63499
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: build-and-push-ozone-aws | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- appeal-report | ||
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 |
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 |
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" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,11 @@ import { createPipeline, noRules } from '../../../../pipeline' | |
export default function (server: Server, ctx: AppContext) { | ||
const getProfile = createPipeline(skeleton, hydration, noRules, presentation) | ||
server.app.bsky.actor.getProfiles({ | ||
auth: ctx.authOptionalVerifier, | ||
auth: ctx.authVerifier.standardOptional, | ||
handler: async ({ auth, params, res }) => { | ||
const db = ctx.db.getReplica() | ||
const actorService = ctx.services.actor(db) | ||
const viewer = auth.credentials.did | ||
const viewer = auth.credentials.iss | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wondering in the back of my head if we should be looking at There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In any case, it's not super specific to this work. We can reconsider later, just didn't want to lose the thought. |
||
|
||
const [result, repoRev] = await Promise.all([ | ||
getProfile({ ...params, viewer }, { db, actorService }), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a batch version of
getAccountInfo
(implemented on PDS) - think there's a decent argument we just deprecate the non-batch versionThe basic idea here is to go to all relevant services (pds & appview) for all the info they have on a user & then collate in the ozone backend