Merge branch 'develop'

This commit is contained in:
syuilo 2019-04-16 01:24:00 +09:00
commit c6cef0162d
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
10 changed files with 29 additions and 11 deletions

View File

@ -5,6 +5,11 @@ If you encounter any problems with updating, please try the following:
1. `npm run clean` or `npm run cleanall` 1. `npm run clean` or `npm run cleanall`
2. Retry update (Don't forget `npm i`) 2. Retry update (Don't forget `npm i`)
11.1.3 (2019/04/16)
-------------------
### Fixes
* アプリからAPIにリクエストするときにランダムなユーザーがリクエストしたことになる問題を修正
11.1.2 (2019/04/15) 11.1.2 (2019/04/15)
------------------- -------------------
### Fixes ### Fixes

View File

@ -57,7 +57,13 @@ Build misskey with the following:
`docker-compose build` `docker-compose build`
*5.* That is it. *5.* Init DB
----------------------------------------------------------------
``` shell
docker-compose run --rm web npm run init
```
*6.* That is it.
---------------------------------------------------------------- ----------------------------------------------------------------
Well done! Now you have an environment to run Misskey. Well done! Now you have an environment to run Misskey.

View File

@ -57,7 +57,13 @@ cp docker_example.env docker.env
`docker-compose build` `docker-compose build`
*5.* 以上です! *5.* データベースを初期化
----------------------------------------------------------------
``` shell
docker-compose run --rm web npm run init
```
*6.* 以上です!
---------------------------------------------------------------- ----------------------------------------------------------------
お疲れ様でした。これでMisskeyを動かす準備は整いました。 お疲れ様でした。これでMisskeyを動かす準備は整いました。

View File

@ -1,7 +1,7 @@
{ {
"name": "misskey", "name": "misskey",
"author": "syuilo <i@syuilo.com>", "author": "syuilo <i@syuilo.com>",
"version": "11.1.2", "version": "11.1.3",
"codename": "daybreak", "codename": "daybreak",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -1,4 +1,4 @@
import { Entity, PrimaryColumn, Index, Column, ManyToOne, JoinColumn, RelationId } from 'typeorm'; import { Entity, PrimaryColumn, Index, Column, ManyToOne, JoinColumn } from 'typeorm';
import { User } from './user'; import { User } from './user';
import { App } from './app'; import { App } from './app';
import { id } from '../id'; import { id } from '../id';
@ -25,7 +25,8 @@ export class AccessToken {
}) })
public hash: string; public hash: string;
@RelationId((self: AccessToken) => self.user) @Index()
@Column(id())
public userId: User['id']; public userId: User['id'];
@ManyToOne(type => User, { @ManyToOne(type => User, {

View File

@ -31,7 +31,9 @@ export default async (token: string): Promise<[User | null | undefined, App | nu
.findOne(accessToken.appId); .findOne(accessToken.appId);
const user = await Users const user = await Users
.findOne(accessToken.userId); .findOne({
id: accessToken.userId // findOne(accessToken.userId) のように書かないのは後方互換性のため
});
return [user, app]; return [user, app];
} }

View File

@ -1,3 +1,3 @@
import rndstr from 'rndstr'; import rndstr from 'rndstr';
export default () => `0${rndstr('a-zA-Z0-9', 15)}`; export default () => rndstr('a-zA-Z0-9', 16);

View File

@ -1 +1 @@
export default (token: string) => token.startsWith('0'); export default (token: string) => token.length === 16;

View File

@ -39,7 +39,7 @@ export default define(meta, async (ps, user) => {
} }
// Generate access token // Generate access token
const accessToken = '1' + rndstr('a-zA-Z0-9', 15); const accessToken = rndstr('a-zA-Z0-9', 32);
// Fetch exist access token // Fetch exist access token
const exist = await AccessTokens.findOne({ const exist = await AccessTokens.findOne({

View File

@ -238,8 +238,6 @@ export default define(meta, async (ps, user, app) => {
userId: user.id userId: user.id
}) })
))).filter(file => file != null) as DriveFile[]; ))).filter(file => file != null) as DriveFile[];
files = files;
} }
let renote: Note | undefined; let renote: Note | undefined;