Zhiyi Zhang | 3aaf06d | 2020-10-17 13:05:36 -0700 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | |
| 3 | # compile and install ndncert |
| 4 | git clone https://github.com/Zhiyi-Zhang/ndncert.git |
| 5 | cd ndncert |
| 6 | git checkout origin/v0.3 |
| 7 | ./waf configure |
| 8 | ./waf install |
| 9 | |
| 10 | # set up systemd file for linux service |
| 11 | sudo cp ./build/systemd/ndncert-server.service /etc/systemd/system/ |
| 12 | sudo chmod 644 /etc/systemd/system/ndncert-server.service |
| 13 | |
| 14 | # update CA configuration file |
| 15 | echo -e "{\n\"ca-prefix\": \"/ndn\",\n\"ca-info\": \"NDN testbed root CA\",\n\"max-validity-period\": \"1296000\",\n\"max-suffix-length\": \"2\",\n\"supported-challenges\":\n[\n{ \"challenge\": \"pin\" }\n]\n}" > /usr/local/etc/ndncert/ca.conf |
| 16 | |
| 17 | # sudo HOME=/var/lib/ndn/ndncert-ca -u ndn ndnsec-keygen /ndn |
| 18 | |
| 19 | # prepare |
| 20 | mkdir /var/lib/ndn/ndncert-ca |
| 21 | chown ndn /var/lib/ndn/ndncert-ca |
| 22 | |
| 23 | # run the CA |
| 24 | sudo systemctl start ndncert-server |
| 25 | |
| 26 | # check the status to make sure everything is correct |
| 27 | sudo systemctl status ndncert-server |