-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall-requirements.sh
More file actions
46 lines (35 loc) · 1.24 KB
/
Copy pathinstall-requirements.sh
File metadata and controls
46 lines (35 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
USER_ID=`id -u`
if [[ "$USER_ID" != "0" ]]
then
echo "$0: You must run this script as root: $USER_ID"
exit 1
fi
if [[ -f /etc/default/joplinrc ]];then
. /etc/default/joplinrc
else
echo ""
fi
JOPLIN_HOME="${JOPLIN_HOME:-/opt/joplin}"
apt update
apt -y install vim git
## install nodejs 16
# from https://github.com/nodesource/distributions
# remove old version
apt-get -y purge nodejs npm
# add repo
apt-get -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
apt-get install -y nodejs
# in case we need to compile modules
apt -y install build-essential python
# install the Yarn package manager
#curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
#echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# apt-get update && apt-get install yarn
# yarn is self contained in nodejs 16 but needs to be enabled:
corepack enable
JOPLIN_USER=joplin
id -u $JOPLIN_USER &>/dev/null || sudo useradd --create-home --shell /bin/bash $JOPLIN_USER
mkdir -p $JOPLIN_HOME
chown $JOPLIN_USER: $JOPLIN_HOME