前后用过不少笔记本,从最早 EverNote、Typora+Dropbox、有道云笔记、腾讯 IMA、Obsidian,最终还是 Joplin 从中胜出,因为它满足了很多对笔记本的返璞归真的诉求:更开放的 WebDAV 同步方式、数据加密传输注重隐私安全、自由的导入导出 Markdown 格式,并且开源。
官方下载地址 https://joplinapp.org/download/
Windows 当前安装包为 Joplin-Setup-3.3.13.exe ,安装没有难度,一路点下去就行。
主界面如:
坚果云 WebDAV 同步配置界面:
如果还没有添加过应用的话先添加一个应用,就可以在页面上获取到 Joplin 需要的 WebDAV 服务器相关的配置:
1服务器地址: https://dav.jianguoyun.com/dav/
2账户:xxxxx
3密码:(应用密码)
要注意服务器地址填到 Joplin 的时候要带上用来存储和同步笔记的文件夹名称,例如已经在坚果云建好一个 Joplin 的文件夹,
填充 WebDAV 服务器信息:
这个时点击“同步”会提示“一个或多个主密钥需要密码”,就是要设置加密笔记的密码,避免在数据同步的过程中暴露隐私信息。
点击菜单栏“工具 - 选项”,在打开的“选项”页左侧菜单点击“加密”,点击“管理著密码”,填写好后点击“保存”即可。
可以看到已经成功启用加密。
点击下面的“返回”按钮,回到主界面再次尝试同步成功:
有两个“欢迎!”笔记本的原因是我已经在使用 Linux 版本和 Android App,可以在新设备同步之前先删掉本地的“欢迎!”笔记本。
菜单栏依次点开 “工具 - 选项”,在打开的“选项”页左侧菜单点击“插件”,可见默认安装了两个插件:
在搜索框依次搜索安装以下插件:
命令行安装:
1wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash
安装过程出现一个权限问题:
mkdir: 无法创建目录 "/home/demo1984s/.local/share/icons/hicolor/512x512": 权限不够
mkdir: 无法创建目录 "/home/demo1984s/.local/share/icons/hicolor/512x512/apps": 权限不够
mv: 无法将 '/tmp/tmp.dVcqwN1OuH/joplin.png' 移动至 '/home/demo1984s/.local/share/icons/hicolor/512x512/apps/joplin.png': 权限不够
解决方法就是手工创建目录和复制 icon 图片,然后将脚本下载下来,找到对应的目录创建和复制 icon 图片的代码行屏蔽掉,本地运行脚本后成功安装:
1bash Joplin_install_and_update.sh
修改过的 Joplin_install_and_update.sh
的完整文件内容如下:
1#!/usr/bin/env bash
2# wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash
3set -e
4
5trap 'handleError' ERR
6
7handleError() {
8 echo ""
9 echo "If you encountered an error, please consider fixing"
10 echo "the script for your environment and creating a pull"
11 echo "request instead of asking for support on GitHub or"
12 echo "the forum. The error message above should tell you"
13 echo "where and why the error happened."
14}
15
16#-----------------------------------------------------
17# Variables
18#-----------------------------------------------------
19# Only set colors, if tput available and TERM is recognized
20if [[ `command -v tput` && `tput setaf 1 2>/dev/null` ]]; then
21 COLOR_RED=`tput setaf 1`
22 COLOR_GREEN=`tput setaf 2`
23 COLOR_YELLOW=`tput setaf 3`
24 COLOR_BLUE=`tput setaf 4`
25 COLOR_RESET=`tput sgr0`
26fi
27SILENT=false
28ALLOW_ROOT=false
29SHOW_CHANGELOG=false
30INCLUDE_PRE_RELEASE=false
31INSTALL_DIR="${HOME}/.joplin" # default installation directory
32
33print() {
34 if [[ "${SILENT}" == false ]]; then
35 echo -e "$@"
36 fi
37}
38
39showLogo() {
40 print "${COLOR_BLUE}"
41 print " _ _ _ "
42 print " | | ___ _ __ | (_)_ __ "
43 print " _ | |/ _ \| '_ \| | | '_ \ "
44 print "| |_| | (_) | |_) | | | | | |"
45 print " \___/ \___/| .__/|_|_|_| |_|"
46 print " |_|"
47 print ""
48 print "Linux Installer and Updater"
49 print "${COLOR_RESET}"
50}
51
52showHelp() {
53 showLogo
54 print "Available Arguments:"
55 print "\t" "--help" "\t" "Show this help information" "\n"
56 print "\t" "--allow-root" "\t" "Allow the install to be run as root"
57 print "\t" "--changelog" "\t" "Show the changelog after installation"
58 print "\t" "--force" "\t" "Always download the latest version"
59 print "\t" "--silent" "\t" "Don't print any output"
60 print "\t" "--prerelease" "\t" "Check for new Versions including Pre-Releases"
61 print "\t" "--install-dir" "\t" "Set installation directory; default: \"${INSTALL_DIR}\""
62
63 if [[ ! -z $1 ]]; then
64 print "\n" "${COLOR_RED}ERROR: " "$*" "${COLOR_RESET}" "\n"
65 else
66 exit 0
67 fi
68}
69
70#-----------------------------------------------------
71# Setup Download Helper: DL
72#-----------------------------------------------------
73if [[ `command -v wget2` ]]; then
74 DL='wget2 -qO'
75elif [[ `command -v wget` ]]; then
76 DL='wget -qO'
77elif [[ `command -v curl` ]]; then
78 DL='curl -sLo'
79else
80 print "${COLOR_RED}Error: wget2, wget, and curl not found. Please install one of these tools.${COLOR_RESET}"
81 exit 1
82fi
83
84#-----------------------------------------------------
85# PARSE ARGUMENTS
86#-----------------------------------------------------
87optspec=":h-:"
88while getopts "${optspec}" OPT; do
89 [ "${OPT}" = " " ] && continue
90 if [ "${OPT}" = "-" ]; then # long option: reformulate OPT and OPTARG
91 OPT="${OPTARG%%=*}" # extract long option name
92 OPTARG="${OPTARG#$OPT}" # extract long option argument (may be empty)
93 OPTARG="${OPTARG#=}" # if long option argument, remove assigning `=`
94 fi
95 case "${OPT}" in
96 h | help ) showHelp ;;
97 allow-root ) ALLOW_ROOT=true ;;
98 silent ) SILENT=true ;;
99 force ) FORCE=true ;;
100 changelog ) SHOW_CHANGELOG=true ;;
101 prerelease ) INCLUDE_PRE_RELEASE=true ;;
102 install-dir ) INSTALL_DIR="$OPTARG" ;;
103 [^\?]* ) showHelp "Illegal option --${OPT}"; exit 2 ;;
104 \? ) showHelp "Illegal option -${OPTARG}"; exit 2 ;;
105 esac
106done
107shift $((OPTIND-1)) # remove parsed options and args from $@ list
108
109## Check and warn if running as root.
110if [[ $EUID = 0 ]] && [[ "${ALLOW_ROOT}" != true ]]; then
111 showHelp "It is not recommended (nor necessary) to run this script as root. To do so anyway, please use '--allow-root'"
112 exit 1
113fi
114
115#-----------------------------------------------------
116# START
117#-----------------------------------------------------
118showLogo
119
120#-----------------------------------------------------
121print "Checking architecture..."
122## uname actually gives more information than needed, but it contains all architectures (hardware and software)
123ARCHITECTURE=$(uname -m -p -i || echo "NO CHECK")
124
125if [[ $ARCHITECTURE = "NO CHECK" ]]; then
126 print "${COLOR_YELLOW}WARNING: Can't get system architecture, skipping check${COLOR_RESET}"
127elif [[ $ARCHITECTURE =~ .*aarch.*|.*arm.* ]]; then
128 showHelp "Arm systems are not officially supported by Joplin, please search the forum (https://discourse.joplinapp.org/) for more information"
129 exit 1
130elif [[ $ARCHITECTURE =~ .*i386.*|.*i686.* ]]; then
131 showHelp "32-bit systems are not supported by Joplin, please search the forum (https://discourse.joplinapp.org/) for more information"
132 exit 1
133fi
134
135#-----------------------------------------------------
136print "Checking dependencies..."
137## Check if libfuse2 is present.
138if [[ $(command -v ldconfig) ]]; then
139 LIBFUSE=$(ldconfig -p | grep "libfuse.so.2" || echo '')
140fi
141if [[ $LIBFUSE == "" ]]; then
142 LIBFUSE=$(find /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib -name "libfuse.so.2" 2>/dev/null | grep "libfuse.so.2" || echo '')
143fi
144if [[ $LIBFUSE == "" ]]; then
145 print "${COLOR_RED}Error: Can't get libfuse2 on system, please install libfuse2${COLOR_RESET}"
146 print "See https://joplinapp.org/help/faq/#desktop-application-will-not-launch-on-linux and https://github.com/AppImage/AppImageKit/wiki/FUSE for more information"
147 exit 1
148fi
149
150#-----------------------------------------------------
151# Download Joplin
152#-----------------------------------------------------
153
154# Get the latest version to download
155if [[ "$INCLUDE_PRE_RELEASE" == true ]]; then
156 RELEASE_VERSION=$($DL - "https://api.github.com/repos/laurent22/joplin/releases" | grep -Po '"tag_name": ?"v\K.*?(?=")' | sort -rV | head -1)
157else
158 RELEASE_VERSION=$($DL - "https://api.github.com/repos/laurent22/joplin/releases/latest" | grep -Po '"tag_name": ?"v\K.*?(?=")')
159fi
160
161# Check if it's in the latest version
162if [[ -e "${INSTALL_DIR}/VERSION" ]] && [[ $(< "${INSTALL_DIR}/VERSION") == "${RELEASE_VERSION}" ]]; then
163 print "${COLOR_GREEN}You already have the latest version${COLOR_RESET} ${RELEASE_VERSION} ${COLOR_GREEN}installed.${COLOR_RESET}"
164 ([[ "$FORCE" == true ]] && print "Forcing installation...") || exit 0
165else
166 [[ -e "${INSTALL_DIR}/VERSION" ]] && CURRENT_VERSION=$(< "${INSTALL_DIR}/VERSION")
167 print "The latest version is ${RELEASE_VERSION}, but you have ${CURRENT_VERSION:-no version} installed."
168fi
169
170# Check if it's an update or a new install
171DOWNLOAD_TYPE="New"
172if [[ -f "${INSTALL_DIR}/Joplin.AppImage" ]]; then
173 DOWNLOAD_TYPE="Update"
174fi
175
176#-----------------------------------------------------
177print 'Downloading Joplin...'
178TEMP_DIR=$(mktemp -d)
179$DL "${TEMP_DIR}/Joplin.AppImage" "https://objects.joplinusercontent.com/v${RELEASE_VERSION}/Joplin-${RELEASE_VERSION}.AppImage?source=LinuxInstallScript&type=$DOWNLOAD_TYPE"
180$DL "${TEMP_DIR}/joplin.png" https://joplinapp.org/images/Icon512.png
181
182#-----------------------------------------------------
183print 'Installing Joplin...'
184# Delete previous version (in future versions joplin.desktop shouldn't exist)
185rm -f "${INSTALL_DIR}"/*.AppImage ~/.local/share/applications/joplin.desktop "${INSTALL_DIR}/VERSION"
186
187# Creates the folder where the binary will be stored
188mkdir -p "${INSTALL_DIR}/"
189
190# Download the latest version
191mv "${TEMP_DIR}/Joplin.AppImage" "${INSTALL_DIR}/Joplin.AppImage"
192
193# Gives execution privileges
194chmod +x "${INSTALL_DIR}/Joplin.AppImage"
195
196print "${COLOR_GREEN}OK${COLOR_RESET}"
197
198#-----------------------------------------------------
199print 'Installing icon...'
200#mkdir -p ~/.local/share/icons/hicolor/512x512/apps
201#mv "${TEMP_DIR}/joplin.png" ~/.local/share/icons/hicolor/512x512/apps/joplin.png
202print "${COLOR_GREEN}OK${COLOR_RESET}"
203
204# Detect desktop environment
205if [ "$XDG_CURRENT_DESKTOP" = "" ]; then
206 DESKTOP=$(echo "${XDG_DATA_DIRS}" | sed 's/.*\(xfce\|kde\|gnome\).*/\1/')
207else
208 DESKTOP=$XDG_CURRENT_DESKTOP
209fi
210DESKTOP=${DESKTOP,,} # convert to lower case
211
212echo 'Create Desktop icon...'
213
214# Detect distribution environment, and apply --no-sandbox fix
215SANDBOXPARAM=""
216# lsb_release isn't available on some platforms (e.g. opensuse)
217# The equivalent of lsb_release in OpenSuse is the file /usr/lib/os-release
218if command -v lsb_release &> /dev/null; then
219 DISTVER=$(lsb_release -is) && DISTVER=$DISTVER$(lsb_release -rs)
220 DISTCODENAME=$(lsb_release -cs)
221 DISTMAJOR=$(lsb_release -rs|cut -d. -f1)
222
223 #-----------------------------------------------------
224 # Check for "The SUID sandbox helper binary was found, but is not configured correctly" problem.
225 # It is present in Debian 1X. A (temporary) patch will be applied at .desktop file
226 # Linux Mint 4 Debbie is based on Debian 10 and requires the same param handling.
227 #
228 # TODO: Remove: This is likely no longer an issue. See https://issues.chromium.org/issues/40462640.
229 BAD_HELPER_BINARY=false
230 if [[ $DISTVER =~ Debian1. || ( "$DISTVER" = "Linuxmint4" && "$DISTCODENAME" = "debbie" ) || ( "$DISTVER" = "CentOS" && "$DISTMAJOR" =~ 6|7 ) ]]; then
231 BAD_HELPER_BINARY=true
232 fi
233
234 # Work around Ubuntu 23.10+'s restrictions on unprivileged user namespaces. Electron
235 # uses these to sandbox processes. Unfortunately, it doesn't look like we can get around this
236 # without writing the AppImage to a non-user-writable location (without invalidating other security
237 # controls). See https://discourse.joplinapp.org/t/possible-future-requirement-for-no-sandbox-flag-for-ubuntu-23-10/.
238 HAS_USERNS_RESTRICTIONS=false
239 if [[ "$DISTVER" =~ ^Ubuntu && $DISTMAJOR -ge 23 ]]; then
240 HAS_USERNS_RESTRICTIONS=true
241 fi
242
243 if [[ $HAS_USERNS_RESTRICTIONS = true || $BAD_HELPER_BINARY = true ]]; then
244 SANDBOXPARAM="--no-sandbox"
245 print "${COLOR_YELLOW}WARNING${COLOR_RESET} Electron sandboxing disabled."
246 print " See https://discourse.joplinapp.org/t/32160/5 for details."
247 fi
248fi
249
250# Initially only desktop environments that were confirmed to use desktop files stored in
251# `.local/share/desktop` had a desktop file created.
252# However some environments don't return a desktop BUT still support these desktop files
253# the command check was added to support all Desktops that have support for the
254# freedesktop standard
255# The old checks are left in place for historical reasons, but
256# NO MORE DESKTOP ENVIRONMENTS SHOULD BE ADDED
257# If a new environment needs to be supported, then the command check section should be re-thought
258if [[ $DESKTOP =~ .*gnome.*|.*kde.*|.*xfce.*|.*mate.*|.*lxqt.*|.*unity.*|.*x-cinnamon.*|.*deepin.*|.*pantheon.*|.*lxde.*|.*i3.*|.*sway.* ]] || [[ `command -v update-desktop-database` ]]; then
259 DATA_HOME=${XDG_DATA_HOME:-~/.local/share}
260 DESKTOP_FILE_LOCATION="$DATA_HOME/applications"
261 # Only delete the desktop file if it will be replaced
262 rm -f "$DESKTOP_FILE_LOCATION/appimagekit-joplin.desktop"
263
264 # On some systems this directory doesn't exist by default
265 mkdir -p "$DESKTOP_FILE_LOCATION"
266
267 # No spaces or tabs should be used for indentation with Bash heredocs
268 cat >> "$DESKTOP_FILE_LOCATION/appimagekit-joplin.desktop" <<-EOF
269[Desktop Entry]
270Encoding=UTF-8
271Name=Joplin
272Comment=Joplin for Desktop
273Exec=env APPIMAGELAUNCHER_DISABLE=TRUE "${INSTALL_DIR}/Joplin.AppImage" ${SANDBOXPARAM} %u
274Icon=joplin
275StartupWMClass=Joplin
276Type=Application
277Categories=Office;
278MimeType=x-scheme-handler/joplin;
279# should be removed eventually as it was upstream to be an XDG specification
280X-GNOME-SingleWindow=true
281SingleMainWindow=true
282EOF
283
284 # Update application icons
285 [[ `command -v update-desktop-database` ]] && update-desktop-database "$DESKTOP_FILE_LOCATION" && update-desktop-database "$DATA_HOME/icons"
286 print "${COLOR_GREEN}OK${COLOR_RESET}"
287else
288 print "${COLOR_RED}NOT DONE, unknown desktop '${DESKTOP}'${COLOR_RESET}"
289fi
290
291#-----------------------------------------------------
292# FINISH INSTALLATION
293#-----------------------------------------------------
294
295# Informs the user that it has been installed
296print "${COLOR_GREEN}Joplin version${COLOR_RESET} ${RELEASE_VERSION} ${COLOR_GREEN}installed.${COLOR_RESET}"
297
298# Record version
299echo "$RELEASE_VERSION" > "${INSTALL_DIR}/VERSION"
300
301#-----------------------------------------------------
302if [[ "$SHOW_CHANGELOG" == true ]]; then
303 NOTES=$($DL - https://api.github.com/repos/laurent22/joplin/releases/latest | grep -Po '"body": "\K.*(?=")')
304 print "${COLOR_BLUE}Changelog:${COLOR_RESET}\n${NOTES}"
305fi
306
307#-----------------------------------------------------
308print "Cleaning up..."
309rm -rf "$TEMP_DIR"
310print "${COLOR_GREEN}OK${COLOR_RESET}"
安装也比较简单,下载好 apk 文件直接安装,部分手机需要先关闭纯净模式,安装好后再重新打开。
Markdown 无论是在技术文档、个人博客还是项目说明的编写上都是一个很好的选择,方便好用的工具不多,希望这篇对开源笔记 Joplin 的介绍内容能够帮助你释放 Markdown 更大的潜力,让你的写作更加方便放心!
安装过程中有问题的欢迎留言!