Skip to content

Commit

Permalink
Merge pull request #131 from PermanentOrg/noissue-update-node
Browse files Browse the repository at this point in the history
Update node installation + SFTP node version
  • Loading branch information
cecilia-donnelly authored Sep 6, 2023
2 parents dc16b68 + b3b806c commit 2cbddf3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
21 changes: 10 additions & 11 deletions provisioners/configure-sftp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,22 @@ echo $PERM_ENV > /data/www/host.txt

echo "Add custom sources"
cp $TEMPLATES_PATH/usr/share/keyrings/*.asc /usr/share/keyrings/
cp $TEMPLATES_PATH/etc/apt/sources.list.d/*.sources /etc/apt/sources.list.d/

# Set up the correct node source
export NODE_VERSION=18
envsubst \
< $TEMPLATES_PATH/etc/apt/sources.list.d/nodesource.sources \
> /etc/apt/sources.list.d/nodesource.sources

echo "Install packages"
apt -qq update
apt -qq install -y \
curl \
wget \
nginx \
nginx-extras \
unzip

echo "Install NodeJs"
# The way to pin to a specific version of node is to load directly
# See https://github.com/nodesource/distributions/issues/33#issuecomment-169345680
curl -o nodejs.deb https://deb.nodesource.com/node_16.x/pool/main/n/nodejs/nodejs_16.17.1-deb-1nodesource1_amd64.deb
apt -y install ./nodejs.deb
rm ./nodejs.deb
nginx-extras \
nodejs \
unzip \
wget

# Make sure nodejs exists
if ! [[ -f /usr/bin/nodejs ]]
Expand Down
10 changes: 6 additions & 4 deletions provisioners/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ echo "Add custom sources"
cp $TEMPLATES_PATH/usr/share/keyrings/*.asc /usr/share/keyrings/
cp $TEMPLATES_PATH/etc/apt/sources.list.d/*.sources /etc/apt/sources.list.d/

# Set up the correct node source
export NODE_VERSION=14
envsubst \
< $TEMPLATES_PATH/etc/apt/sources.list.d/nodesource.sources \
> /etc/apt/sources.list.d/nodesource.sources

echo "Install packages"
apt-get -qq update
apt-get -qq install -y \
Expand Down Expand Up @@ -71,10 +77,6 @@ then
update-alternatives --quiet --install /usr/bin/nodejs nodejs /usr/bin/node 50 --slave /usr/share/man/man1/nodejs.1.gz nodejs.1.gz /usr/share/man/man1/node.1.gz
fi

# Update nodejs to version 14
npm install -g n
n 14.18.3

# Install dbmate directly, since it isn't packaged
echo "Install dbmate"
curl -L -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/download/v1.16.0/dbmate-linux-amd64
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/apt/sources.list.d/nodesource.sources
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Types: deb
URIs: https://deb.nodesource.com/node_12.x
URIs: https://deb.nodesource.com/node_${NODE_VERSION}.x
Suites: buster
Components: main
Signed-By: /usr/share/keyrings/nodesource-archive-keyring.asc

0 comments on commit 2cbddf3

Please sign in to comment.