Skip to content
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

nodeinfoでyojo-artを名乗る #565

Merged
merged 26 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG_YOJO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.2.0

### General
- Change: nodeinfoでyojo-artを名乗る [#565](https://github.com/yojo-art/cherrypick/pull/565)
- Fix: ノートを編集する時に検索許可範囲を記憶する [#558](https://github.com/yojo-art/cherrypick/pull/558)

### Client
Expand Down
86 changes: 48 additions & 38 deletions locales/index.d.ts

Large diffs are not rendered by default.

77 changes: 40 additions & 37 deletions locales/ja-JP.yml

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "cherrypick",
"version": "4.13.0-yojo1.2.0",
"name": "yojo-art",
"version": "1.2.0",
"basedMisskeyVersion": "2024.10.1",
"basedCherrypickVersion": "4.13.0",
"codename": "nasubi",
"repository": {
"type": "git",
"url": "https://github.com/kokonect-link/cherrypick.git"
"url": "https://github.com/yojo-art/cherrypick.git"
},
"packageManager": "pnpm@9.6.0",
"workspaces": [
Expand Down
23 changes: 12 additions & 11 deletions packages/backend/src/boot/master.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,27 @@ const themeColor = chalk.hex('#ffa9c3');

function greet() {
if (!envOption.quiet) {
//#region CherryPick logo
//#region yojo-art logo
const v = `v${meta.version}`;
console.log(chalk.hex('#ffa9c3').bold(' _________ .__ ') + chalk.hex('#95e3e8').bold('__________.__ __ '));
console.log(chalk.hex('#ffa9c3').bold(' \\_ ___ \\| |__ __________________ ___.__.') + chalk.hex('#95e3e8').bold('\\______ \\__| ____ | | __'));
console.log(chalk.hex('#ffa9c3').bold(' / \\ \\/| | \\_/ __ \\_ __ \\_ __ < | |') + chalk.hex('#95e3e8').bold(' | ___/ |/ ___\\| |/ /'));
console.log(chalk.hex('#ffa9c3').bold(' \\ \\___| Y \\ ___/| | \\/| | \\/\\___ |') + chalk.hex('#95e3e8').bold(' | | | \\ \\___| < '));
console.log(chalk.hex('#ffa9c3').bold(' \\______ /___| /\\___ >__| |__| / ____|') + chalk.hex('#95e3e8').bold(' |____| |__|\\___ >__|_ \\'));
console.log(chalk.hex('#ffa9c3').bold(' \\/ \\/ \\/ \\/ ') + chalk.hex('#95e3e8').bold(' \\/ \\/'));
console.log(chalk.hex('#ffa9c3').bold(' _ ') + chalk.hex('#95e3e8').bold(' _ '));
console.log(chalk.hex('#ffa9c3').bold(' _ _ ___ (_) ___ ') + chalk.hex('#95e3e8').bold(' __ _ _ __| |_ '));
console.log(chalk.hex('#ffa9c3').bold('| | | |/ _ \\| |/ _ \\ ') + chalk.hex('#95e3e8').bold('_____ / _` | \'__| __|'));
console.log(chalk.hex('#ffa9c3').bold('| |_| | (_) | | (_) |') + chalk.hex('#95e3e8').bold('_____| (_| | | | |_ '));
console.log(chalk.hex('#ffa9c3').bold(' \\__, |\\___// |\\___/ ') + chalk.hex('#95e3e8').bold(' \\__,_|_| \\__|'));
console.log(chalk.hex('#ffa9c3').bold(' |___/ |__/ ') + chalk.hex('#95e3e8').bold(' '));
//#endregion

console.log(chalk.hex('#ffa9c3').bold(' Cherry') + chalk.hex('#95e3e8').bold('Pick') + (' is an open-source decentralized microblogging platform based from') + (chalk.hex('#9ec23f').bold(' Misskey') + ('.')));
console.log(chalk.hex('#ffbb00')(' If you like ') + chalk.hex('#ffa9c3').bold('Cherry') + chalk.hex('#95e3e8').bold('Pick') + chalk.hex('#ffbb00')(', please donate to support development. https://www.patreon.com/noridev & https://www.paypal.me/noridev & https://toss.me/noridev'));
console.log(chalk.hex('#ffa9c3').bold(' yojo') + chalk.hex('#98e2cf').bold('-') + chalk.hex('#95e3e8').bold('art') + (' is an open-source decentralized microblogging platform based from') + (chalk.hex('#9ec23f').bold(' Misskey') + (' and') + chalk.hex('#ffa9c3').bold(' Cherry') + chalk.hex('#95e3e8').bold('Pick') + '.'));
console.log(chalk.hex('#ffbb00')(' If you like ') + chalk.hex('#ffa9c3').bold(' yojo') + chalk.hex('#98e2cf').bold('-') + chalk.hex('#95e3e8').bold('art') + chalk.hex('#ffbb00')(', please donate to support development. https://yojo-art.fanbox.cc/'));
// console.log(chalk.hex('#ffa9c3').bold(' KOKO') + chalk.hex('#95e3e8').bold('NECT') + chalk.hex('#ffa9c3')(' with') + chalk.hex('#95e3e8').bold(' NoriDev.'));

console.log('');
console.log(chalkTemplate`--- ${os.hostname()} {gray (PID: ${process.pid.toString()})} ---`);
}

bootLogger.info('Welcome to CherryPick!');
bootLogger.info(`CherryPick v${meta.version}`, null, true);
bootLogger.info('Welcome to yojo-art!');
bootLogger.info(`yojo-art v${meta.version}`, null, true);
bootLogger.info(`Based on Cherrypick v${meta.basedCherrypickVersion}`, null, true);
bootLogger.info(`Based on Misskey v${meta.basedMisskeyVersion}`, null, true);
}

Expand Down
3 changes: 3 additions & 0 deletions packages/backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export type Config = {

version: string;
basedMisskeyVersion: string;
basedCherrypickVersion: string;
publishTarballInsteadOfProvideRepositoryUrl: boolean;
setupPassword: string | undefined;
host: string;
Expand Down Expand Up @@ -261,6 +262,7 @@ export function loadConfig(): Config {
const url = tryCreateUrl(config.url ?? process.env.CHERRYPICK_URL ?? '');
const version = meta.version;
const basedMisskeyVersion = meta.basedMisskeyVersion;
const basedCherrypickVersion = meta.basedCherrypickVersion;
const host = url.host;
const hostname = url.hostname;
const scheme = url.protocol.replace(/:$/, '');
Expand All @@ -284,6 +286,7 @@ export function loadConfig(): Config {
return {
version,
basedMisskeyVersion,
basedCherrypickVersion,
publishTarballInsteadOfProvideRepositoryUrl: !!config.publishTarballInsteadOfProvideRepositoryUrl,
setupPassword: config.setupPassword,
url: url.origin,
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/core/FetchInstanceMetadataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type NodeInfo = {
name?: unknown;
version?: unknown;
basedMisskeyVersion?: unknown;
basedCherrypickVersion?: unknown;
};
metadata?: {
name?: unknown;
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/core/entities/MetaEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class MetaEntityService {

version: this.config.version,
basedMisskeyVersion: this.config.basedMisskeyVersion,
basedCherrypickVersion: this.config.basedCherrypickVersion,
providesTarball: this.config.publishTarballInsteadOfProvideRepositoryUrl,

name: instance.name,
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/models/Meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,14 @@ export class MiMeta {

@Column('varchar', {
length: 1024,
default: 'https://github.com/kokonect-link/cherrypick',
default: 'https://github.com/yojo-art/cherrypick',
nullable: true,
})
public repositoryUrl: string | null;

@Column('varchar', {
length: 1024,
default: 'https://github.com/kokonect-link/cherrypick/issues/new',
default: 'https://github.com/yojo-art/cherrypick/issues/new',
nullable: true,
})
public feedbackUrl: string | null;
Expand Down
8 changes: 6 additions & 2 deletions packages/backend/src/models/json-schema/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export const packedMetaLiteSchema = {
type: 'string',
optional: false, nullable: false,
},
basedCherrypickVersion: {
type: 'string',
optional: false, nullable: false,
},
providesTarball: {
type: 'boolean',
optional: false, nullable: false,
Expand Down Expand Up @@ -60,12 +64,12 @@ export const packedMetaLiteSchema = {
repositoryUrl: {
type: 'string',
optional: false, nullable: true,
default: 'https://github.com/kokonect-link/cherrypick',
default: 'https://github.com/yojo-art/cherrypick',
},
feedbackUrl: {
type: 'string',
optional: false, nullable: true,
default: 'https://github.com/kokonect-link/cherrypick/issues/new',
default: 'https://github.com/yojo-art/cherrypick/issues/new',
},
statusUrl: {
type: 'string',
Expand Down
3 changes: 2 additions & 1 deletion packages/backend/src/server/NodeinfoServerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ export class NodeinfoServerService {
* ソフトウェアの名前を変更すると、一部の独自機能が使用できなくなったり、CherryPickとして認識されないなどの不利益が発生する場合があります。
* フォーク開発者はこの点に注意して修正を行ってください。
*/
name: 'cherrypick',
name: 'yojo-art',
version: this.config.version,
basedMisskeyVersion: this.config.basedMisskeyVersion,
basedCherrypickVersion: this.config.basedCherrypickVersion,
homepage: nodeinfo_homepage,
repository: meta.repositoryUrl,
},
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/server/api/endpoints/admin/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
maintainerEmail: instance.maintainerEmail,
version: this.config.version,
basedMisskeyVersion: this.config.basedMisskeyVersion,
basedCherrypickVersion: this.config.basedCherrypickVersion,
name: instance.name,
shortName: instance.shortName,
uri: this.config.url,
Expand Down
8 changes: 4 additions & 4 deletions packages/backend/src/server/api/openapi/gen-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) {
openapi: '3.1.0',

info: {
version: `${config.version} (${config.basedMisskeyVersion})`,
title: 'CherryPick API',
version: `${config.version} (${config.basedCherrypickVersion}) (${config.basedMisskeyVersion})`,
title: 'yojo-art API',
},

externalDocs: {
description: 'Repository',
url: 'https://github.com/kokonect-link/cherrypick',
url: 'https://github.com/yojo-art/cherrypick',
},

servers: [{
Expand Down Expand Up @@ -97,7 +97,7 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) {
description: desc,
externalDocs: {
description: 'Source code',
url: `https://github.com/kokonect-link/cherrypick/blob/develop/packages/backend/src/server/api/endpoints/${endpoint.name}.ts`,
url: `https://github.com/yojo-art/cherrypick/blob/develop/packages/backend/src/server/api/endpoints/${endpoint.name}.ts`,
},
...(endpoint.meta.tags ? {
tags: [endpoint.meta.tags[0]],
Expand Down
4 changes: 4 additions & 0 deletions packages/backend/src/server/web/ClientServerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export class ClientServerService {
defaultContext: {
version: this.config.version,
basedMisskeyVersion: this.config.basedMisskeyVersion,
basedCherrypickVersion: this.config.basedCherrypickVersion,
config: this.config,
},
});
Expand Down Expand Up @@ -876,6 +877,7 @@ export class ClientServerService {
return await reply.view('info-card', {
version: this.config.version,
basedMisskeyVersion: this.config.basedMisskeyVersion,
basedCherrypickVersion: this.config.basedCherrypickVersion,
host: this.config.host,
meta: this.meta,
originalUsersCount: await this.usersRepository.countBy({ host: IsNull() }),
Expand All @@ -888,13 +890,15 @@ export class ClientServerService {
return await reply.view('bios', {
version: this.config.version,
basedMisskeyVersion: this.config.basedMisskeyVersion,
basedCherrypickVersion: this.config.basedCherrypickVersion,
});
});

fastify.get('/cli', async (request, reply) => {
return await reply.view('cli', {
version: this.config.version,
basedMisskeyVersion: this.config.basedMisskeyVersion,
basedCherrypickVersion: this.config.basedCherrypickVersion,
});
});

Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/server/web/boot.embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
const meta = await metaRes.json();
const v = meta.version;
const basedMisskeyVersion = meta.basedMisskeyVersion;
const basedCherrypickVersion = meta.basedCherrypickVersion;
if (v == null) {
renderError('META_FETCH_V');
return;
Expand All @@ -71,6 +72,10 @@
renderError('META_FETCH_BASEDMISSKEY_V');
return;
}
if (basedCherrypickVersion == null) {
renderError('META_FETCH_BASEDCHERRYPICK_V');
return;
}

// for https://github.com/misskey-dev/misskey/issues/10202
if (lang == null || lang.toString == null || lang.toString() === 'null') {
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/server/web/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
const meta = await metaRes.json();
const v = meta.version;
const basedMisskeyVersion = meta.basedMisskeyVersion;
const basedCherrypickVersion = meta.basedCherrypickVersion;
if (v == null) {
renderError('META_FETCH_V');
return;
Expand All @@ -61,6 +62,10 @@
renderError('META_FETCH_BASEDMISSKEY_V');
return;
}
if (basedCherrypickVersion == null) {
renderError('META_FETCH_BASEDCHERRYPICK_V');
return;
}

// for https://github.com/misskey-dev/misskey/issues/10202
if (lang == null || lang.toString == null || lang.toString() === 'null') {
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/server/web/views/base-embed.pug
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ html(class='embed')
script.
var VERSION = "#{version}";
var BASED_MISSKEY_VERSION = "#{basedMisskeyVersion}";
var BASED_CHERRYPICK_VERSION = "#{basedCherrypickVersion}";
var CLIENT_ENTRY = "#{entry.file}";

script(type='application/json' id='cherrypick_meta' data-generated-at=now)
Expand Down
21 changes: 11 additions & 10 deletions packages/backend/src/server/web/views/base.pug
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ doctype html

//
-
_________ .__ __________.__ __
\_ ___ \| |__ __________________ ___.__.\______ \__| ____ | | __
/ \ \/| | \_/ __ \_ __ \_ __ < | | | ___/ |/ ___\| |/ /
\ \___| Y \ ___/| | \/| | \/\___ | | | | \ \___| <
\______ /___| /\___ >__| |__| / ____| |____| |__|\___ >__|_ \
\/ \/ \/ \/ \/ \/
Thank you for using CherryPick!
_ _
_ _ ___ (_) ___ __ _ _ __| |_
| | | |/ _ \| |/ _ \ _____ / _` | '__| __|
| |_| | (_) | | (_) |_____| (_| | | | |_
\__, |\___// |\___/ \__,_|_| \__|
|___/ |__/
Thank you for using yojo-art!
If you are reading this message... how about joining the development?
https://github.com/kokonect-link/cherrypick
https://github.com/yojo-art/cherrypick

html

head
meta(charset='utf-8')
meta(name='application-name' content='CherryPick')
meta(name='application-name' content='yojo-art')
meta(name='referrer' content='origin')
meta(name='theme-color' content= themeColor || '#ffbcdc')
meta(name='theme-color-orig' content= themeColor || '#ffbcdc')
meta(property='og:site_name' content= instanceName || 'CherryPick')
meta(property='og:site_name' content= instanceName || 'yojo-art')
meta(property='instance_url' content= instanceUrl)
meta(name='viewport' content='width=device-width, initial-scale=1')
meta(name='format-detection' content='telephone=no,date=no,address=no,email=no,url=no')
Expand Down Expand Up @@ -69,6 +69,7 @@ html
script.
var VERSION = "#{version}";
var BASED_MISSKEY_VERSION = "#{basedMisskeyVersion}";
var BASED_CHERRYPICK_VERSION = "#{basedCherrypickVersion}";
var CLIENT_ENTRY = "#{entry.file}";

script(type='application/json' id='cherrypick_meta' data-generated-at=now)
Expand Down
20 changes: 10 additions & 10 deletions packages/backend/src/server/web/views/error.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ doctype html

//
-
_________ .__ __________.__ __
\_ ___ \| |__ __________________ ___.__.\______ \__| ____ | | __
/ \ \/| | \_/ __ \_ __ \_ __ < | | | ___/ |/ ___\| |/ /
\ \___| Y \ ___/| | \/| | \/\___ | | | | \ \___| <
\______ /___| /\___ >__| |__| / ____| |____| |__|\___ >__|_ \
\/ \/ \/ \/ \/ \/
Thank you for using CherryPick!
_ _
_ _ ___ (_) ___ __ _ _ __| |_
| | | |/ _ \| |/ _ \ _____ / _` | '__| __|
| |_| | (_) | | (_) |_____| (_| | | | |_
\__, |\___// |\___/ \__,_|_| \__|
|___/ |__/
Thank you for using yojo-art!
If you are reading this message... how about joining the development?
https://github.com/kokonect-link/cherrypick
https://github.com/yojo-art/cherrypick


html

head
meta(charset='utf-8')
meta(name='viewport' content='width=device-width, initial-scale=1')
meta(name='application-name' content='CherryPick')
meta(name='application-name' content='yojo-art')
meta(name='referrer' content='origin')

title
block title
= 'An error has occurred... | CherryPick'
= 'An error has occurred... | yojo-art'

style
include ../error.css
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/test/e2e/nodeinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('nodeinfo', () => {
assert.strictEqual(res.headers.get('Access-Control-Allow-Origin'), '*');

const nodeInfo = await res.json() as any;
assert.strictEqual(nodeInfo.software.name, 'cherrypick');
assert.strictEqual(nodeInfo.software.name, 'yojo-art');
});

test('nodeinfo 2.0', async () => {
Expand All @@ -24,6 +24,6 @@ describe('nodeinfo', () => {
assert.strictEqual(res.headers.get('Access-Control-Allow-Origin'), '*');

const nodeInfo = await res.json() as any;
assert.strictEqual(nodeInfo.software.name, 'cherrypick');
assert.strictEqual(nodeInfo.software.name, 'yojo-art');
});
});
2 changes: 1 addition & 1 deletion packages/cherrypick-js/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Issueを作成する前に、以下をご確認ください:
- 重複を防ぐため、既に同様の内容のIssueが作成されていないか検索してから新しいIssueを作ってください。
- Issueを質問に使わないでください。
- Issueは、要望、提案、問題の報告にのみ使用してください。
- 質問は、[GitHub Discussions](https://github.com/kokonect-link/cherrypick/discussions)や[Discord](https://discord.gg/V8qghB28Aj)でお願いします。
- 質問は、[GitHub Discussions](https://github.com/yojo-art/cherrypick/discussions)でお願いします。

## PRの作成
PRを作成する前に、以下をご確認ください:
Expand Down
2 changes: 1 addition & 1 deletion packages/cherrypick-js/docs/CONTRIBUTING.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Before creating an issue, please check the following:
- To avoid duplication, please search for similar issues before creating a new issue.
- Do not use Issues as a question.
- Issues should only be used to feature requests, suggestions, and report problems.
- Please ask questions in [GitHub Discussions](https://github.com/kokonect-link/cherrypick/discussions) or [Discord](https://discord.gg/V8qghB28Aj).
- Please ask questions in [GitHub Discussions](https://github.com/yojo-art/cherrypick/discussions).

## Creating a PR
Thank you for your PR! Before creating a PR, please check the following:
Expand Down
Loading
Loading