| 16 | |
| 17 | Configure extra disk (if applicable) |
| 18 | {{{ |
| 19 | sudo mkfs -t xfs /dev/nvme1n1 |
| 20 | sudo mkdir /data |
| 21 | sudo mount /dev/nvme1n1 /data |
| 22 | sudo cp /etc/fstab /etc/fstab.orig |
| 23 | sudo lsblk -o +UUID |
| 24 | }}} |
| 25 | |
| 26 | Update /etc/fstab with new line including UUID from above: |
| 27 | {{{ |
| 28 | UUID=4cec62c2-7f6b-4141-86f7-8c2a38e6f3fa /data xfs defaults,nofail 0 2 |
| 29 | sudo umount /data |
| 30 | sudo mount -a |
| 31 | sudo chown ubuntu:ubuntu /data |
| 32 | }}} |
| 33 | |
| 34 | ==== Install Prerequisite Packages ==== |
| 35 | |
| 36 | Install npm version manager |
| 37 | {{{ |
| 38 | curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o n |
| 39 | sudo bash n lts |
| 40 | sudo npm install -g n |
| 41 | }}} |
| 42 | |
| 43 | Install nginx and pm2 |
| 44 | {{{ |
| 45 | sudo apt update |
| 46 | sudo apt install nginx |
| 47 | sudo npm install pm2 -g |
| 48 | }}} |
| 49 | |
| 50 | |
| 51 | ==== Install Spatial Service Discovery ==== |
| 52 | |
| 53 | Create a folder for the code and build files. The path is your choice. |
| 54 | {{{ |
| 55 | mkdir /data/ssddev |
| 56 | cd /data/ssddev |
| 57 | }}} |
| 58 | |
| 59 | Create a folder for data store. The path is your choice, but it should be added in the .env file in variable KAPPA_CORE_DIR later below. |
| 60 | |
| 61 | {{{ |
| 62 | mkdir data |
| 63 | git clone https://github.com/OpenArCloud/oscp-spatial-service-discovery.git |
| 64 | cd oscp-spatial-service-discovery |
| 65 | }}} |
| 66 | |
| 67 | Disable authentication (optional, not recommended for production deployment): |
| 68 | {{{ |
| 69 | cp src/router-noauth.ts src/router.ts |
| 70 | }}} |
| 71 | |
| 72 | Install the dependencies and build the project: |
| 73 | {{{ |
| 74 | npm install |
| 75 | npm run-script build |
| 76 | }}} |
| 77 | |
| 78 | Add an appropriate .env file: |
| 79 | {{{ |
| 80 | touch .env |
| 81 | nano .env |
| 82 | }}} |
| 83 | |
| 84 | and make sure it contains |
| 85 | {{{ |
| 86 | KAPPA_CORE_DIR="/home/native/dev/ssd_data" |
| 87 | SWARM_TOPIC_PREFIX="orbit_ssd" |
| 88 | AUTH0_ISSUER=https://ssd-oscp.us.auth0.com/ |
| 89 | AUTH0_AUDIENCE=https://ssd.orbit-lab.org |
| 90 | COUNTRIES=AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GR,HR,HU,IE,IT,LT,LV,LU,MT,NL,PL,PT,RO,SE,SI,SK,US |
| 91 | PORT=4100 |
| 92 | }}} |
| 93 | |
| 94 | '''WARNING:''' ''having or not having trailing slash in the domain (AUTH0_AUDIENCE) must match the entry in Auth0! In addition, the way we extract username from Java Web Tokens with jwt-decode library assumes that there is no trailing slash in the audience URI.'' |
| 95 | |
| 96 | '''WARNING:''' ''the trailing / in AUTH0_ISSUER seems to be important, otherwise the client’s POST request return with error that https://ssd-oscp.us.auth0.com.well-known is not found.'' |
| 97 | |
| 98 | Start the service: |
| 99 | {{{ |
| 100 | pm2 start dist/server.js --name ssd_orbit |
| 101 | }}} |
| 102 | |
| 103 | ==== Install Spatial Content Discovery Service ==== |
| 104 | |
| 105 | Create a folder for the code and build files. The path is your choice. |
| 106 | {{{ |
| 107 | mkdir /data/scddev |
| 108 | cd /data/scddev |
| 109 | }}} |
| 110 | |
| 111 | Create a folder for data store. The path is your choice, but it should be added in the .env file below |
| 112 | {{{ |
| 113 | mkdir data |
| 114 | git clone https://github.com/OpenArCloud/oscp-spatial-content-discovery.git |
| 115 | cd oscp-spatial-content-discovery |
| 116 | }}} |
| 117 | |
| 118 | Disable authentication (optional, not recommended for production): |
| 119 | {{{ |
| 120 | cp src/router-noauth.ts src/router.ts |
| 121 | }}} |
| 122 | |
| 123 | Install the dependencies and build the project: |
| 124 | {{{ |
| 125 | npm install |
| 126 | npm run-script build |
| 127 | }}} |
| 128 | |
| 129 | Add an appropriate .env file: |
| 130 | {{{ |
| 131 | touch .env |
| 132 | nano .env |
| 133 | }}} |
| 134 | |
| 135 | with |
| 136 | {{{ |
| 137 | KAPPA_CORE_DIR="/home/native/dev/scd_data" |
| 138 | AUTH0_ISSUER=https://scd-oscp.us.auth0.com/ |
| 139 | AUTH0_AUDIENCE=https://scd.orbit-lab.org |
| 140 | GEOZONE="4671654" |
| 141 | TOPICS="transit,history,entertainment,general" |
| 142 | PORT=3100 |
| 143 | }}} |
| 144 | |
| 145 | '''WARNING:''' ''having or not having trailing slash in the domain (AUTH0_AUDIENCE) must match the entry in auth0'' |
| 146 | |
| 147 | '''WARNING:''' ''the trailing / in AUTH0_ISSUER seems to be important, otherwise the client’s POST request return with error that https://scd-oscp.us.auth0.com.well-known is not found'' |
| 148 | |
| 149 | Start the service: |
| 150 | {{{ |
| 151 | pm2 start dist/server.js --name scd_orbit |
| 152 | }}} |
| 153 | |
| 154 | |
| 155 | |