Skip to content

Commit

Permalink
Revert "Release 2022.07.03-milkey-2.8 (#72)"
Browse files Browse the repository at this point in the history
This reverts commit 35eafcb.
  • Loading branch information
atsu1125 authored Dec 27, 2023
1 parent 35eafcb commit 86a273d
Show file tree
Hide file tree
Showing 32 changed files with 81 additions and 361 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Docker Image CI

on: [push, pull_request, release]
on: [push]

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Node.js CI
on: [push, pull_request, release]
on: [push]

jobs:
build_and_test:
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.20.2
v16.19.1
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.20.2-bullseye AS builder
FROM node:16.19.1-bullseye AS builder

ENV NODE_ENV=production
WORKDIR /misskey
Expand All @@ -12,7 +12,7 @@ COPY . ./
RUN yarn build


FROM node:16.20.2-bullseye-slim AS runner
FROM node:16.19.1-bullseye-slim AS runner

WORKDIR /misskey

Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "groundpolis-milkey",
"version": "2022.07.03-milkey-2.8",
"version": "2022.07.03-milkey-2.7",
"private": true,
"author": "Xeltica <[email protected]> , Minemu <[email protected]> , Azuki⪥ <[email protected]> , Remito <[email protected]> , atsu1125 <[email protected]>",
"contributors": [
Expand Down Expand Up @@ -54,7 +54,6 @@
"@koa/cors": "3.1.0",
"@koa/multer": "3.0.0",
"@koa/router": "9.0.1",
"@peertube/http-signature": "1.7.0",
"@sentry/browser": "7.5.1",
"@sentry/tracing": "5.29.2",
"@sinonjs/fake-timers": "10.0.0",
Expand Down Expand Up @@ -229,13 +228,13 @@
"sass": "1.49.9",
"sass-loader": "13.2.0",
"seedrandom": "3.0.5",
"sharp": "0.32.6",
"sharp": "0.31.1",
"speakeasy": "2.0.0",
"stringz": "2.1.0",
"style-loader": "3.3.1",
"summaly": "2.7.0",
"syslog-pro": "1.0.0",
"systeminformation": "5.21.7",
"systeminformation": "5.12.6",
"syuilo-password-strength": "0.0.1",
"terser-webpack-plugin": "4.2.3",
"textarea-caret": "3.1.0",
Expand Down
8 changes: 1 addition & 7 deletions src/client/components/note-detailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ export default defineComponent({
capture(withHandler = false) {
if (this.$i) {
this.connection.send(document.body.contains(this.$el) ? 'sn' : 's', { id: this.appearNote.id });
if (this.note.id !== this.appearNote.id) this.connection.send('s', { id: this.note.id });
if (withHandler) this.connection.on('noteUpdated', this.onStreamNoteUpdated);
}
},
Expand All @@ -405,11 +404,6 @@ export default defineComponent({
this.connection.send('un', {
id: this.appearNote.id
});
if (this.note.id !== this.appearNote.id) {
this.connection.send('un', {
id: this.note.id,
});
}
if (withHandler) this.connection.off('noteUpdated', this.onStreamNoteUpdated);
}
},
Expand All @@ -421,7 +415,7 @@ export default defineComponent({
onStreamNoteUpdated(data) {
const { type, id, body } = data;
if ((id !== this.note.id) && (id !== this.appearNote.id)) return;
if (id !== this.appearNote.id) return;
switch (type) {
case 'reacted': {
Expand Down
10 changes: 2 additions & 8 deletions src/client/components/note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export default defineComponent({
},
canRenote(): boolean {
return ['public', 'home'].includes(this.appearNote.visibility) || (['followers', 'users'].includes(this.appearNote.visibility) && this.isMyNote);
return ['public', 'home'].includes(this.appearNote.visibility) || this.isMyNote;
},
reactionsCount(): number {
Expand Down Expand Up @@ -385,7 +385,6 @@ export default defineComponent({
capture(withHandler = false) {
if (this.$i) {
this.connection.send(document.body.contains(this.$el) ? 'sn' : 's', { id: this.appearNote.id });
if (this.note.id !== this.appearNote.id) this.connection.send('s', { id: this.note.id });
if (withHandler) this.connection.on('noteUpdated', this.onStreamNoteUpdated);
}
},
Expand All @@ -395,11 +394,6 @@ export default defineComponent({
this.connection.send('un', {
id: this.appearNote.id
});
if (this.note.id !== this.appearNote.id) {
this.connection.send('un', {
id: this.note.id,
});
}
if (withHandler) this.connection.off('noteUpdated', this.onStreamNoteUpdated);
}
},
Expand All @@ -411,7 +405,7 @@ export default defineComponent({
onStreamNoteUpdated(data) {
const { type, id, body } = data;
if ((id !== this.note.id) && (id !== this.appearNote.id)) return;
if (id !== this.appearNote.id) return;
switch (type) {
case 'reacted': {
Expand Down
20 changes: 2 additions & 18 deletions src/client/pages/instance/announcements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
</div>
</div>
</section>
<MkButton class="button" inline @click="more()"><Fa :icon="faEllipsisH"/> {{ $ts.more }}</MkButton>
</div>
</div>
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { faBroadcastTower, faPlus, faEllipsisH } from '@fortawesome/free-solid-svg-icons';
import { faBroadcastTower, faPlus } from '@fortawesome/free-solid-svg-icons';
import { faSave, faTrashAlt } from '@fortawesome/free-regular-svg-icons';
import MkButton from '@/components/ui/button.vue';
import MkInput from '@/components/ui/input.vue';
Expand All @@ -53,7 +52,7 @@ export default defineComponent({
},
},
announcements: [],
faBroadcastTower, faSave, faTrashAlt, faEllipsisH
faBroadcastTower, faSave, faTrashAlt
}
},
Expand Down Expand Up @@ -92,7 +91,6 @@ export default defineComponent({
type: 'success',
text: this.$ts.saved
});
this.refresh();
}).catch(e => {
os.dialog({
type: 'error',
Expand All @@ -112,20 +110,6 @@ export default defineComponent({
});
});
}
},
refresh() {
os.api('admin/announcements/list').then(announcements => {
this.announcements = announcements;
});
},
more() {
const announcements = this.announcements;
os.api('admin/announcements/list', { untilId: announcements.reduce((acc, announcement) => announcement.id != null ? announcement : acc).id }).then(announcements => {
this.announcements = this.announcements.concat(announcements);
});
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/queue/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Queue from 'bull';
import * as httpSignature from '@peertube/http-signature';
import * as httpSignature from 'http-signature';

import config from '../config';
import { ILocalUser } from '../models/entities/user';
Expand Down
9 changes: 0 additions & 9 deletions src/queue/processors/deliver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,11 @@ export default async (job: Bull.Job) => {
if (res != null && res.hasOwnProperty('statusCode')) {
// 4xx
if (res.statusCode >= 400 && res.statusCode < 500) {
// 401,408,429がどうもpermanent errorじゃなさそう
if (res.statusCode === 401 || res.statusCode === 408 || res.statusCode === 429) {
throw `${res.statusCode} ${res.statusMessage}`;
}
// HTTPステータスコード4xxはクライアントエラーであり、それはつまり
// 何回再送しても成功することはないということなのでエラーにはしないでおく
return `${res.statusCode} ${res.statusMessage}`;
}

// ただし501は成功することはない
if (res.statusCode === 501) {
return `${res.statusCode} ${res.statusMessage}`;
}

// 5xx etc.
throw `${res.statusCode} ${res.statusMessage}`;
} else {
Expand Down
7 changes: 1 addition & 6 deletions src/queue/processors/inbox.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Bull from 'bull';
import * as httpSignature from '@peertube/http-signature';
import * as httpSignature from 'http-signature';
import perform from '../../remote/activitypub/perform';
import Logger from '../../services/logger';
import { registerOrFetchInstanceDoc } from '../../services/register-or-fetch-instance-doc';
Expand All @@ -13,7 +13,6 @@ import { InboxJobData } from '..';
import DbResolver from '../../remote/activitypub/db-resolver';
import { resolvePerson } from '../../remote/activitypub/models/person';
import { LdSignature } from '../../remote/activitypub/misc/ld-signature';
import { verifySignature } from '../../remote/activitypub/check-fetch.js';

const logger = new Logger('inbox');

Expand Down Expand Up @@ -67,10 +66,6 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {
// HTTP-Signatureの検証
const httpSignatureValidated = httpSignature.verifySignature(signature, authUser.key.keyPem);

if (httpSignatureValidated) {
if (!verifySignature(signature, authUser.key)) return `skip: Invalid HTTP signature`;
}

// また、signatureのsignerは、activity.actorと一致する必要がある
if (!httpSignatureValidated || authUser.user.uri !== activity.actor) {
// 一致しなくても、でもLD-Signatureがありそうならそっちも見る
Expand Down
2 changes: 1 addition & 1 deletion src/queue/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DriveFile } from '../models/entities/drive-file';
import { User } from '../models/entities/user';
import { IActivity } from '../remote/activitypub/type';
import * as httpSignature from '@peertube/http-signature';
import * as httpSignature from 'http-signature';

export type DeliverJobData = {
/** Actor */
Expand Down
2 changes: 1 addition & 1 deletion src/remote/activitypub/audience.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function groupingAudience(ids: string[], actor: IRemoteUser) {
function isPublic(id: string) {
return [
'https://www.w3.org/ns/activitystreams#Public',
'as:Public',
'as#Public',
'Public',
].includes(id);
}
Expand Down
23 changes: 0 additions & 23 deletions src/remote/activitypub/check-fetch.ts

This file was deleted.

26 changes: 0 additions & 26 deletions src/remote/activitypub/kernel/delete/actor.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/remote/activitypub/kernel/delete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import deleteNote from './note';
import { IRemoteUser } from '../../../../models/entities/user';
import { IDelete, getApId, isTombstone, IObject, validPost, validActor } from '../../type';
import { toSingle } from '../../../../prelude/array';
import { deleteActor } from './actor';

/**
* 削除アクティビティを捌きます
Expand Down Expand Up @@ -42,7 +41,7 @@ export default async (actor: IRemoteUser, activity: IDelete): Promise<string> =>
if (validPost.includes(formarType)) {
return await deleteNote(actor, uri);
} else if (validActor.includes(formarType)) {
return await deleteActor(actor, uri);
return `Delete Actor is not implanted`;
} else {
return `Unknown type ${formarType}`;
}
Expand Down
14 changes: 5 additions & 9 deletions src/remote/activitypub/renderer/undo.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import config from '../../../config';
import { ILocalUser, User } from '../../../models/entities/user';

export default (object: any, user: ILocalUser | User) => {
if (object == null) return null;

return {
type: 'Undo',
actor: `${config.url}/users/${user.id}`,
object
};
};
export default (object: any, user: ILocalUser | User) => ({
type: 'Undo',
actor: `${config.url}/users/${user.id}`,
object
});
Loading

0 comments on commit 86a273d

Please sign in to comment.