Compare commits

..

No commits in common. "08e3706df7dbbbd26cddb06409f9268c1b9243fa" and "eb05c2e6195192a0e9d424d24c244309b82ab72f" have entirely different histories.

5 changed files with 9 additions and 44 deletions

View file

@ -1,10 +1,6 @@
## 2024.9.1 (eGirlskey)
- Impersonate `misskey` upstream in nodeinfo to fix issues with client apps
- Fix two-factor-auth login with `secureApiMode: true` by returning a stub user to unauthorized clients.
## 2024.9.0 (eGirlskey)
## 2024.9.0
- First official eGirlskey release not a part of Sharkey
- Based on Sharkey 2024.8.1, which is based on Misskey 2024.8.0. See [sharkey patch notes](https://activitypub.software/TransFem-org/Sharkey/-/releases/2024.8.1) for more information
- Based on Sharkey 2024.8.1, which is based on Misskey 2024.8.0.
## 2024.8.0

View file

@ -1,6 +1,6 @@
{
"name": "egirlskey",
"version": "2024.9.1",
"version": "2024.9.0",
"codename": "boobdog",
"repository": {
"type": "git",

View file

@ -401,7 +401,7 @@ export class UserEntityService implements OnModuleInit {
return `${this.config.url}/users/${userId}`;
}
public async pack<S extends 'MeDetailed' | 'UserDetailedNotMe' | 'UserDetailed' | 'UserLite' | 'UserLogin' = 'UserLite'>(
public async pack<S extends 'MeDetailed' | 'UserDetailedNotMe' | 'UserDetailed' | 'UserLite' = 'UserLite'>(
src: MiUser['id'] | MiUser,
me?: { id: MiUser['id']; } | null | undefined,
options?: {
@ -510,30 +510,7 @@ export class UserEntityService implements OnModuleInit {
const checkHost = user.host == null ? this.config.host : user.host;
const notificationsInfo = isMe && isDetailed ? await this.getNotificationsInfo(user.id) : null;
const packed = opts.schema === 'UserLogin' ? {
id: user.id,
name: user.username,
username: user.username,
host: user.host,
avatarUrl: this.getIdenticonUrl(user),
noindex: user.noindex,
instance: user.host ? this.federatedInstanceService.federatedInstanceCache.fetch(user.host).then(instance => instance ? {
name: instance.name,
softwareName: instance.softwareName,
softwareVersion: instance.softwareVersion,
iconUrl: instance.iconUrl,
faviconUrl: instance.faviconUrl,
themeColor: instance.themeColor,
} : undefined) : undefined,
...(isDetailed ? {
twoFactorEnabled: profile!.twoFactorEnabled,
usePasswordLessLogin: profile!.usePasswordLessLogin,
securityKeys: profile!.twoFactorEnabled
? this.userSecurityKeysRepository.countBy({ userId: user.id }).then(result => result >= 1)
: false,
} : {}),
} : {
const packed = {
id: user.id,
name: user.name,
username: user.username,

View file

@ -76,10 +76,8 @@ export class NodeinfoServerService {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const document: any = {
software: {
//name: 'egirlskey',
//version: this.config.version,
name: 'misskey', // impersonate misskey to maintain compatibility with client apps
version: `2024.8.0+egirlskey.${this.config.version}`,
name: 'egirlskey',
version: this.config.version,
homepage: nodeinfo_homepage,
repository: meta.repositoryUrl,
},

View file

@ -16,13 +16,12 @@ import { RoleService } from '@/core/RoleService.js';
import { ApiError } from '../../error.js';
import { ApiLoggerService } from '../../ApiLoggerService.js';
import type { FindOptionsWhere } from 'typeorm';
import type { Config } from '@/config.js';
export const meta = {
tags: ['users'],
requireCredential: false,
requireCredentialSecureMode: false, // Handle secure mode below
requireCredentialSecureMode: true,
description: 'Show the properties of a user.',
@ -84,9 +83,6 @@ export const paramDef = {
@Injectable()
export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-disable-line import/no-default-export
constructor(
@Inject(DI.config)
private config: Config,
@Inject(DI.usersRepository)
private usersRepository: UsersRepository,
@ -152,10 +148,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
}
const allowRequest = me != null || !this.config.secureApiMode;
return await this.userEntityService.pack(user, me, {
schema: allowRequest ? 'UserDetailed' : 'UserLogin',
schema: 'UserDetailed',
});
}
});