Use PostgreSQL instead of MongoDB (#4572)
* wip * Update note.ts * Update timeline.ts * Update core.ts * wip * Update generate-visibility-query.ts * wip * wip * wip * wip * wip * Update global-timeline.ts * wip * wip * wip * Update vote.ts * wip * wip * Update create.ts * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update files.ts * wip * wip * Update CONTRIBUTING.md * wip * wip * wip * wip * wip * wip * wip * wip * Update read-notification.ts * wip * wip * wip * wip * wip * wip * wip * Update cancel.ts * wip * wip * wip * Update show.ts * wip * wip * Update gen-id.ts * Update create.ts * Update id.ts * wip * wip * wip * wip * wip * wip * wip * Docker: Update files about Docker (#4599) * Docker: Use cache if files used by `yarn install` was not updated This patch reduces the number of times to installing node_modules. For example, `yarn install` step will be skipped when only ".config/default.yml" is updated. * Docker: Migrate MongoDB to Postgresql Misskey uses Postgresql as a database instead of Mongodb since version 11. * Docker: Uncomment about data persistence This patch will save a lot of databases. * wip * wip * wip * Update activitypub.ts * wip * wip * wip * Update logs.ts * wip * Update drive-file.ts * Update register.ts * wip * wip * Update mentions.ts * wip * wip * wip * Update recommendation.ts * wip * Update index.ts * wip * Update recommendation.ts * Doc: Update docker.ja.md and docker.en.md (#1) (#4608) Update how to set up misskey. * wip * ✌️ * wip * Update note.ts * Update postgre.ts * wip * wip * wip * wip * Update add-file.ts * wip * wip * wip * Clean up * Update logs.ts * wip * 🍕 * wip * Ad notes * wip * Update api-visibility.ts * Update note.ts * Update add-file.ts * tests * tests * Update postgre.ts * Update utils.ts * wip * wip * Refactor * wip * Refactor * wip * wip * Update show-users.ts * Update update-instance.ts * wip * Update feed.ts * Update outbox.ts * Update outbox.ts * Update user.ts * wip * Update list.ts * Update update-hashtag.ts * wip * Update update-hashtag.ts * Refactor * Update update.ts * wip * wip * ✌️ * clean up * docs * Update push.ts * wip * Update api.ts * wip * ✌️ * Update make-pagination-query.ts * ✌️ * Delete hashtags.ts * Update instances.ts * Update instances.ts * Update create.ts * Update search.ts * Update reversi-game.ts * Update signup.ts * Update user.ts * id * Update example.yml * 🎨 * objectid * fix * reversi * reversi * Fix bug of chart engine * Add test of chart engine * Improve test * Better testing * Improve chart engine * Refactor * Add test of chart engine * Refactor * Add chart test * Fix bug * コミットし忘れ * Refactoring * ✌️ * Add tests * Add test * Extarct note tests * Refactor * 存在しないユーザーにメンションできなくなっていた問題を修正 * Fix bug * Update update-meta.ts * Fix bug * Update mention.vue * Fix bug * Update meta.ts * Update CONTRIBUTING.md * Fix bug * Fix bug * Fix bug * Clean up * Clean up * Update notification.ts * Clean up * Add mute tests * Add test * Refactor * Add test * Fix test * Refactor * Refactor * Add tests * Update utils.ts * Update utils.ts * Fix test * Update package.json * Update update.ts * Update manifest.ts * Fix bug * Fix bug * Add test * 🎨 * Update endpoint permissions * Updaye permisison * Update person.ts #4299 * データベースと同期しないように * Fix bug * Fix bug * Update reversi-game.ts * Use a feature of Node v11.7.0 to extract a public key (#4644) * wip * wip * ✌️ * Refactoring #1540 * test * test * test * test * test * test * test * Fix bug * Fix test * 🍣 * wip * #4471 * Add test for #4335 * Refactor * Fix test * Add tests * 🕓 * Fix bug * Add test * Add test * rename * Fix bug
This commit is contained in:
		@@ -60,7 +60,7 @@ export default Vue.extend({
 | 
			
		||||
			return this.browser.selectedFiles.some(f => f.id == this.file.id);
 | 
			
		||||
		},
 | 
			
		||||
		title(): string {
 | 
			
		||||
			return `${this.file.name}\n${this.file.type} ${Vue.filter('bytes')(this.file.datasize)}`;
 | 
			
		||||
			return `${this.file.name}\n${this.file.type} ${Vue.filter('bytes')(this.file.size)}`;
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
 
 | 
			
		||||
@@ -54,11 +54,11 @@
 | 
			
		||||
				</button>
 | 
			
		||||
				<button v-if="!isMyNote && appearNote.myReaction == null" class="reactionButton button" @click="react()" ref="reactButton" :title="$t('add-reaction')">
 | 
			
		||||
					<fa icon="plus"/>
 | 
			
		||||
					<p class="count" v-if="Object.values(appearNote.reactionCounts).some(x => x)">{{ Object.values(appearNote.reactionCounts).reduce((a, c) => a + c, 0) }}</p>
 | 
			
		||||
					<p class="count" v-if="Object.values(appearNote.reactions).some(x => x)">{{ Object.values(appearNote.reactions).reduce((a, c) => a + c, 0) }}</p>
 | 
			
		||||
				</button>
 | 
			
		||||
				<button v-if="!isMyNote && appearNote.myReaction != null" class="reactionButton reacted button" @click="undoReact(appearNote)" ref="reactButton" :title="$t('undo-reaction')">
 | 
			
		||||
					<fa icon="minus"/>
 | 
			
		||||
					<p class="count" v-if="Object.values(appearNote.reactionCounts).some(x => x)">{{ Object.values(appearNote.reactionCounts).reduce((a, c) => a + c, 0) }}</p>
 | 
			
		||||
					<p class="count" v-if="Object.values(appearNote.reactions).some(x => x)">{{ Object.values(appearNote.reactions).reduce((a, c) => a + c, 0) }}</p>
 | 
			
		||||
				</button>
 | 
			
		||||
				<button @click="menu()" ref="menuButton" class="button">
 | 
			
		||||
					<fa icon="ellipsis-h"/>
 | 
			
		||||
 
 | 
			
		||||
@@ -110,7 +110,7 @@
 | 
			
		||||
						</div>
 | 
			
		||||
					</template>
 | 
			
		||||
 | 
			
		||||
					<template v-if="notification.type == 'poll_vote'">
 | 
			
		||||
					<template v-if="notification.type == 'pollVote'">
 | 
			
		||||
						<mk-avatar class="avatar" :user="notification.user"/>
 | 
			
		||||
						<div class="text">
 | 
			
		||||
							<p><fa icon="chart-pie"/><a :href="notification.user | userPage" v-user-preview="notification.user.id">
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
<mk-window ref="window" width="450px" height="500px" @closed="destroyDom">
 | 
			
		||||
	<template #header><fa icon="list"/> {{ list.title }}</template>
 | 
			
		||||
	<template #header><fa icon="list"/> {{ list.name }}</template>
 | 
			
		||||
 | 
			
		||||
	<x-editor :list="list"/>
 | 
			
		||||
</mk-window>
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
 | 
			
		||||
	<div class="xkxvokkjlptzyewouewmceqcxhpgzprp">
 | 
			
		||||
		<button class="ui" @click="add">{{ $t('create-list') }}</button>
 | 
			
		||||
		<a v-for="list in lists" :key="list.id" @click="choice(list)">{{ list.title }}</a>
 | 
			
		||||
		<a v-for="list in lists" :key="list.id" @click="choice(list)">{{ list.name }}</a>
 | 
			
		||||
	</div>
 | 
			
		||||
</mk-window>
 | 
			
		||||
</template>
 | 
			
		||||
 
 | 
			
		||||
@@ -101,7 +101,7 @@ export default Vue.extend({
 | 
			
		||||
	computed: {
 | 
			
		||||
		home(): any[] {
 | 
			
		||||
			if (this.$store.getters.isSignedIn) {
 | 
			
		||||
				return this.$store.state.settings.home || [];
 | 
			
		||||
				return this.$store.state.device.home || [];
 | 
			
		||||
			} else {
 | 
			
		||||
				return [{
 | 
			
		||||
					name: 'instance',
 | 
			
		||||
@@ -182,12 +182,8 @@ export default Vue.extend({
 | 
			
		||||
			}
 | 
			
		||||
			//#endregion
 | 
			
		||||
 | 
			
		||||
			if (this.$store.state.settings.home == null) {
 | 
			
		||||
				this.$root.api('i/update_home', {
 | 
			
		||||
					home: _defaultDesktopHomeWidgets
 | 
			
		||||
				}).then(() => {
 | 
			
		||||
					this.$store.commit('settings/setHome', _defaultDesktopHomeWidgets);
 | 
			
		||||
				});
 | 
			
		||||
			if (this.$store.state.device.home == null) {
 | 
			
		||||
				this.$store.commit('device/setHome', _defaultDesktopHomeWidgets);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
@@ -226,7 +222,7 @@ export default Vue.extend({
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		addWidget() {
 | 
			
		||||
			this.$store.dispatch('settings/addHomeWidget', {
 | 
			
		||||
			this.$store.commit('device/addHomeWidget', {
 | 
			
		||||
				name: this.widgetAdderSelected,
 | 
			
		||||
				id: uuid(),
 | 
			
		||||
				place: 'left',
 | 
			
		||||
@@ -237,12 +233,9 @@ export default Vue.extend({
 | 
			
		||||
		saveHome() {
 | 
			
		||||
			const left = this.widgets.left;
 | 
			
		||||
			const right = this.widgets.right;
 | 
			
		||||
			this.$store.commit('settings/setHome', left.concat(right));
 | 
			
		||||
			this.$store.commit('device/setHome', left.concat(right));
 | 
			
		||||
			for (const w of left) w.place = 'left';
 | 
			
		||||
			for (const w of right) w.place = 'right';
 | 
			
		||||
			this.$root.api('i/update_home', {
 | 
			
		||||
				home: this.home
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		done() {
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@ export default Vue.extend({
 | 
			
		||||
	i18n: i18n('desktop/views/pages/tag.vue'),
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			makePromise: cursor => this.$root.api('notes/search_by_tag', {
 | 
			
		||||
			makePromise: cursor => this.$root.api('notes/search-by-tag', {
 | 
			
		||||
				limit: limit + 1,
 | 
			
		||||
				offset: cursor ? cursor : undefined,
 | 
			
		||||
				tag: this.$route.params.tag
 | 
			
		||||
 
 | 
			
		||||
@@ -58,7 +58,7 @@ export default Vue.extend({
 | 
			
		||||
		};
 | 
			
		||||
 | 
			
		||||
		if (this.src == 'tag') {
 | 
			
		||||
			this.endpoint = 'notes/search_by_tag';
 | 
			
		||||
			this.endpoint = 'notes/search-by-tag';
 | 
			
		||||
			this.query = {
 | 
			
		||||
				query: this.tagTl.query
 | 
			
		||||
			};
 | 
			
		||||
@@ -77,9 +77,9 @@ export default Vue.extend({
 | 
			
		||||
			this.endpoint = 'notes/local-timeline';
 | 
			
		||||
			this.connection = this.$root.stream.useSharedConnection('localTimeline');
 | 
			
		||||
			this.connection.on('note', prepend);
 | 
			
		||||
		} else if (this.src == 'hybrid') {
 | 
			
		||||
			this.endpoint = 'notes/hybrid-timeline';
 | 
			
		||||
			this.connection = this.$root.stream.useSharedConnection('hybridTimeline');
 | 
			
		||||
		} else if (this.src == 'social') {
 | 
			
		||||
			this.endpoint = 'notes/social-timeline';
 | 
			
		||||
			this.connection = this.$root.stream.useSharedConnection('socialTimeline');
 | 
			
		||||
			this.connection.on('note', prepend);
 | 
			
		||||
		} else if (this.src == 'global') {
 | 
			
		||||
			this.endpoint = 'notes/global-timeline';
 | 
			
		||||
 
 | 
			
		||||
@@ -6,10 +6,10 @@
 | 
			
		||||
			<header class="zahtxcqi">
 | 
			
		||||
				<span :data-active="src == 'home'" @click="src = 'home'"><fa icon="home"/> {{ $t('home') }}</span>
 | 
			
		||||
				<span :data-active="src == 'local'" @click="src = 'local'" v-if="enableLocalTimeline"><fa :icon="['far', 'comments']"/> {{ $t('local') }}</span>
 | 
			
		||||
				<span :data-active="src == 'hybrid'" @click="src = 'hybrid'" v-if="enableLocalTimeline"><fa icon="share-alt"/> {{ $t('hybrid') }}</span>
 | 
			
		||||
				<span :data-active="src == 'social'" @click="src = 'social'" v-if="enableLocalTimeline"><fa icon="share-alt"/> {{ $t('social') }}</span>
 | 
			
		||||
				<span :data-active="src == 'global'" @click="src = 'global'" v-if="enableGlobalTimeline"><fa icon="globe"/> {{ $t('global') }}</span>
 | 
			
		||||
				<span :data-active="src == 'tag'" @click="src = 'tag'" v-if="tagTl"><fa icon="hashtag"/> {{ tagTl.title }}</span>
 | 
			
		||||
				<span :data-active="src == 'list'" @click="src = 'list'" v-if="list"><fa icon="list"/> {{ list.title }}</span>
 | 
			
		||||
				<span :data-active="src == 'list'" @click="src = 'list'" v-if="list"><fa icon="list"/> {{ list.name }}</span>
 | 
			
		||||
				<div class="buttons">
 | 
			
		||||
					<button :data-active="src == 'mentions'" @click="src = 'mentions'" :title="$t('mentions')"><fa icon="at"/><i class="indicator" v-if="$store.state.i.hasUnreadMentions"><fa icon="circle"/></i></button>
 | 
			
		||||
					<button :data-active="src == 'messages'" @click="src = 'messages'" :title="$t('messages')"><fa :icon="['far', 'envelope']"/><i class="indicator" v-if="$store.state.i.hasUnreadSpecifiedNotes"><fa icon="circle"/></i></button>
 | 
			
		||||
@@ -78,7 +78,7 @@ export default Vue.extend({
 | 
			
		||||
			) && this.src === 'global') this.src = 'local';
 | 
			
		||||
			if (!(
 | 
			
		||||
				this.enableLocalTimeline = !meta.disableLocalTimeline || this.$store.state.i.isModerator || this.$store.state.i.isAdmin
 | 
			
		||||
			) && ['local', 'hybrid'].includes(this.src)) this.src = 'home';
 | 
			
		||||
			) && ['local', 'social'].includes(this.src)) this.src = 'home';
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		if (this.$store.state.device.tl) {
 | 
			
		||||
@@ -89,7 +89,7 @@ export default Vue.extend({
 | 
			
		||||
				this.tagTl = this.$store.state.device.tl.arg;
 | 
			
		||||
			}
 | 
			
		||||
		} else if (this.$store.state.i.followingCount == 0) {
 | 
			
		||||
			this.src = 'hybrid';
 | 
			
		||||
			this.src = 'social';
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -143,7 +143,7 @@ export default Vue.extend({
 | 
			
		||||
 | 
			
		||||
			menu = menu.concat(lists.map(list => ({
 | 
			
		||||
				icon: 'list',
 | 
			
		||||
				text: list.title,
 | 
			
		||||
				text: list.name,
 | 
			
		||||
				action: () => {
 | 
			
		||||
					this.list = list;
 | 
			
		||||
					this.src = 'list';
 | 
			
		||||
 
 | 
			
		||||
@@ -36,8 +36,8 @@
 | 
			
		||||
			</dl>
 | 
			
		||||
		</div>
 | 
			
		||||
		<div class="info">
 | 
			
		||||
			<span class="location" v-if="user.host === null && user.profile.location"><fa icon="map-marker"/> {{ user.profile.location }}</span>
 | 
			
		||||
			<span class="birthday" v-if="user.host === null && user.profile.birthday"><fa icon="birthday-cake"/> {{ user.profile.birthday.replace('-', $t('year')).replace('-', $t('month')) + $t('day') }} ({{ $t('years-old', { age }) }})</span>
 | 
			
		||||
			<span class="location" v-if="user.host === null && user.location"><fa icon="map-marker"/> {{ user.location }}</span>
 | 
			
		||||
			<span class="birthday" v-if="user.host === null && user.birthday"><fa icon="birthday-cake"/> {{ user.birthday.replace('-', $t('year')).replace('-', $t('month')) + $t('day') }} ({{ $t('years-old', { age }) }})</span>
 | 
			
		||||
		</div>
 | 
			
		||||
		<div class="status">
 | 
			
		||||
			<router-link :to="user | userPage()" class="notes-count"><b>{{ user.notesCount | number }}</b>{{ $t('posts') }}</router-link>
 | 
			
		||||
@@ -71,7 +71,7 @@ export default Vue.extend({
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		age(): number {
 | 
			
		||||
			return age(this.user.profile.birthday);
 | 
			
		||||
			return age(this.user.birthday);
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
 
 | 
			
		||||
@@ -13,8 +13,8 @@
 | 
			
		||||
		<div class="body">
 | 
			
		||||
			<div class="main block">
 | 
			
		||||
				<div>
 | 
			
		||||
					<h1 v-if="name != 'Misskey'">{{ name }}</h1>
 | 
			
		||||
					<h1 v-else><img svg-inline src="../../../../assets/title.svg" :alt="name"></h1>
 | 
			
		||||
					<h1 v-if="name != null">{{ name }}</h1>
 | 
			
		||||
					<h1 v-else><img svg-inline src="../../../../assets/title.svg" alt="Misskey"></h1>
 | 
			
		||||
 | 
			
		||||
					<div class="info">
 | 
			
		||||
						<span><b>{{ host }}</b> - <span v-html="$t('powered-by-misskey')"></span></span>
 | 
			
		||||
@@ -87,7 +87,7 @@
 | 
			
		||||
					<div>
 | 
			
		||||
						<div v-if="meta" class="body">
 | 
			
		||||
							<p>Version: <b>{{ meta.version }}</b></p>
 | 
			
		||||
							<p>Maintainer: <b><a :href="'mailto:' + meta.maintainer.email" target="_blank">{{ meta.maintainer.name }}</a></b></p>
 | 
			
		||||
							<p>Maintainer: <b><a :href="'mailto:' + meta.maintainerEmail" target="_blank">{{ meta.maintainerName }}</a></b></p>
 | 
			
		||||
						</div>
 | 
			
		||||
					</div>
 | 
			
		||||
				</div>
 | 
			
		||||
@@ -162,7 +162,7 @@ export default Vue.extend({
 | 
			
		||||
			banner: null,
 | 
			
		||||
			copyright,
 | 
			
		||||
			host: toUnicode(host),
 | 
			
		||||
			name: 'Misskey',
 | 
			
		||||
			name: null,
 | 
			
		||||
			description: '',
 | 
			
		||||
			announcements: [],
 | 
			
		||||
			photos: []
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user