Skip to content

Commit

Permalink
Configure labeler service account in dev-env (#2363)
Browse files Browse the repository at this point in the history
* 🚧 WIP attempting to make ozone work with local

* ✨ Labeler service set up works

* Renmae account details for mod authority

* 🧹 Clean up createOzoneDid signature

* 🚨 Fix typedef

* ✅ Adjust snapshot

* ✅ Fix test with invite code

* 🚧 WIP

* 🚧 WIP

* 🚧 bring back test

* 🚧 bring back test

* ✅ Update ozone snapshots

* ✅ Update ozone snapshots
  • Loading branch information
foysalit authored May 1, 2024
1 parent 79f8e1e commit 1c616b0
Show file tree
Hide file tree
Showing 8 changed files with 495 additions and 331 deletions.
1 change: 1 addition & 0 deletions packages/dev-env/src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const run = async () => {
`🌞 Personal Data server started http://localhost:${network.pds.port}`,
)
console.log(`🗼 Ozone server started http://localhost:${network.ozone.port}`)
console.log(`🗼 Ozone service DID ${network.ozone.ctx.cfg.service.did}`)
console.log(`🌅 Bsky Appview started http://localhost:${network.bsky.port}`)
for (const fg of network.feedGens) {
console.log(`🤖 Feed Generator started http://localhost:${fg.port}`)
Expand Down
322 changes: 0 additions & 322 deletions packages/dev-env/src/mock/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,328 +350,6 @@ export async function generateMockSetup(env: TestNetwork) {
},
)

// create the dev-env moderator
{
const res = await clients.loggedout.api.com.atproto.server.createAccount({
email: '[email protected]',
handle: 'mod-authority.test',
password: 'hunter2',
})
const agent = env.pds.getClient()
agent.api.setHeader('Authorization', `Bearer ${res.data.accessJwt}`)
await agent.api.app.bsky.actor.profile.create(
{ repo: res.data.did },
{
displayName: 'Dev-env Moderation',
description: `The pretend version of mod.bsky.app`,
},
)

await agent.api.app.bsky.labeler.service.create(
{ repo: res.data.did, rkey: 'self' },
{
policies: {
labelValues: [
'!hide',
'!warn',
'porn',
'sexual',
'nudity',
'sexual-figurative',
'graphic-media',
'self-harm',
'sensitive',
'extremist',
'intolerant',
'threat',
'rude',
'illicit',
'security',
'unsafe-link',
'impersonation',
'misinformation',
'scam',
'engagement-farming',
'spam',
'rumor',
'misleading',
'inauthentic',
],
labelValueDefinitions: [
{
identifier: 'spam',
blurs: 'content',
severity: 'inform',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Spam',
description:
'Unwanted, repeated, or unrelated actions that bother users.',
},
],
},
{
identifier: 'impersonation',
blurs: 'none',
severity: 'inform',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Impersonation',
description:
'Pretending to be someone else without permission.',
},
],
},
{
identifier: 'scam',
blurs: 'content',
severity: 'alert',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Scam',
description: 'Scams, phishing & fraud.',
},
],
},
{
identifier: 'intolerant',
blurs: 'content',
severity: 'alert',
defaultSetting: 'warn',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Intolerance',
description: 'Discrimination against protected groups.',
},
],
},
{
identifier: 'self-harm',
blurs: 'content',
severity: 'alert',
defaultSetting: 'warn',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Self-Harm',
description:
'Promotes self-harm, including graphic images, glorifying discussions, or triggering stories.',
},
],
},
{
identifier: 'security',
blurs: 'content',
severity: 'alert',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Security Concerns',
description:
'May be unsafe and could harm your device, steal your info, or get your account hacked.',
},
],
},
{
identifier: 'misleading',
blurs: 'content',
severity: 'alert',
defaultSetting: 'warn',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Misleading',
description:
'Altered images/videos, deceptive links, or false statements.',
},
],
},
{
identifier: 'threat',
blurs: 'content',
severity: 'inform',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Threats',
description:
'Promotes violence or harm towards others, including threats, incitement, or advocacy of harm.',
},
],
},
{
identifier: 'unsafe-link',
blurs: 'content',
severity: 'alert',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Unsafe link',
description:
'Links to harmful sites with malware, phishing, or violating content that risk security and privacy.',
},
],
},
{
identifier: 'illicit',
blurs: 'content',
severity: 'alert',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Illicit',
description:
'Promoting or selling potentially illicit goods, services, or activities.',
},
],
},
{
identifier: 'misinformation',
blurs: 'content',
severity: 'inform',
defaultSetting: 'warn',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Misinformation',
description:
'Spreading false or misleading info, including unverified claims and harmful conspiracy theories.',
},
],
},
{
identifier: 'rumor',
blurs: 'content',
severity: 'inform',
defaultSetting: 'warn',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Rumor',
description:
'Approach with caution, as these claims lack evidence from credible sources.',
},
],
},
{
identifier: 'rude',
blurs: 'content',
severity: 'inform',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Rude',
description:
'Rude or impolite, including crude language and disrespectful comments, without constructive purpose.',
},
],
},
{
identifier: 'extremist',
blurs: 'content',
severity: 'alert',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Extremist',
description:
'Radical views advocating violence, hate, or discrimination against individuals or groups.',
},
],
},
{
identifier: 'sensitive',
blurs: 'content',
severity: 'alert',
defaultSetting: 'warn',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Sensitive',
description:
'May be upsetting, covering topics like substance abuse or mental health issues, cautioning sensitive viewers.',
},
],
},
{
identifier: 'engagement-farming',
blurs: 'content',
severity: 'alert',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Engagement Farming',
description:
'Insincere content or bulk actions aimed at gaining followers, including frequent follows, posts, and likes.',
},
],
},
{
identifier: 'inauthentic',
blurs: 'content',
severity: 'alert',
defaultSetting: 'hide',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Inauthentic Account',
description: 'Bot or a person pretending to be someone else.',
},
],
},
{
identifier: 'sexual-figurative',
blurs: 'media',
severity: 'none',
defaultSetting: 'show',
adultOnly: true,
locales: [
{
lang: 'en',
name: 'Sexually Suggestive (Cartoon)',
description:
'Art with explicit or suggestive sexual themes, including provocative imagery or partial nudity.',
},
],
},
],
},
createdAt: date.next().value,
},
)
}

// create a labeler account
{
const res = await clients.loggedout.api.com.atproto.server.createAccount({
Expand Down
Loading

0 comments on commit 1c616b0

Please sign in to comment.