Bookwyrm 安装教程

安装之前你需要: 1. 购买域名 2. 配置好DNS服务器 3. 购买VPS服务 4. 设置好VPS服务器的安全配置 5. 安装docker和docker-compose (指路皮皮站长)

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
  1. 如果你的vps上已经有毛象了的话,建议用sudo useradd -r -m -d /home/bookwyrm -U -G docker bookwyrm 给Bookwyrm的服务创建一个专门的系统用户。

o3o站皮皮站长的毛象搭建教程里面有详细解释。

该教程假设你使用的系统是ubuntu 20.04。

在崭新的vps服务器上安装bookwyrm

ssh至你的vps服务器

cd /home/
mkdir bookwyrm && cd bookwyrm
git clone https://github.com/bookwyrm-social/bookwyrm.git
git checkout production
cp .env.prod.example .env

用nano 或者 vi 编辑.env文件。(nano .env 或者 vi .env)。

.env设置如下:

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY="你的密码"

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG=false
USE_HTTPS=true

DOMAIN=你的域名
EMAIL=你的站长邮箱

# Used for deciding which editions to prefer
DEFAULT_LANGUAGE="English"

## Leave unset to allow all hosts
# ALLOWED_HOSTS="localhost,127.0.0.1,[::1]"

MEDIA_ROOT=images/

PGPORT=5432
POSTGRES_PASSWORD=你的数据库密码
POSTGRES_USER=fedireads
POSTGRES_DB=fedireads
POSTGRES_HOST=db

# Redis activity stream manager
MAX_STREAM_LENGTH=200
REDIS_ACTIVITY_HOST=redis_activity
REDIS_ACTIVITY_PORT=6379
REDIS_ACTIVITY_PASSWORD=你的redis密码

# Redis as celery broker
REDIS_BROKER_PORT=6379
REDIS_BROKER_PASSWORD=你的redis密码

FLOWER_PORT=8888
FLOWER_USER=你的flower用户名
FLOWER_PASSWORD=你的flower密码

EMAIL_HOST=smtp.mailgun.org
EMAIL_PORT=587
EMAIL_HOST_USER=你的bookwyrm服务的邮箱地址
EMAIL_HOST_PASSWORD=你的服务邮箱密码
EMAIL_USE_TLS=true
EMAIL_USE_SSL=false

# Thumbnails Generation
ENABLE_THUMBNAIL_GENERATION=false

# S3 configuration
USE_S3=false
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

# Commented are example values if you use a non-AWS, S3-compatible service
# AWS S3 should work with only AWS_STORAGE_BUCKET_NAME and AWS_S3_REGION_NAME
# non-AWS S3-compatible services will need AWS_STORAGE_BUCKET_NAME,
# along with both AWS_S3_CUSTOM_DOMAIN and AWS_S3_ENDPOINT_URL

# AWS_STORAGE_BUCKET_NAME=        # "example-bucket-name"
# AWS_S3_CUSTOM_DOMAIN=None       # "example-bucket-name.s3.fr-par.scw.cloud"
# AWS_S3_REGION_NAME=None         # "fr-par"
# AWS_S3_ENDPOINT_URL=None        # "https://s3.fr-par.scw.cloud"


# Preview image generation can be computing and storage intensive
# ENABLE_PREVIEW_IMAGES=True

# Specify RGB tuple or RGB hex strings,
# or use_dominant_color_light / use_dominant_color_dark
PREVIEW_BG_COLOR=use_dominant_color_light
# Change to #FFF if you use use_dominant_color_dark
PREVIEW_TEXT_COLOR=#363636
PREVIEW_IMG_WIDTH=1200
PREVIEW_IMG_HEIGHT=630
PREVIEW_DEFAULT_COVER_COLOR=#002549

Nginx配置

还没写完,咕咕咕咕