検索

<center> WindowsでMisskey環境作成(WSL2編) </center> 作成日:2023年3月12日 OS: Windows11 前提:Visual Studio Codeをインストール済み 参考サイト:https://hide.ac/articles/t6Gdoxdfh / https://misskey-hub.net/docs/install/manual.html

1. WSL2、Ubuntuをインストール
①PowerShellを管理者で開き、下記を実行

> wsl --install

※デフォルト設定でWSL2、Ubuntuの環境となる

2. WSLにlocalhostで接続できるようにする設定
①%USERPROFILE%\.wslconfig ファイルを作成し、下記を記述

localhostForwarding=True

設定したら再起動

3. Ubuntuの環境設定
※スタートメニューにUbuntuが追加されているのでクリックして開く
①パッケージのアップグレードのため、下記を実行

$ sudo apt update; sudo apt upgrade -y

②Ubuntuを再起動:Powershellで下記を実行

> wsl -t Ubuntu

③Ubuntuに諸々インストールのため、下記を実行
# build-essential

$ sudo apt install build-essential -y

# Node.js

$ curl -sL https://deb.nodesource.com/setup_current.x | sudo -E bash -
$ sudo apt install -y nodejs

# PostgreSQL

$ wget https://salsa.debian.org/postgresql/postgresql-common/raw/master/pgdg/apt.postgresql.org.sh
$ sudo sh apt.postgresql.org.sh -i -v 13

# Redis

$ curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
$ echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
$ sudo apt update
$ sudo apt install redis -y

# DB起動 ※このコマンドはUbuntu再起動のたびに必要

$ sudo /etc/init.d/postgresql restart
$ sudo service redis-server start

# PostgreSQLの設定
# ユーザー misskey、パスワード misskey、DB名 mk1 としている

$ sudo -u postgres psql
# CREATE ROLE misskey LOGIN CREATEDB PASSWORD 'misskey';
# CREATE DATABASE mk1 OWNER misskey;
# exit


4. Misskeyをフォークする
①一応設定

$ git config --global user.name "名前"
$ git config --global user.email "メールアドレス"
$ git config --global core.editor 'code --wait'
$ git config --global merge.tool 'code --wait "$MERGED"'

②クローンなど

$ git clone --recursive https://github.com/misskey-dev/misskey.git
$ cd misskey
$ git checkout master
$ git submodule update --init


5. VS Codeでセットアップ
①拡張機能「WSL」をインストール
②Ctrl+Shift+P「WSL でフォルダーを開く」でクローンしたフォルダを選択
③.configフォルダのexample.ymlをコピペし、default.ymlを同フォルダに作成して開く
④とりあえず修正するのは下記ぐらい

url: http://localhost:3000/
db:
  db: mk1
  user: misskey
  pass: misskey


6. ビルド、初期設定、起動
①Misskeyのビルド
VS Codeのコンソールから、下記を実行

# corepack enable
# NODE_ENV=production pnpm install --frozen-lockfile
# NODE_ENV=production pnpm run build

②DB初期化

# pnpm run init

③開始

# NODE_ENV=production pnpm run start

http://localhost:3000/ を開いて管理者アカウント作成画面が表示されたら、成功!
  • 2023-03-12 13-21-16 1.png
返信 0 · Renote 0
An #introduction. I'm a backend #node developer in #vancouver, I've been running #vrchat 's backend (badly) since about 2016 (when it was just me). Now it's loads more people! Most of what I post is not serious or thoughtful. I like my #bengal #cat, I used to make #comics (I'm an extremely mediocre artist) and now perform micro-acts of forgettable #gamedev when I get the chance. I like #boardgames and #alcohol and #coffee and #cooking and #restaurants.
返信 0 · Renote 0
As an #introduction for this account I'm posting a screenshot of my iBook G4 running #Debian #PPC. This is not simple nostalgia (of course as well), but also shows what kind of software I favour: Sustainable, simple, fast, light, portable and well designed #FLOSS software and small tech (digital minimalism). This is why I'm a supporter of @[email protected], @[email protected] and software like @ObjFW and @[email protected]. I've done web development for a long time, I'm fine with #PHP, but I really avoid anything #Node.js. 😜
  • dbdfc09ae4963e6d.png
返信 0 · Renote 0