概述
Joplin是一个免费、开源的笔记和待办事项的软件。支持搜索,笔记格式是 Markdown。Github
从 Evernote/印象笔记 导出的笔记可以导入Joplin,包括格式化的内容、图像和完整的元数据。全文搜索在所有平台上都可用,以快速找到你需要的信息。支持网页剪裁,可以从你的浏览器中保存网页和截图。
软件开箱即用。可用于 Windows、Linux、macOS、Android 和 iOS。也可用于Firefox和Chrome。
为什么需要自建Joplin Cloud
一句话总结,效率更高,而且更稳定。Joplin虽然可以采用WebDAV协议同步,但是效率低下。WebDAV协议在同步前需要下载完整的文件列表,以便比较本地和远程项目。Joplin服务器不需要在同步时为文件加锁,因为数据的一致性是由客户端本地处理的。
个人自建地址(可申请使用):https://joplin.yisrime.xyz/
搭建
建议使用PostgreSQL,本文采用默认的SQLite作为数据库,如已安装PostgreSQL可在下面.env中自行填写数据库相关参数并取消注释。
由于外部访问地址采用SSL证书加密,所以这里的APP_BASE_URL
需要填写成http://www.example.com:443
需要编辑Joplin.env
或使用-e
指定参数,下面提供一份模板,可根据需要自行修改:
# =============================================================================
# PRODUCTION CONFIG EXAMPLE
# -----------------------------------------------------------------------------
# By default it will use SQLite, but that's mostly to test and evaluate the
# server. So you'll want to specify db connection settings to use Postgres.
# =============================================================================
#
# APP_BASE_URL=https://example.com/joplin
# APP_PORT=22300
#
# DB_CLIENT=pg
# POSTGRES_PASSWORD=joplin
# POSTGRES_DATABASE=joplin
# POSTGRES_USER=joplin
# POSTGRES_PORT=5432
# POSTGRES_HOST=localhost
# =============================================================================
# DEV CONFIG EXAMPLE
# -----------------------------------------------------------------------------
# Example of local config, for development. In dev mode, you would usually use
# SQLite so database settings are not needed.
# =============================================================================
#
APP_BASE_URL=http://www.example.com:443
APP_PORT=22300
运行以下命令后,即可部署完成,开放端口为22300
,可根据需要自行修改。
docker run -d --name=joplin --restart=unless-stopped --env-file /root/Joplin/Joplin.env --net=host joplin/server:latest
添加Nginx反向代理
配置模板如下,可根据需要自行修改
server {
listen 443 ssl;
http2 on;
server_name www.example.com;
ssl_certificate /etc/nginx/cert/cf.pem;
ssl_certificate_key /etc/nginx/cert/cf.key;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA;
ssl_prefer_server_ciphers off;
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://0.0.0.0:8000;
}
}
server {
listen 80;
server_name www.example.com;
return 301 https://$host$request_uri;
}