開発環境を準備・起動する人向け。
Before developing, you have to set up environment. Misskey requires Redis, PostgreSQL, and FFmpeg.
You would want to install Meilisearch to experiment related features. Technically, meilisearch is not strict requirement, but some features and tests require it.
There are a few ways to proceed.
You could install them in system-wide (such as from package manager).
You could obtain middleware container by typing docker compose -f $PROJECT_ROOT/compose.local-db.yml up -d.
Devcontainer also has necessary setting. This method can be done by connecting from VSCode.
Instead of running pnpm locally, you can use Dev Container to set up your development environment.
To use Dev Container, open the project directory on VSCode with Dev Containers installed.
Note: If you are using Windows, please clone the repository with WSL. Using Git for Windows will result in broken files due to the difference in how newlines are handled.
It will run the following command automatically inside the container.
git submodule update --init
pnpm install --frozen-lockfile
cp .devcontainer/devcontainer.yml .config/default.yml
pnpm build
pnpm migrateAfter finishing the migration, you can proceed.
Cloudflare tunnelを使うとローカルのMisskeyサーバーをインターネットに公開できます。 HTTPSでしか動作しない機能を検証したい時や、スマホなど別のデバイスからローカルのMisskeyサーバーを検証したい時に便利です。
cloudflared (Cloudflare Tunnel) は region1.v2.argotunnel.com / region2.v2.argotunnel.com に QUIC/HTTP2 でアウトバウンド接続するのですが、WARP を有効化するとこのトラフィックが WARP 経由になってループ/切断します。これら 2 ホストを WARP のトンネル除外(split tunnel)に追加することで、cloudflared だけは WARP をバイパスして直接 Cloudflare エッジへ接続できるようになります。
During development, it is useful to use the
pnpm dev
command.
- Server-side source files and automatically builds them if they are modified. Automatically start the server process(es).
- Service Worker is watched by esbuild.
- Vite HMR (just the
vitecommand) is available. The behavior may be different from production. - Vite runs behind the backend (the backend will proxy Vite at /vite and /embed_vite except for websocket used for HMR).
- You can see Misskey by accessing
http://localhost:3000(Replace3000with the port configured withportin .config/default.yml).
MISSKEY_CONFIG_YML: Specify the file path of config.yml instead of default.yml (e.g.2nd.yml).MISSKEY_WEBFINGER_USE_HTTP: If it's set true, WebFinger requests will be http instead of https, useful for testing federation between servers in localhost. NEVER USE IN PRODUCTION.
Just execute pnpm to fix it.