Browse Source

Use new global modules directory for scuttlebot

Bob Mottram 7 years ago
parent
commit
3f16b9b3de
2 changed files with 13 additions and 10 deletions
  1. 10
    10
      src/freedombone-app-scuttlebot
  2. 3
    0
      src/freedombone-base-tripwire

+ 10
- 10
src/freedombone-app-scuttlebot View File

@@ -259,14 +259,14 @@ function git_ssb_script {
259 259
 
260 260
 function scuttlebot_git_setup {
261 261
     if [[ "$1" == "mesh" ]]; then
262
-        if [ ! -d "$rootdir/usr/local/lib/node_modules/git-ssb/node_modules/git-ssb-web/highlight" ]; then
263
-            mkdir "$rootdir/usr/local/lib/node_modules/git-ssb/node_modules/git-ssb-web/highlight"
262
+        if [ ! -d "$rootdir/root/.npm-global/node_modules/git-ssb/node_modules/git-ssb-web/highlight" ]; then
263
+            mkdir "$rootdir/root/.npm-global/node_modules/git-ssb/node_modules/git-ssb-web/highlight"
264 264
         fi
265
-        if [ ! -f "$rootdir/usr/local/lib/node_modules/git-ssb/node_modules/highlight.js/styles/foundation.css" ]; then
265
+        if [ ! -f "$rootdir/root/.npm-global/node_modules/git-ssb/node_modules/highlight.js/styles/foundation.css" ]; then
266 266
             echo $'Could not find foundation.css'
267 267
             exit 347687245
268 268
         fi
269
-        cp "$rootdir/usr/local/lib/node_modules/git-ssb/node_modules/highlight.js/styles/foundation.css" "$rootdir/usr/local/lib/node_modules/git-ssb/node_modules/git-ssb-web/highlight/foundation.css"
269
+        cp "$rootdir/root/.npm-global/node_modules/git-ssb/node_modules/highlight.js/styles/foundation.css" "$rootdir/root/.npm-global/node_modules/git-ssb/node_modules/git-ssb-web/highlight/foundation.css"
270 270
 
271 271
         git_ssb_nginx_site=$rootdir/etc/nginx/sites-available/git_ssb
272 272
         { echo 'server {';
@@ -284,14 +284,14 @@ function scuttlebot_git_setup {
284 284
             exit 7357225
285 285
         fi
286 286
 
287
-        if [ ! -d /usr/local/lib/node_modules/git-ssb/node_modules/git-ssb-web/highlight ]; then
288
-            mkdir /usr/local/lib/node_modules/git-ssb/node_modules/git-ssb-web/highlight
287
+        if [ ! -d /root/.npm-global/node_modules/git-ssb/node_modules/git-ssb-web/highlight ]; then
288
+            mkdir /root/.npm-global/node_modules/git-ssb/node_modules/git-ssb-web/highlight
289 289
         fi
290
-        if [ ! -f /usr/local/lib/node_modules/git-ssb/node_modules/highlight.js/styles/foundation.css ]; then
290
+        if [ ! -f /root/.npm-global/node_modules/git-ssb/node_modules/highlight.js/styles/foundation.css ]; then
291 291
             echo $'Could not find foundation.css'
292 292
             exit 347687245
293 293
         fi
294
-        cp /usr/local/lib/node_modules/git-ssb/node_modules/highlight.js/styles/foundation.css /usr/local/lib/node_modules/git-ssb/node_modules/git-ssb-web/highlight/foundation.css
294
+        cp /root/.npm-global/node_modules/git-ssb/node_modules/highlight.js/styles/foundation.css /root/.npm-global/node_modules/git-ssb/node_modules/git-ssb-web/highlight/foundation.css
295 295
 
296 296
         git_ssb_nginx_site=/etc/nginx/sites-available/${SCUTTLEBOT_DOMAIN_NAME}
297 297
         function_check nginx_http_redirect
@@ -313,7 +313,7 @@ function scuttlebot_git_setup {
313 313
     fi
314 314
 
315 315
     { echo '';
316
-      echo '  root /usr/local/lib/node_modules/git-ssb/node_modules/git-ssb-web;';
316
+      echo '  root /root/.npm-global/node_modules/git-ssb/node_modules/git-ssb-web;';
317 317
       echo '';
318 318
       echo '  location = / {';
319 319
       echo "    proxy_pass http://localhost:${GIT_SSB_PORT};";
@@ -339,7 +339,7 @@ function scuttlebot_git_setup {
339 339
           echo '  add_header X-Content-Type-Options nosniff;';
340 340
           echo '  add_header X-Frame-Options SAMEORIGIN;';
341 341
           echo '';
342
-          echo '  root /usr/local/lib/node_modules/git-ssb/node_modules/git-ssb-web;';
342
+          echo '  root /root/.npm-global/node_modules/git-ssb/node_modules/git-ssb-web;';
343 343
           echo '';
344 344
           echo '  location = / {';
345 345
           echo "    proxy_pass http://localhost:${GIT_SSB_PORT};";

+ 3
- 0
src/freedombone-base-tripwire View File

@@ -122,6 +122,9 @@ function install_tripwire {
122 122
     if ! grep -q '!/usr/local/lib/node_modules' /etc/tripwire/twpol.txt; then
123 123
         sed -i '\|/etc\t\t->.*|a\    !/usr/local/lib/node_modules ;' /etc/tripwire/twpol.txt
124 124
     fi
125
+    if ! grep -q '!/root/.npm-global/node_modules' /etc/tripwire/twpol.txt; then
126
+        sed -i '\|/etc\t\t->.*|a\    !/root/.npm-global/node_modules ;' /etc/tripwire/twpol.txt
127
+    fi
125 128
     # Events here are likely due to USB HRNG activity
126 129
     if ! grep -q '!/dev/char' /etc/tripwire/twpol.txt; then
127 130
         sed -i '\|/dev\t\t->.*|a\    !/dev/char ;' /etc/tripwire/twpol.txt