A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang. (PERSONAL FORK)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

English

获取源码#

  • git clone git@github.com:siyuan-note/siyuan.git
  • 切换到 dev 分支 git checkout dev

NPM 依赖#

安装 pnpm:npm install -g pnpm@10.30.1

适用于中国大陆

设置 Electron 镜像环境变量并安装 Electron:

  • macOS/Linux:ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@39.7.0 -D
  • Windows:
    • SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
    • pnpm install electron@39.7.0 -D

NPM 镜像:

  • 使用 npmmirror 中国镜像仓库 pnpm --registry https://registry.npmmirror.com/ i
  • 恢复使用官方仓库 pnpm --registry https://registry.npmjs.org i

进入 app 文件夹执行:

  • pnpm install electron@39.7.0 -D
  • pnpm run dev
  • pnpm run start

注意:在开发环境下不会自动拉起内核进程,需要先手动拉起内核进程。

内核#

  1. 安装最新版 golang
  2. 打开 CGO 支持,即配置环境变量 CGO_ENABLED=1

桌面端#

  • cd kernel
  • Windows: go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"
  • Linux/macOS: go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel"
  • cd ../app/kernel
  • Windows: ./SiYuan-Kernel.exe --wd=.. --mode=dev
  • Linux/macOS: ./SiYuan-Kernel --wd=.. --mode=dev

iOS#

Android#

Harmony#

仅支持在 Linux 下编译,需要安装鸿蒙 SDK,并且需要修改 Go 源码。

修改 Go 源码:

  1. go/src/runtime/tls_arm64.s

    结尾 DATA runtime·tls_g+0(SB)/8, $16 改为 DATA runtime·tls_g+0(SB)/8, $-144

  2. go/src/runtime/cgo/gcc_android.c

    清空 inittls 函数

    inittls(void **tlsg, void **tlsbase)
    {
      return;
    }
    
  3. go/src/net/cgo_resold.go C.size_t(len(b)) 改为 C.socklen_t(len(b))

其他细节请参考 https://github.com/siyuan-note/siyuan/issues/13184