Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
12f63db62e | |||
08e1c87fa6 | |||
8ee962b729 | |||
3d8b45ecdd | |||
2347d9cea2 | |||
8a57f490ce | |||
a880f5cbb8 | |||
df5a7c7e0c | |||
b7b82456d8 | |||
6b19e54c23 | |||
75d04858e6 | |||
9332551791 | |||
32117a573b | |||
d4d3316d18 | |||
43a7eb233c | |||
178093861b | |||
3fb26534b7 | |||
19a9fdfd38 | |||
6438e97324 | |||
b29492e8eb | |||
5ab4f10230 | |||
80b251e12c | |||
bfd8b12a4f | |||
1c2e94658b |
@ -43,9 +43,9 @@ If you want to...
|
||||
|
||||
:heart: Backers & Sponsors
|
||||
----------------------------------------------------------------
|
||||
| <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/619786/32cf01444db24e578cd1982c197f6fc6/1?token-time=2145916800&token-hash=tB1e_r8RlZ5sFL0KV_e8dugapxatNBRK1Z3h67TO1g8%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/12378075/0156f769e20f412594fa6b87d85fe228/1?token-time=2145916800&token-hash=IsIJRUXszzoD6-7pDnRY8I05T9nSznc4GTaxj7C9SwU%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/4503830/ccf2cc867ea64de0b524bb2e24b9a1cb/1?token-time=2145916800&token-hash=S1zP0QyLU52Dqq6dtc9qNYyWfW86XrYHiR4NMbeOrnA%3D"> |
|
||||
|:-:|:-:|:-:|
|
||||
| [Gargron](https://www.patreon.com/mastodon) | [39ff](https://www.patreon.com/user/creators?u=12378075) | [dansup](https://www.patreon.com/dansup) |
|
||||
| <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/619786/32cf01444db24e578cd1982c197f6fc6/1?token-time=2145916800&token-hash=tB1e_r8RlZ5sFL0KV_e8dugapxatNBRK1Z3h67TO1g8%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/12378075/0156f769e20f412594fa6b87d85fe228/1?token-time=2145916800&token-hash=IsIJRUXszzoD6-7pDnRY8I05T9nSznc4GTaxj7C9SwU%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/4503830/ccf2cc867ea64de0b524bb2e24b9a1cb/1?token-time=2145916800&token-hash=S1zP0QyLU52Dqq6dtc9qNYyWfW86XrYHiR4NMbeOrnA%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/12531784/93a45137841849329ba692da92ac7c60/1?token-time=2145916800&token-hash=tMosUojzUYJCH_3t--tvYA-SMCyrS__hzSndyaRSnbo%3D"> |
|
||||
|:-:|:-:|:-:|:-:|
|
||||
| [Gargron](https://www.patreon.com/mastodon) | [39ff](https://www.patreon.com/user/creators?u=12378075) | [dansup](https://www.patreon.com/dansup) | [Takashi Shibuya](https://www.patreon.com/user/creators?u=12531784) |
|
||||
|
||||
:four_leaf_clover: Copyright
|
||||
----------------------------------------------------------------
|
||||
|
10
package.json
10
package.json
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"author": "syuilo <i@syuilo.com>",
|
||||
"version": "5.5.0",
|
||||
"clientVersion": "1.0.7602",
|
||||
"version": "5.6.1",
|
||||
"clientVersion": "1.0.7624",
|
||||
"codename": "nighthike",
|
||||
"main": "./built/index.js",
|
||||
"private": true,
|
||||
@ -75,6 +75,7 @@
|
||||
"@types/showdown": "1.7.5",
|
||||
"@types/single-line-log": "1.1.0",
|
||||
"@types/speakeasy": "2.0.2",
|
||||
"@types/systeminformation": "3.23.0",
|
||||
"@types/tmp": "0.0.33",
|
||||
"@types/uuid": "3.4.3",
|
||||
"@types/webpack": "4.4.8",
|
||||
@ -131,7 +132,7 @@
|
||||
"is-url": "1.2.4",
|
||||
"jquery": "3.3.1",
|
||||
"js-yaml": "3.12.0",
|
||||
"jsdom": "11.11.0",
|
||||
"jsdom": "11.12.0",
|
||||
"koa": "2.5.1",
|
||||
"koa-bodyparser": "4.2.1",
|
||||
"koa-compress": "3.0.0",
|
||||
@ -187,6 +188,7 @@
|
||||
"stylus": "0.54.5",
|
||||
"stylus-loader": "3.0.2",
|
||||
"summaly": "2.0.6",
|
||||
"systeminformation": "3.42.4",
|
||||
"syuilo-password-strength": "0.0.1",
|
||||
"textarea-caret": "3.1.0",
|
||||
"tmp": "0.0.33",
|
||||
@ -194,7 +196,7 @@
|
||||
"ts-node": "7.0.0",
|
||||
"tslint": "5.10.0",
|
||||
"typescript": "2.9.2",
|
||||
"typescript-eslint-parser": "17.0.0",
|
||||
"typescript-eslint-parser": "17.0.1",
|
||||
"uglify-es": "3.3.9",
|
||||
"url-loader": "1.0.1",
|
||||
"uuid": "3.3.2",
|
||||
|
@ -102,7 +102,6 @@ export default Vue.extend({
|
||||
},
|
||||
methods: {
|
||||
onStats(stats) {
|
||||
stats.mem.used = stats.mem.total - stats.mem.free;
|
||||
this.stats.push(stats);
|
||||
if (this.stats.length > 50) this.stats.shift();
|
||||
|
||||
|
@ -35,7 +35,7 @@ export default Vue.extend({
|
||||
},
|
||||
methods: {
|
||||
onStats(stats) {
|
||||
stats.mem.used = stats.mem.total - stats.mem.free;
|
||||
stats.mem.free = stats.mem.total - stats.mem.used;
|
||||
this.usage = stats.mem.used / stats.mem.total;
|
||||
this.total = stats.mem.total;
|
||||
this.used = stats.mem.used;
|
||||
|
@ -35,7 +35,7 @@ import Vue from 'vue';
|
||||
const eachMonthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
||||
|
||||
function isLeapYear(year) {
|
||||
return !(year % (year % 25 ? 4 : 16));
|
||||
return !(year & (year % 25 ? 3 : 5));
|
||||
}
|
||||
|
||||
export default Vue.extend({
|
||||
|
@ -34,7 +34,13 @@
|
||||
<button class="poll" @click="poll = true">%fa:chart-pie%</button>
|
||||
<button class="poll" @click="useCw = !useCw">%fa:eye-slash%</button>
|
||||
<button class="geo" @click="geo ? removeGeo() : setGeo()">%fa:map-marker-alt%</button>
|
||||
<button class="visibility" @click="setVisibility" ref="visibilityButton">%fa:lock%</button>
|
||||
<button class="visibility" @click="setVisibility" ref="visibilityButton">
|
||||
<span v-if="visibility === 'public'">%fa:globe%</span>
|
||||
<span v-if="visibility === 'home'">%fa:home%</span>
|
||||
<span v-if="visibility === 'followers'">%fa:unlock%</span>
|
||||
<span v-if="visibility === 'specified'">%fa:envelope%</span>
|
||||
<span v-if="visibility === 'private'">%fa:lock%</span>
|
||||
</button>
|
||||
</footer>
|
||||
<input ref="file" class="file" type="file" accept="image/*" multiple="multiple" @change="onChangeFile"/>
|
||||
</div>
|
||||
|
@ -1,7 +1,8 @@
|
||||
import * as os from 'os';
|
||||
const osUtils = require('os-utils');
|
||||
import * as sysUtils from 'systeminformation';
|
||||
import * as diskusage from 'diskusage';
|
||||
import Xev from 'xev';
|
||||
const osUtils = require('os-utils');
|
||||
|
||||
const ev = new Xev();
|
||||
|
||||
@ -18,25 +19,58 @@ export default function() {
|
||||
});
|
||||
|
||||
async function tick() {
|
||||
osUtils.cpuUsage((cpuUsage: number) => {
|
||||
const disk = diskusage.checkSync(os.platform() == 'win32' ? 'c:' : '/');
|
||||
const stats = {
|
||||
cpu_usage: cpuUsage,
|
||||
mem: {
|
||||
total: os.totalmem(),
|
||||
free: os.freemem()
|
||||
},
|
||||
disk,
|
||||
os_uptime: os.uptime(),
|
||||
process_uptime: process.uptime()
|
||||
};
|
||||
ev.emit('serverStats', stats);
|
||||
log.push(stats);
|
||||
if (log.length > 50) log.shift();
|
||||
});
|
||||
const cpu = await cpuUsage();
|
||||
const usedmem = await usedMem();
|
||||
const totalmem = await totalMem();
|
||||
const disk = diskusage.checkSync(os.platform() == 'win32' ? 'c:' : '/');
|
||||
|
||||
const stats = {
|
||||
cpu_usage: cpu,
|
||||
mem: {
|
||||
total: totalmem,
|
||||
used: usedmem
|
||||
},
|
||||
disk,
|
||||
os_uptime: os.uptime(),
|
||||
process_uptime: process.uptime()
|
||||
};
|
||||
ev.emit('serverStats', stats);
|
||||
log.push(stats);
|
||||
if (log.length > 50) log.shift();
|
||||
}
|
||||
|
||||
tick();
|
||||
|
||||
setInterval(tick, interval);
|
||||
}
|
||||
|
||||
// CPU STAT
|
||||
function cpuUsage() {
|
||||
return new Promise((res, rej) => {
|
||||
osUtils.cpuUsage((cpuUsage: number) => {
|
||||
res(cpuUsage);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// MEMORY(excl buffer + cache) STAT
|
||||
async function usedMem() {
|
||||
try {
|
||||
const data = await sysUtils.mem();
|
||||
return data.active;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
// TOTAL MEMORY STAT
|
||||
async function totalMem() {
|
||||
try {
|
||||
const data = await sysUtils.mem();
|
||||
return data.total;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
@ -79,9 +79,6 @@ async function workerMain() {
|
||||
// start server
|
||||
await require('./server').default();
|
||||
|
||||
// start processor
|
||||
require('./queue').default();
|
||||
|
||||
// Send a 'ready' message to parent process
|
||||
process.send('ready');
|
||||
}
|
||||
|
@ -1,28 +1,8 @@
|
||||
import * as Queue from 'bee-queue';
|
||||
|
||||
import config from '../config';
|
||||
import http from './processors/http';
|
||||
import { ILocalUser } from '../models/user';
|
||||
|
||||
const queue = new Queue('misskey', {
|
||||
redis: {
|
||||
port: config.redis.port,
|
||||
host: config.redis.host,
|
||||
password: config.redis.pass
|
||||
},
|
||||
|
||||
removeOnSuccess: true,
|
||||
removeOnFailure: true,
|
||||
getEvents: false,
|
||||
sendEvents: false,
|
||||
storeJobs: false
|
||||
});
|
||||
|
||||
export function createHttpJob(data: any) {
|
||||
return queue.createJob(data)
|
||||
//.retries(4)
|
||||
//.backoff('exponential', 16384) // 16s
|
||||
.save();
|
||||
return http({ data }, () => {});
|
||||
}
|
||||
|
||||
export function deliver(user: ILocalUser, content: any, to: any) {
|
||||
@ -33,7 +13,3 @@ export function deliver(user: ILocalUser, content: any, to: any) {
|
||||
to
|
||||
});
|
||||
}
|
||||
|
||||
export default function() {
|
||||
queue.process(128, http);
|
||||
}
|
||||
|
@ -10,8 +10,7 @@ export default async (me: mongodb.ObjectID, note: object) => {
|
||||
// if watching now
|
||||
const exist = await Watching.findOne({
|
||||
noteId: (note as any)._id,
|
||||
userId: me,
|
||||
deletedAt: { $exists: false }
|
||||
userId: me
|
||||
});
|
||||
|
||||
if (exist !== null) {
|
||||
|
Reference in New Issue
Block a user