-
Notifications
You must be signed in to change notification settings - Fork 5
Ubuntu Setup
Stefan Peters edited this page Sep 9, 2019
·
3 revisions
Note: This was written as a step-by-step guide for configuring a fresh VirtualBox VM with Ubuntu 18.04 and installing all the necessary software to run Cocoda and jskos-server. If you want to install it on your existing Ubuntu machine, you can skip certain steps.
- Install Ubuntu 18.04 (user: cocoda, pw: mapping)
- Install software updates and restart
- Install VirtualBox Guest Additions and restart
- (if necessary) Go to Settings -> Devices -> Displays and increase resolution
- Settings -> Power -> Power Saving: Turn "Blank screen" to "Never"
- Open Terminal (ctrl+alt+t)
sudo apt install -y git curl jq chromium-browser cpanminus librdf-query-perl librdf-query-client-perl build-essential
sudo update-alternatives --set x-www-browser /usr/bin/chromium-browser
- Add chromium to favorites and move to top in Dock
- Remove Firefox from favorites
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
source ~/.bashrc
nvm install stable
- Go to https://github.com/VSCodium/vscodium/releases and copy download URL for latest
_amd64.deb
release wget <copied url>
sudo apt install ./<downloaded file>
rm <downloaded file>
codium --install-extension octref.vetur
codium --install-extension buster.ndjson-colorizer
codium --install-extension dbaeumer.vscode-eslint
echo '{"editor.wordWrap":"on","editor.tabSize":2,"files.trimTrailingWhitespace":true,"files.insertFinalNewline":true,"files.trimFinalNewlines":true,"eslint.autoFixOnSave":true,"eslint.validate":["javascript",{"language":"vue","autoFix":true}]}' | jq . > ~/.config/VSCodium/User/settings.json
- -> can now be used with
codium
For updated version, see here.
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt update
sudo apt install -y mongodb-org
sudo systemctl start mongod.service
sudo systemctl enable mongod.service
npm i -g pm2
-
pm2 startup
-> run command printed! npm i -g http-server
npm i -g jskos-cli
cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) && cpanm App::skos2jskos
mkdir ~/coli-conc
cd ~/coli-conc
git clone https://github.com/gbv/jskos-server.git
cd jskos-server
npm ci
- Create config:
node -e 'let noAuth={auth:false,crossUser:true},config={};for(let type of ["mappings","annotations"]){config[type]={};for(let action of ["read","create","update","delete"]){config[type][action]=noAuth}};console.log(JSON.stringify(config))' | jq . > config/config.json
pm2 start ecosystem.config.json
- Check if jskos-server is running:
curl -s http://localhost:3000/status | jq .ok
(should return 1) pm2 save
cd ~/coli-conc
git clone https://github.com/gbv/cocoda.git
cd cocoda
npm ci
- Create config:
node -e 'console.log(JSON.stringify({registries:[{provider:"MappingsApi",uri:"http://localhost:3000",status:"http://localhost:3000/status",autoRefresh:5000,subject:[{uri:"http://coli-conc.gbv.de/registry-group/existing-mappings"}],notation:["CT"],prefLabel:{en:"Concordance Registry (local)"}}]}))' | jq . > config/cocoda.json
npm run build
echo '{"name":"cocoda","script":"http-server dist/"}' > ecosystem.config.json && pm2 start ecosystem.config.json && pm2 save
pm2 start http-server --name "cocoda" -- dist/
pm2 save
- Cocoda should now be available under http://localhost:8080/.