adds install script, modifies icon

This commit is contained in:
Lars Berning 2021-03-31 19:41:12 +01:00
parent 61c3d5be8d
commit 89883dab2d
5 changed files with 141 additions and 29 deletions

View File

@ -47,7 +47,8 @@
<div class="col">
<div class="label">
<svg aria-hidden="true" focusable="false" class="icon" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 303.46 303.46">
<path fill="currentColor" d="m254.8 278.23-103.07-103.07-103.07 103.07c-18.349 0.91143-22.401-4.2351-21.213-21.213l103.07-103.07-19.755-19.755c-20.183-1.639-63.38-27.119-70.631-34.37l-30.474-30.474c-5.224-5.224-8.101-12.168-8.101-19.555s2.877-14.332 8.102-19.555l18.365-18.365c5.223-5.224 12.167-8.1 19.554-8.1s14.331 2.876 19.554 8.1l30.475 30.475c6.162 6.163 16.762 25.271 22.383 36.609 7.431 14.991 11.352 25.826 11.979 34.014l19.763 19.763 19.762-19.762c0.627-8.188 4.548-19.023 11.98-34.015 5.621-11.34 16.221-30.447 22.383-36.609l30.475-30.475c5.223-5.224 12.167-8.1 19.554-8.1s14.331 2.876 19.554 8.1l18.366 18.366c10.781 10.781 10.782 28.325 1e-3 39.107l-30.476 30.475c-7.25 7.252-50.443 32.731-70.63 34.37l-19.756 19.756 103.07 103.07c-1 17.227-4.2977 21.56-21.214 21.213z"/>
<path fill="currentColor" d="m 227.09519,291.792 c -9.27334,6.46902 -18.50229,6.42126 -27.35848,0 V 166.229 C 179.68478,128.57023 170.63825,79.235679 170.55482,65.615681 L 170.555,23.006274 C 170.39325,3.814744 175.68769,3.03457 189.68037,2.933 l 46.51584,1.538e-4 C 251.41795,2.9332041 256.53801,3.7540456 256.277,23 v 42.754971 c 0.0831,13.51506 -10.25538,62.158079 -29.18168,100.474139 z"/>
<path fill="currentColor" d="m 78.96229,10.659928 c 9.273338,-6.8927389 18.926007,-7.2686989 27.35848,0 V 136.22293 c 20.05193,37.65877 29.09846,86.99331 29.18189,100.61331 l -1.8e-4,42.60941 c 0.16175,19.19153 -5.13269,19.9717 -19.12537,20.07327 l -46.51584,-1.5e-4 c -15.22174,-5e-5 -20.3418,-0.8209 -20.08079,-20.06685 v -42.75497 c -0.0831,-13.51506 10.25538,-62.15807 29.18168,-100.47413 z"/>
</svg>
</div>
<div class="content">

81
install/install.sh Executable file
View File

@ -0,0 +1,81 @@
#!/bin/bash
#
# Open Rowing Monitor, https://github.com/laberning/openrowingmonitor
#
# Installation script for Open Rowing Monitor, use at your own risk!
#
# treat unset variables as an error when substituting
set -u
# exit when a command fails
set -e
print() {
printf "%s\n" "$@"
}
cancel() {
print "$@"
exit 1
}
print "Installation script for Open Rowing Monitor"
if [[ "$(uname -n)" != "raspberrypi" ]]; then
cancel "This script currently only works on Raspberry Pi OS, you will have to do a manual installation."
fi
print "This script will set up Open Rowing Monitor on a Raspberry Pi 3 / 4 with Raspberry Pi OS (lite)."
print "You should only run this script on a SD Card that does not contain any important other data."
VERSION=$(grep -oP '(?<=^VERSION=).+' /etc/os-release | tr -d '"')
if [[ $VERSION != "10 (buster)" ]]; then
print "Warning: So far this install script has only been tested with Raspberry Pi OS 10 (buster)."
print "You are running Raspberry Pi OS $VERSION, are you sure that you want to continue?"
fi
read -p "Press RETURN to continue or CTRL + C to abort"
print "installing dependencies..."
sudo apt-get -y update
sudo apt-get -y dist-upgrade
sudo systemctl disable bluetooth
sudo apt-get -y install bluetooth bluez libbluetooth-dev libudev-dev git
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
print "installing openrowingmonitor..."
INSTALL_DIR="/opt/openrowingmonitor"
GIT_REMOTE="https://github.com/laberning/openrowingmonitor.git"
if ! [[ -d "${INSTALL_DIR}" ]]; then
sudo mkdir -p $INSTALL_DIR
fi
cd $INSTALL_DIR
# get project code from repository
sudo git init -q
sudo git config remote.origin.url $GIT_REMOTE
sudo git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
# prevent altering line endings
sudo git config core.autocrlf false
sudo git fetch --force origin
sudo git fetch --force --tags origin
sudo git reset --hard origin/main
# otherwise node-gyp would fail while building the system dependencies
sudo npm config set user 0
print "downloading and compiling dependencies..."
sudo npm install
sudo npm run build
sudo cp install/openrowingmonitor.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable openrowingmonitor
sudo systemctl restart openrowingmonitor
print "installation finished"
print "Open Rowing Monitor should now be up and running... (open http://<ip-of-this-device> to verify)"

View File

@ -0,0 +1,13 @@
[Unit]
Description=Open Rowing Monitor
After=multi-user.target
[Service]
Type=simple
User=root
Restart=on-failure
WorkingDirectory=/opt/openrowingmonitor
ExecStart=npm start
[Install]
WantedBy=multi-user.target

69
package-lock.json generated
View File

@ -726,9 +726,9 @@
}
},
"esbuild": {
"version": "0.9.6",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.9.6.tgz",
"integrity": "sha512-F6vASxU0wT/Davt9aj2qtDwDNSkQxh9VbyO56M7PDWD+D/Vgq/rmUDGDQo7te76W5auauVojjnQr/wTu3vpaUA==",
"version": "0.9.7",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.9.7.tgz",
"integrity": "sha512-VtUf6aQ89VTmMLKrWHYG50uByMF4JQlVysb8dmg6cOgW8JnFCipmz7p+HNBl+RR3LLCuBxFGVauAe2wfnF9bLg==",
"dev": true
},
"escape-html": {
@ -743,9 +743,9 @@
"dev": true
},
"eslint": {
"version": "7.22.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz",
"integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.23.0.tgz",
"integrity": "sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q==",
"dev": true,
"requires": {
"@babel/code-frame": "7.12.11",
@ -1454,9 +1454,9 @@
}
},
"husky": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/husky/-/husky-5.2.0.tgz",
"integrity": "sha512-AM8T/auHXRBxlrfPVLKP6jt49GCM2Zz47m8G3FOMsLmTv8Dj/fKVWE0Rh2d4Qrvmy131xEsdQnb3OXRib67PGg==",
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/husky/-/husky-6.0.0.tgz",
"integrity": "sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==",
"dev": true
},
"iconv-lite": {
@ -1795,6 +1795,12 @@
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=",
"dev": true
},
"lodash.debounce": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
@ -1812,6 +1818,12 @@
"integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=",
"dev": true
},
"lodash.truncate": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz",
"integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=",
"dev": true
},
"loglevel": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.7.1.tgz",
@ -2770,9 +2782,9 @@
}
},
"rollup": {
"version": "2.42.3",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.42.3.tgz",
"integrity": "sha512-JjaT9WaUS5vmjy6xUrnPOskjkQg2cN4WSACNCwbOvBz8VDmbiKVdmTFUoMPRqTud0tsex8Xy9/boLbDW9HKD1w==",
"version": "2.44.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.44.0.tgz",
"integrity": "sha512-rGSF4pLwvuaH/x4nAS+zP6UNn5YUDWf/TeEU5IoXSZKBbKRNTCI3qMnYXKZgrC0D2KzS2baiOZt1OlqhMu5rnQ==",
"dev": true,
"requires": {
"fsevents": "~2.3.1"
@ -3119,21 +3131,26 @@
}
},
"table": {
"version": "6.0.7",
"resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz",
"integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==",
"version": "6.0.9",
"resolved": "https://registry.npmjs.org/table/-/table-6.0.9.tgz",
"integrity": "sha512-F3cLs9a3hL1Z7N4+EkSscsel3z55XT950AvB05bwayrNg5T1/gykXtigioTAjbltvbMSJvvhFCbnf6mX+ntnJQ==",
"dev": true,
"requires": {
"ajv": "^7.0.2",
"lodash": "^4.17.20",
"ajv": "^8.0.1",
"is-boolean-object": "^1.1.0",
"is-number-object": "^1.0.4",
"is-string": "^1.0.5",
"lodash.clonedeep": "^4.5.0",
"lodash.flatten": "^4.4.0",
"lodash.truncate": "^4.4.2",
"slice-ansi": "^4.0.0",
"string-width": "^4.2.0"
},
"dependencies": {
"ajv": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-7.2.3.tgz",
"integrity": "sha512-idv5WZvKVXDqKralOImQgPM9v6WOdLNa0IY3B3doOjw/YxRGT8I+allIJ6kd7Uaj+SF1xZUSU+nPM5aDNBVtnw==",
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.0.2.tgz",
"integrity": "sha512-V0HGxJd0PiDF0ecHYIesTOqfd1gJguwQUOYfMfAWnRsWQEXfc5ifbUFhD3Wjc+O+y7VAqL+g07prq9gHQ/JOZQ==",
"dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
@ -3317,15 +3334,15 @@
"dev": true
},
"unbox-primitive": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.0.tgz",
"integrity": "sha512-P/51NX+JXyxK/aigg1/ZgyccdAxm5K1+n8+tvqSntjOivPt19gvm1VC49RWYetsiub8WViUchdxl/KWHHB0kzA==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
"integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
"has-bigints": "^1.0.0",
"has-symbols": "^1.0.0",
"which-boxed-primitive": "^1.0.1"
"has-bigints": "^1.0.1",
"has-symbols": "^1.0.2",
"which-boxed-primitive": "^1.0.2"
}
},
"unpipe": {

View File

@ -34,12 +34,12 @@
"ws": "^7.4.4"
},
"devDependencies": {
"eslint": "^7.22.0",
"eslint": "^7.23.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"husky": "^5.1.3",
"husky": "^6.0.0",
"markdownlint-cli": "^0.27.1",
"npm-run-all": "^4.1.5",
"snowpack": "^3.1.2",