update docs/setup_ubuntu_2204.sh

This commit is contained in:
root 2025-08-16 16:56:17 +08:00
parent 657e7937a9
commit b3c5ba4dbf
2 changed files with 8 additions and 4 deletions

View File

@ -1,10 +1,11 @@
OS := $(shell uname -s)
SHELL := /bin/bash
O_BIN ?= /usr/local/go/bin
export PATH := $(GO_BIN):$(PATH)
PG_DSN ?= postgres://user:password@127.0.0.1:5432/postgres
NODE_MAJOR ?= 22
export PATH := $(GO_BIN):$(PATH)
.PHONY: install install-openresty install-redis install-postgresql install-pgvector install-zhparser init-db \
build build-server build-homepage build-panel \
start start-openresty start-server start-homepage start-panel \

View File

@ -55,9 +55,12 @@ install-nodejs() {
sudo apt-get install -y ca-certificates curl gnupg
# NodeSource 官方仓库(更稳妥的 GPG 方式)
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL --socks5-hostname 127.0.0.1:1080 \
https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| sudo gpg --batch --yes --dearmor -o /etc/apt/keyrings/nodesource.gpg
gpg --keyserver keyserver.ubuntu.com --recv-keys 2F59B5F99B1BE0B4
gpg --export --armor 2F59B5F99B1BE0B4 | sudo tee /etc/apt/trusted.gpg.d/missing-key.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" \
| sudo tee /etc/apt/sources.list.d/nodesource.list >/dev/null