kopia lustrzana https://github.com/cloudflare/wildebeest
Pleroma-compatible version string
Refs https://github.com/cloudflare/wildebeest/pull/70pull/119/head
rodzic
c559bde6f7
commit
efbeaf7dd4
|
@ -45,6 +45,7 @@ describe('Mastodon APIs', () => {
|
||||||
assert.equal(data.title, 'a')
|
assert.equal(data.title, 'a')
|
||||||
assert.equal(data.email, 'b')
|
assert.equal(data.email, 'b')
|
||||||
assert.equal(data.description, 'c')
|
assert.equal(data.description, 'c')
|
||||||
|
assert(data.version.includes('Wildebeest'))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -82,6 +83,7 @@ describe('Mastodon APIs', () => {
|
||||||
assert.equal(data.title, 'a')
|
assert.equal(data.title, 'a')
|
||||||
assert.equal(data.contact.email, 'b')
|
assert.equal(data.contact.email, 'b')
|
||||||
assert.equal(data.description, 'c')
|
assert.equal(data.description, 'c')
|
||||||
|
assert(data.version.includes('Wildebeest'))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
import * as packagejson from '../package.json'
|
||||||
|
|
||||||
|
// https://github.com/mastodon/mastodon/blob/main/CHANGELOG.md
|
||||||
|
const MASTODON_API_VERSION = '4.0.2'
|
||||||
|
|
||||||
|
const WILDEBEEST_VERSION = packagejson.version
|
||||||
|
|
||||||
|
export function getVersion(): string {
|
||||||
|
return `${MASTODON_API_VERSION} (compatible; Wildebeest ${WILDEBEEST_VERSION})`
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
import type { Env } from 'wildebeest/backend/src/types/env'
|
import type { Env } from 'wildebeest/backend/src/types/env'
|
||||||
import { DEFAULT_THUMBNAIL } from 'wildebeest/backend/src/config'
|
import { DEFAULT_THUMBNAIL } from 'wildebeest/backend/src/config'
|
||||||
|
import { getVersion } from 'wildebeest/config/versions'
|
||||||
const INSTANCE_VERSION = '4.0.2'
|
|
||||||
|
|
||||||
export const onRequest: PagesFunction<Env, any> = async ({ env, request }) => {
|
export const onRequest: PagesFunction<Env, any> = async ({ env, request }) => {
|
||||||
const domain = new URL(request.url).hostname
|
const domain = new URL(request.url).hostname
|
||||||
|
@ -24,7 +23,7 @@ export async function handleRequest(domain: string, env: Env) {
|
||||||
// The documentation is incorrect and registrations is a boolean.
|
// The documentation is incorrect and registrations is a boolean.
|
||||||
res.registrations = false
|
res.registrations = false
|
||||||
|
|
||||||
res.version = INSTANCE_VERSION
|
res.version = getVersion()
|
||||||
res.rules = []
|
res.rules = []
|
||||||
res.uri = domain
|
res.uri = domain
|
||||||
res.title = env.INSTANCE_TITLE
|
res.title = env.INSTANCE_TITLE
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import type { Env } from 'wildebeest/backend/src/types/env'
|
import type { Env } from 'wildebeest/backend/src/types/env'
|
||||||
import { DEFAULT_THUMBNAIL } from 'wildebeest/backend/src/config'
|
import { DEFAULT_THUMBNAIL } from 'wildebeest/backend/src/config'
|
||||||
import type { InstanceConfigV2 } from 'wildebeest/backend/src/types/configs'
|
import type { InstanceConfigV2 } from 'wildebeest/backend/src/types/configs'
|
||||||
|
import { getVersion } from 'wildebeest/config/versions'
|
||||||
const INSTANCE_VERSION = '4.0.2'
|
|
||||||
|
|
||||||
export const onRequest: PagesFunction<Env, any> = async ({ env, request }) => {
|
export const onRequest: PagesFunction<Env, any> = async ({ env, request }) => {
|
||||||
const domain = new URL(request.url).hostname
|
const domain = new URL(request.url).hostname
|
||||||
|
@ -19,7 +18,7 @@ export async function handleRequest(domain: string, db: D1Database, env: Env) {
|
||||||
const res: InstanceConfigV2 = {
|
const res: InstanceConfigV2 = {
|
||||||
domain,
|
domain,
|
||||||
title: env.INSTANCE_TITLE,
|
title: env.INSTANCE_TITLE,
|
||||||
version: INSTANCE_VERSION,
|
version: getVersion(),
|
||||||
source_url: 'https://github.com/cloudflare/wildebeest',
|
source_url: 'https://github.com/cloudflare/wildebeest',
|
||||||
description: env.INSTANCE_DESCR,
|
description: env.INSTANCE_DESCR,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
export default {
|
export default {
|
||||||
preset: 'ts-jest',
|
preset: 'ts-jest',
|
||||||
verbose: true,
|
verbose: true,
|
||||||
testMatch: ["<rootDir>/(backend|consumer)/test/**/(*.)+(spec|test).[jt]s?(x)"],
|
testMatch: ['<rootDir>/(backend|consumer)/test/**/(*.)+(spec|test).[jt]s?(x)'],
|
||||||
testTimeout: 30000,
|
testTimeout: 30000,
|
||||||
testEnvironment: 'miniflare',
|
testEnvironment: 'miniflare',
|
||||||
// Configuration is automatically loaded from `.env`, `package.json` and
|
// Configuration is automatically loaded from `.env`, `package.json` and
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "wildebeest",
|
"name": "wildebeest",
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "Sven Sauleau <sven@cloudflare.com>",
|
"author": "Sven Sauleau <sven@cloudflare.com>",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
Ładowanie…
Reference in New Issue