Bladeren bron

No tahoelafs web

Bob Mottram 8 jaren geleden
bovenliggende
commit
fe55f2976e
1 gewijzigde bestanden met toevoegingen van 43 en 37 verwijderingen
  1. 43
    37
      src/freedombone-app-tahoelafs

+ 43
- 37
src/freedombone-app-tahoelafs Bestand weergeven

@@ -32,13 +32,13 @@
32 32
 VARIANTS='full full-vim cloud'
33 33
 
34 34
 IN_DEFAULT_INSTALL=0
35
-SHOW_ON_ABOUT=1
35
+SHOW_ON_ABOUT=0
36 36
 
37 37
 TAHOELAFS_REPO="https://github.com/tahoe-lafs/tahoe-lafs"
38 38
 TAHOELAFS_COMMIT='bb782b0331a60de438136a593bba18338d8d866b'
39 39
 
40 40
 TAHOELAFS_PORT=50213
41
-TAHOELAFS_WEB_PORT=50214
41
+#TAHOELAFS_WEB_PORT=50214
42 42
 TAHOELAFS_ONION_PORT=8096
43 43
 
44 44
 TAHOELAFS_SHARED_DIR='Shared'
@@ -83,7 +83,6 @@ function tahoelafs_setup_config {
83 83
     sed -i "s|tub.location.*|tub.location = tor:${TAHOELAFS_ONION_HOSTNAME}:${TAHOELAFS_PORT}|g" $config_file
84 84
 
85 85
     sed -i "s|nickname =.*|nickname = $HOSTNAME|g" $config_file
86
-    sed -i "s|web.port =.*|web.port = tcp:$TAHOELAFS_WEB_PORT:interface=127.0.0.1|g" $config_file
87 86
 
88 87
     if ! grep -q "[storage]" $config_file; then
89 88
         echo '' >> $config_file
@@ -206,6 +205,46 @@ function configure_firewall_for_tahoelafs {
206 205
     mark_completed $FUNCNAME
207 206
 }
208 207
 
208
+function install_tahoelafs_web {
209
+    config_file=$1
210
+
211
+    if [ ! -d /var/www/tahoelafs ]; then
212
+        mkdir -p /var/www/tahoelafs/htdocs
213
+    fi
214
+    tahoelafs_nginx_site=/etc/nginx/sites-available/tahoelafs
215
+    echo 'server {' > $tahoelafs_nginx_site
216
+    echo "    listen 127.0.0.1:$TAHOELAFS_ONION_PORT default_server;" >> $tahoelafs_nginx_site
217
+    echo "    server_name $TAHOELAFS_ONION_HOSTNAME;" >> $tahoelafs_nginx_site
218
+    echo '' >> $tahoelafs_nginx_site
219
+    function_check nginx_disable_sniffing
220
+    nginx_disable_sniffing tahoelafs
221
+    echo '' >> $tahoelafs_nginx_site
222
+    echo '  # Logs' >> $tahoelafs_nginx_site
223
+    echo '  access_log /dev/null;' >> $tahoelafs_nginx_site
224
+    echo '  error_log /dev/null;' >> $tahoelafs_nginx_site
225
+    echo '' >> $tahoelafs_nginx_site
226
+    echo '  # Root' >> $tahoelafs_nginx_site
227
+    echo "  root /var/www/tahoelafs/htdocs;" >> $tahoelafs_nginx_site
228
+    echo '' >> $tahoelafs_nginx_site
229
+    echo '  location / {' >> $tahoelafs_nginx_site
230
+    function_check nginx_limits
231
+    nginx_limits tahoelafs '15m'
232
+    echo '    rewrite /(.*) /$1 break;' >> $tahoelafs_nginx_site
233
+    echo '    proxy_set_header X-Real-IP $remote_addr;' >> $tahoelafs_nginx_site
234
+    echo '    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;' >> $tahoelafs_nginx_site
235
+    echo '    proxy_set_header Host $http_host;' >> $tahoelafs_nginx_site
236
+    echo '    proxy_set_header X-NginX-Proxy true;' >> $tahoelafs_nginx_site
237
+    echo "    proxy_pass http://localhost:${TAHOELAFS_WEB_PORT};" >> $tahoelafs_nginx_site
238
+    echo '    proxy_redirect off;' >> $tahoelafs_nginx_site
239
+    echo '  }' >> $tahoelafs_nginx_site
240
+    echo '}' >> $tahoelafs_nginx_site
241
+
242
+    function_check nginx_ensite
243
+    nginx_ensite tahoelafs
244
+
245
+    sed -i "s|web.port =.*|web.port = tcp:$TAHOELAFS_WEB_PORT:interface=127.0.0.1|g" $config_file
246
+}
247
+
209 248
 function install_tahoelafs {
210 249
     if [ $INSTALLING_MESH ]; then
211 250
         return
@@ -288,40 +327,7 @@ function install_tahoelafs {
288 327
 
289 328
     set_completion_param "tahoelafs commit" "$TAHOELAFS_COMMIT"
290 329
 
291
-    if [ ! -d /var/www/tahoelafs ]; then
292
-        mkdir -p /var/www/tahoelafs/htdocs
293
-    fi
294
-
295
-    tahoelafs_nginx_site=/etc/nginx/sites-available/tahoelafs
296
-    echo 'server {' > $tahoelafs_nginx_site
297
-    echo "    listen 127.0.0.1:$TAHOELAFS_ONION_PORT default_server;" >> $tahoelafs_nginx_site
298
-    echo "    server_name $TAHOELAFS_ONION_HOSTNAME;" >> $tahoelafs_nginx_site
299
-    echo '' >> $tahoelafs_nginx_site
300
-    function_check nginx_disable_sniffing
301
-    nginx_disable_sniffing tahoelafs
302
-    echo '' >> $tahoelafs_nginx_site
303
-    echo '  # Logs' >> $tahoelafs_nginx_site
304
-    echo '  access_log /dev/null;' >> $tahoelafs_nginx_site
305
-    echo '  error_log /dev/null;' >> $tahoelafs_nginx_site
306
-    echo '' >> $tahoelafs_nginx_site
307
-    echo '  # Root' >> $tahoelafs_nginx_site
308
-    echo "  root /var/www/tahoelafs/htdocs;" >> $tahoelafs_nginx_site
309
-    echo '' >> $tahoelafs_nginx_site
310
-    echo '  location / {' >> $tahoelafs_nginx_site
311
-    function_check nginx_limits
312
-    nginx_limits tahoelafs '15m'
313
-    echo '    rewrite /(.*) /$1 break;' >> $tahoelafs_nginx_site
314
-    echo '    proxy_set_header X-Real-IP $remote_addr;' >> $tahoelafs_nginx_site
315
-    echo '    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;' >> $tahoelafs_nginx_site
316
-    echo '    proxy_set_header Host $http_host;' >> $tahoelafs_nginx_site
317
-    echo '    proxy_set_header X-NginX-Proxy true;' >> $tahoelafs_nginx_site
318
-    echo "    proxy_pass http://localhost:${TAHOELAFS_WEB_PORT};" >> $tahoelafs_nginx_site
319
-    echo '    proxy_redirect off;' >> $tahoelafs_nginx_site
320
-    echo '  }' >> $tahoelafs_nginx_site
321
-    echo '}' >> $tahoelafs_nginx_site
322
-
323
-    function_check nginx_ensite
324
-    nginx_ensite tahoelafs
330
+    #install_tahoelafs_web $TAHOELAFS_CONFIG
325 331
 
326 332
     APP_INSTALLED=1
327 333
 }