Skip to content

Commit

Permalink
Merge remote-tracking branch 'anatawa12/vmimi-relay-timeline/generic'…
Browse files Browse the repository at this point in the history
… into vmimi-relay-timeline/forks/nirila
  • Loading branch information
anatawa12 committed Oct 9, 2024
2 parents 576fb99 + fa635f1 commit e438b03
Show file tree
Hide file tree
Showing 144 changed files with 4,276 additions and 1,811 deletions.
13 changes: 13 additions & 0 deletions .config/cypress-devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
# Misskey configuration
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

# ┌────────────────────────┐
#───┘ Initial Setup Password └─────────────────────────────────────────────────────

# Password to initiate setting up admin account.
# It will not be used after the initial setup is complete.
#
# Be sure to change this when you set up Misskey via the Internet.
#
# The provider of the service who sets up Misskey on behalf of the customer should
# set this value to something unique when generating the Misskey config file,
# and provide it to the customer.
setupPassword: example_password_please_change_this_or_you_will_get_hacked

# ┌─────┐
#───┘ URL └─────────────────────────────────────────────────────

Expand Down
14 changes: 14 additions & 0 deletions .config/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@
#
# publishTarballInsteadOfProvideRepositoryUrl: true

# ┌────────────────────────┐
#───┘ Initial Setup Password └─────────────────────────────────────────────────────

# Password to initiate setting up admin account.
# It will not be used after the initial setup is complete.
#
# Be sure to change this when you set up Misskey via the Internet.
#
# The provider of the service who sets up Misskey on behalf of the customer should
# set this value to something unique when generating the Misskey config file,
# and provide it to the customer.
#
# setupPassword: example_password_please_change_this_or_you_will_get_hacked

# ┌─────┐
#───┘ URL └─────────────────────────────────────────────────────

Expand Down
2 changes: 2 additions & 0 deletions .github/misskey/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
url: 'http://misskey.local'

setupPassword: example_password_please_change_this_or_you_will_get_hacked

# ローカルでテストするときにポートを被らないようにするためデフォルトのものとは変える(以下同じ)
port: 61812

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/check-misskey-js-autogen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: actions/checkout@v4.1.1
with:
submodules: true
persist-credentials: false
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- name: setup pnpm
Expand Down Expand Up @@ -57,7 +58,7 @@ jobs:
name: generated-misskey-js
path: packages/misskey-js/generator/built/autogen

# pull_request_target safety: permissions: read-all, and there are no secrets used in this job
# pull_request_target safety: permissions: read-all, and no user codes are executed
get-actual-misskey-js:
runs-on: ubuntu-latest
permissions:
Expand All @@ -68,6 +69,7 @@ jobs:
uses: actions/checkout@v4.1.1
with:
submodules: true
persist-credentials: false
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- name: Upload From Merged
Expand Down Expand Up @@ -131,3 +133,7 @@ jobs:
mode: delete
message: "Thank you!"
create_if_not_exists: false

- name: Make failure if changes are detected
if: steps.check-changes.outputs.changes == 'true'
run: exit 1
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- run: corepack enable
- run: pnpm i --frozen-lockfile
- name: Restore eslint cache
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.0
with:
path: ${{ env.eslint-cache-path }}
key: eslint-${{ env.eslint-cache-version }}-${{ matrix.workspace }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.ref_name }}-${{ github.sha }}
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/vrtl-docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and Push VRTL Misskey Docker Image

on:
push:
tags:
- 'v*-vrtl.*'

env:
DOCKER_REGISTRY_NAME: ghcr.io
DOCKER_IMAGE_NAME: anatawa12/vrtl-misskey

jobs:
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker hub
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY_NAME }}
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY_NAME }}/${{ env.DOCKER_IMAGE_NAME }}

- name: Build & Push
uses: docker/build-push-action@v2
env:
DOCKER_BUILDKIT: 1
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: ${{ env.DOCKER_REGISTRY_NAME }}/${{ env.DOCKER_IMAGE_NAME }}:latest
build-args: BUILDKIT_INLINE_CACHE=1
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## 2024.10.0

### Note
- セキュリティ向上のため、サーバー初期設定時に使用する初期パスワードを設定できるようになりました。今後Misskeyサーバーを新たに設置する際には、初回の起動前にコンフィグファイルの`setupPassword`をコメントアウトし、初期パスワードを設定することをおすすめします。(すでに初期設定を完了しているサーバーについては、この変更に伴い対応する必要はありません)
- ホスティングサービスを運営している場合は、コンフィグファイルを構築する際に`setupPassword`をランダムな値に設定し、ユーザーに通知するようにシステムを更新することをおすすめします。
- なお、初期パスワードが設定されていない場合でも初期設定を行うことが可能です(UI上で初期パスワードの入力欄を空欄にすると続行できます)。
- ユーザーデータを読み込む際の型が一部変更されました。
- `twoFactorEnabled`, `usePasswordLessLogin`, `securityKeys`: 自分とモデレーター以外のユーザーからは取得できなくなりました

### General
- Feat: サーバー初期設定時に初期パスワードを設定できるように
- Feat: 通報にモデレーションノートを残せるように
- Feat: 通報の解決種別を設定できるように
- Enhance: 通報の解決と転送を個別に行えるように
- Enhance: セキュリティ向上のため、サインイン時もCAPTCHAを求めるようになりました
- Enhance: 依存関係の更新
- Enhance: l10nの更新
- Enhance: Playの「人気」タブで10件以上表示可能に #14399
- Fix: 連合のホワイトリストが正常に登録されない問題を修正

### Client
- Enhance: デザインの調整
- Enhance: ログイン画面の認証フローを改善
- Fix: クライアント上での時間ベースの実績獲得動作が実績獲得後も発動していた問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/657)

### Server
- Enhance: セキュリティ向上のため、ログイン時にメール通知を行うように
- Enhance: 自分とモデレーター以外のユーザーから二要素認証関連のデータが取得できないように
- Enhance: 通報および通報解決時に送出されるSystemWebhookにユーザ情報を含めるように ( #14697 )
- Fix: `admin/abuse-user-reports`エンドポイントのスキーマが間違っていた問題を修正

## 2024.9.0

### General
Expand Down
128 changes: 128 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,131 @@
# Anatawa12's fork of Misskey

This is anatawa12's fork of Misskey.

This fork is used for several purposes:

- The repository for [vmimi-relay timeline] extension development. I'm the maintainer of the [vmimi-relay timeline].
- The repository for writing pull-requests to the vmimi relay users. I'm usually sending pull requests to the vmimi relay users after each updates.
- The repository for writing pull-requests to the upstream repository. I'm one of the contributors of the upstream repository.
- The repository for writing pull-requests to the [misskey.niri.la]. I'm one of the maintainers of the [misskey.niri.la].

This branch is the branch for releasing the Vmimi Relay Timeline extension.

## Vmimi Relay Timeline

The Vmimi Relay Timeline is additional timelines for Misskey servers who belong to the [Virtual Kemomimi Relay].
This extension adds two timelines: Vmimi Relay Timeline (VRTL) and Vmimi Social Timeline (VSTL).

ぶいみみリレータイムラインは[ぶいみみリレー][Virtual Kemomimi Relay]に参加しているサーバー向けのmisskeyの拡張タイムラインです。
この拡張はふたつのタイムラインを追加します: ぶいみみリレータイムライン (VRTL) とぶいみみソーシャルタイムライン (VSTL) です。

### Vmimi Relay Timeline (VRTL)

The Vmimi Relay Timeline (VRTL) is the timeline that shows the posts from the Virtual Kemomimi Relay users.
This timeline is designed to be similar to the Local Timeline,
but it shows the posts from the Virtual Kemomimi Relay users.

ぶいみみリレータイムライン (VRTL) はぶいみみリレーに参加しているユーザーの投稿を表示するタイムラインです。
このタイムラインはローカルタイムラインに似ていますが、ぶいみみリレーに参加しているユーザーの投稿を表示します。

### Vmimi Social Timeline (VSTL)

The Vmimi Social Timeline (VSTL) is the timeline that shows the posts from
the Virtual Kemomimi Relay users and the users you are following.
In other words, this timeline is the combination of the VRTL and the Home Timeline.
This timeline is designed to be similar to the Social Timeline,
but it shows the posts from the Virtual Kemomimi Relay users instead of the Local Timeline.

ぶいみみソーシャルタイムライン (VSTL) はぶいみみリレーに参加しているユーザーとフォローしているユーザーの投稿を表示するタイムラインです。
つまり、このタイムラインはVRTLとホームタイムラインの組み合わせです。
このタイムラインはソーシャルタイムラインに似ていますが、ローカルタイムラインの代わりにぶいみみリレーに参加しているユーザーの投稿を表示します。

### How to use the Vmimi Relay Timeline

First, this extension is designed for servers who joined the [Virtual Kemomimi Relay]
so you have to join the [Virtual Kemomimi Relay] to use this extension.

After that, you have two ways to use the Vmimi Relay Timeline:
- Use releases of the misskey docker image if you're using official docker image.
The image is designed to be a drop-in replacement of the official image.
The image name is [`ghcr.io/anatawa12/vrtl-misskey:latest`].
- Merge the extension branch to your fork and build the image by yourself.
You can merge the [`vmimi-relay-timeline/generic`] branch to your fork.
If you ask me, I'll create a pull request to your fork. Feel free to ask me.

はじめに、この拡張は[ぶいみみリレー][Virtual Kemomimi Relay]に参加しているサーバー向けに設計されているため、この拡張を使用するには[ぶいみみリレー][Virtual Kemomimi Relay]に参加する必要があります。

その後、ぶいみみリレータイムラインを使用する方法はふたつあります:
- 公式のdockerイメージを使用している場合は、VRTLのdockerイメージを使用してください。
のイメージは公式イメージの代わりとして使用できます。
イメージ名は [`ghcr.io/anatawa12/vrtl-misskey:latest`] です。
- このブランチをあなたのフォークにマージして、自分でイメージをビルドしてください。
[`vmimi-relay-timeline/generic`] ブランチをあなたのフォークにマージすることで、この拡張を使用できます。
必要であれば、あなたのフォークにプルリクエストを作成します。お気軽にお尋ねください。

### Notes for Third-party Client Developers

Here are the technical notes for third-party misskey client developers.

サードパーティ Misskey クライアント向けの技術的な情報です

#### Detecting Vmimi Relay Timeline

There is `vmimiRelayTimelineImplemented` property on `metadata` object of `nodeinfo`.
If it's true, your client can assume that the VRTL is implemented for the sever.

`nodeinfo``metadata`オブジェクトに`vmimiRelayTimelineImplemented`プロパティがあります。
この値が true であれば、VRTLがそのサーバーにて実装されてると考えて問題ありません

#### Endpoints and Channels of Vmimi Relay Timeline

The fetch note endpoint for VRTL and VSTL are `notes/vmimi-relay-timeline` and `notes/vmimi-relay-hybrid-timeline`,
and the channel name for them are `vmimiRelayTimeline` and `vmimiRelayHybridTimeline`.

Those endpoints and channels have almost same options as LTL / STL but they have one extra option specific to VRTL/VSTL.
The `withLocalOnly` flag (true by default) indicates if the timeline should include local only (non-federated) notes from server (local) timeline.

For more details, see `misskey-js`.

VRTLとVSTLのfetchエンドポイントはそれぞれ `notes/vmimi-relay-timeline``notes/vmimi-relay-hybrid-timeline`で、
チャンネルは `vmimiRelayTimeline``vmimiRelayHybridTimeline` です。

これらのエンドポイントとチャンネルは LTL/STL とほぼ同じオプションを持っていますが、 VRTL/VSTL に固有オプションが一つあります。
`withLocalOnly` (デフォルトtrue) はタイムラインにローカルのみ(連合なし)ノートがタイムラインに含まれるかどうかを示します。

### Branches related to Vmimi Relay Timeline

- [`vmimi-relay-timeline/generic`]:
The branch for the Vmimi Relay Timeline extension development.
All changes to the Vmimi Relay Timeline extension will be merged to this branch.
This branch should be based on the latest official release of Misskey.
This branch does not include any changes other than the Vmimi Relay Timeline extension itself.
- [`vmimi-relay-timeline/releases`]:
The branch for releasing the Vmimi Relay Timeline extension.
This branch includes the changes for `package.json` and changes to the repository link.
- `vmimi-relay-timeline/forks/nirila`, `vmimi-relay-timeline/forks/buiso` and other branches:
Those branches are the branches for sending pull requests to each fork-based server.
Those branches are not permanent; they will be deleted after each pull request is merged.

### How the Vmimi Relay Timeline works

The Vmimi Relay Timeline is implemented as a server-whitelisted timeline.

The Vmimi Relay provides the API endpoint to get the list of joined servers.
The Vmimi Relay Timeline extension fetches the list of joined servers from the Vmimi Relay
and filters the received / created notes by the list.
For implementation simplicity, the Vmimi Relay Timeline includes all public notes of the local server including
non-federated notes, but this behavior may change in the future.

[Virtual Kemomimi Relay]: https://relay.virtualkemomimi.net/
[misskey.niri.la]: https://github.com/niri-la/misskey.niri.la/
[vmimi-relay timeline]: #vmimi-relay-timeline
[`vmimi-relay-timeline/generic`]: https://github.com/anatawa12/misskey/tree/vmimi-relay-timeline/generic
[`vmimi-relay-timeline/releases`]: https://github.com/anatawa12/misskey/tree/vmimi-relay-timeline/releases
[`ghcr.io/anatawa12/vrtl-misskey:latest`]: https://github.com/anatawa12/misskey/pkgs/container/vrtl-misskey

---

<div align="center">
<a href="https://misskey-hub.net">
<img src="./assets/title_float.svg" alt="Misskey logo" style="border-radius:50%" width="300"/>
Expand Down
17 changes: 12 additions & 5 deletions cypress/e2e/basic.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('Before setup instance', () => {

cy.intercept('POST', '/api/admin/accounts/create').as('signup');

cy.get('[data-cy-admin-initial-password] input').type('example_password_please_change_this_or_you_will_get_hacked');
cy.get('[data-cy-admin-username] input').type('admin');
cy.get('[data-cy-admin-password] input').type('admin1234');
cy.get('[data-cy-admin-ok]').click();
Expand Down Expand Up @@ -119,11 +120,16 @@ describe('After user signup', () => {
it('signin', () => {
cy.visitHome();

cy.intercept('POST', '/api/signin').as('signin');
cy.intercept('POST', '/api/signin-flow').as('signin');

cy.get('[data-cy-signin]').click();
cy.get('[data-cy-signin-username] input').type('alice');
// Enterキーでサインインできるかの確認も兼ねる

cy.get('[data-cy-signin-page-input]').should('be.visible', { timeout: 1000 });
// Enterキーで続行できるかの確認も兼ねる
cy.get('[data-cy-signin-username] input').type('alice{enter}');

cy.get('[data-cy-signin-page-password]').should('be.visible', { timeout: 10000 });
// Enterキーで続行できるかの確認も兼ねる
cy.get('[data-cy-signin-password] input').type('alice1234{enter}');

cy.wait('@signin');
Expand All @@ -138,8 +144,9 @@ describe('After user signup', () => {
cy.visitHome();

cy.get('[data-cy-signin]').click();
cy.get('[data-cy-signin-username] input').type('alice');
cy.get('[data-cy-signin-password] input').type('alice1234{enter}');

cy.get('[data-cy-signin-page-input]').should('be.visible', { timeout: 1000 });
cy.get('[data-cy-signin-username] input').type('alice{enter}');

// TODO: cypressにブラウザの言語指定できる機能が実装され次第英語のみテストするようにする
cy.contains(/アカウントが凍結されています|This account has been suspended due to/gi);
Expand Down
7 changes: 5 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,19 @@ Cypress.Commands.add('registerUser', (username, password, isAdmin = false) => {
cy.request('POST', route, {
username: username,
password: password,
...(isAdmin ? { setupPassword: 'example_password_please_change_this_or_you_will_get_hacked' } : {}),
}).its('body').as(username);
});

Cypress.Commands.add('login', (username, password) => {
cy.visitHome();

cy.intercept('POST', '/api/signin').as('signin');
cy.intercept('POST', '/api/signin-flow').as('signin');

cy.get('[data-cy-signin]').click();
cy.get('[data-cy-signin-username] input').type(username);
cy.get('[data-cy-signin-page-input]').should('be.visible', { timeout: 1000 });
cy.get('[data-cy-signin-username] input').type(`${username}{enter}`);
cy.get('[data-cy-signin-page-password]').should('be.visible', { timeout: 10000 });
cy.get('[data-cy-signin-password] input').type(`${password}{enter}`);

cy.wait('@signin').as('signedIn');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import { action } from '@storybook/addon-actions';
import { StoryObj } from '@storybook/vue3';
import { HttpResponse, http } from 'msw';
import { abuseUserReport } from '../../.storybook/fakes.js';
import { commonHandlers } from '../../.storybook/mocks.js';
import { abuseUserReport } from '../packages/frontend/.storybook/fakes.js';
import { commonHandlers } from '../packages/frontend/.storybook/mocks.js';
import MkAbuseReport from './MkAbuseReport.vue';
export const Default = {
render(args) {
Expand Down
Loading

0 comments on commit e438b03

Please sign in to comment.