瀏覽代碼

Revert "Remove tahoelafs site password"

This reverts commit 5bab5cded69b13afd235b41dd9644fcde1b2633e.
Bob Mottram 8 年之前
父節點
當前提交
e2af0792d6
共有 3 個檔案被更改,包括 64 行新增15 行删除
  1. 2
    2
      doc/EN/app_tahoelafs.org
  2. 50
    1
      src/freedombone-app-tahoelafs
  3. 12
    12
      website/EN/app_tahoelafs.html

+ 2
- 2
doc/EN/app_tahoelafs.org 查看文件

30
 Select *Add/Remove Apps* then *tahoelafs*. This system is entirely based upon use of onion addresses and so no other demaon names are needed.
30
 Select *Add/Remove Apps* then *tahoelafs*. This system is entirely based upon use of onion addresses and so no other demaon names are needed.
31
 
31
 
32
 * Initial setup
32
 * Initial setup
33
-Go to the *About* screen on the *Administrator control panel* and look for the onion address for *tahoelafs* within the list of domains. Enter that into a Tor compatible browser. You can then use the interface to upload files and obtain URLs for them.
33
+Get the login password for your Tahoe-LAFS system by going to *Passwords* on the *Administrator control panel* and selecting *tahoelafs*.
34
 
34
 
35
-The URL contains the public key needed to decrypt the file. Make a copy of it and then store it somewhere safe, because it won't be stored anywhere else by default and having the URL is the only way to retrieve your file.
35
+Go to the *About* screen on the *Administrator control panel* and look for the onion address for *tahoelafs* within the list of domains. Enter that into a Tor compatible browser. along with your username and the tahoelafs password. You can then use the interface to upload files and obtain URLs for them. The URL contains the public key needed to decrypt the file.
36
 
36
 
37
 * Adding more servers
37
 * Adding more servers
38
 You can add more servers to the system to increase its storage capacity. In a typical Tahoe-LAFS new data storage servers are automatically discovered via an introducer node, but that creates a single centralised point of failure. The installation on Freedombone has no introducer node and so details for the servers of your friends need to be entered manually.
38
 You can add more servers to the system to increase its storage capacity. In a typical Tahoe-LAFS new data storage servers are automatically discovered via an introducer node, but that creates a single centralised point of failure. The installation on Freedombone has no introducer node and so details for the servers of your friends need to be entered manually.

+ 50
- 1
src/freedombone-app-tahoelafs 查看文件

15
 # License
15
 # License
16
 # =======
16
 # =======
17
 #
17
 #
18
-# Copyright (C) 2016-2017 Bob Mottram <bob@freedombone.net>
18
+# Copyright (C) 2014-2017 Bob Mottram <bob@freedombone.net>
19
 #
19
 #
20
 # This program is free software: you can redistribute it and/or modify
20
 # This program is free software: you can redistribute it and/or modify
21
 # it under the terms of the GNU Affero General Public License as published by
21
 # it under the terms of the GNU Affero General Public License as published by
58
                      TAHOELAFS_SHARES_HAPPY
58
                      TAHOELAFS_SHARES_HAPPY
59
                      TAHOELAFS_SHARES_TOTAL)
59
                      TAHOELAFS_SHARES_TOTAL)
60
 
60
 
61
+function add_user_tahoelafs {
62
+    if [[ $(app_is_installed tahoelafs) == "0" ]]; then
63
+        echo '0'
64
+        return
65
+    fi
66
+
67
+    new_username="$1"
68
+    new_user_password="$2"
69
+    ${PROJECT_NAME}-pass -u $new_username -a tahoelafs -p "$new_user_password"
70
+    if grep "${new_username}:" /etc/nginx/.htpasswd-tahoelafs; then
71
+        sed -i '/${new_username}:/d' /etc/nginx/.htpasswd-tahoelafs
72
+    fi
73
+    echo "${new_user_password}" | htpasswd -i -s /etc/nginx/.htpasswd-tahoelafs ${new_username}
74
+    echo '0'
75
+}
76
+
77
+function remove_user_tahoelafs {
78
+    remove_username="$1"
79
+    ${PROJECT_NAME}-pass -u $remove_username --rmapp tahoelafs
80
+    if grep "${remove_username}:" /etc/nginx/.htpasswd-tahoelafs; then
81
+        sed -i '/${remove_username}:/d' /etc/nginx/.htpasswd-tahoelafs
82
+    fi
83
+}
84
+
85
+function change_password_tahoelafs {
86
+    change_username="$1"
87
+    change_password="$2"
88
+    ${PROJECT_NAME}-pass -u $change_username -a tahoelafs -p "$change_password"
89
+    if grep "${change_username}:" /etc/nginx/.htpasswd-tahoelafs; then
90
+        sed -i '/tahoe-${change_username}:/d' /etc/nginx/.htpasswd-tahoelafs
91
+    fi
92
+    echo "${change_password}" | htpasswd -i -s /etc/nginx/.htpasswd-tahoelafs ${change_username}
93
+}
94
+
61
 function add_tahoelafs_storage_node_interactive {
95
 function add_tahoelafs_storage_node_interactive {
62
     data=$(tempfile 2>/dev/null)
96
     data=$(tempfile 2>/dev/null)
63
     trap "rm -f $data" 0 1 2 5 15
97
     trap "rm -f $data" 0 1 2 5 15
350
         rm -rf /home/tahoelafs
384
         rm -rf /home/tahoelafs
351
     fi
385
     fi
352
     remove_app tahoelafs
386
     remove_app tahoelafs
387
+    if [ -f /etc/nginx/.htpasswd-tahoelafs ]; then
388
+        shred -zu /etc/nginx/.htpasswd-tahoelafs
389
+    fi
353
     systemctl reload tor
390
     systemctl reload tor
354
 }
391
 }
355
 
392
 
566
     echo "  root /var/www/tahoelafs/htdocs;" >> $tahoelafs_nginx_site
603
     echo "  root /var/www/tahoelafs/htdocs;" >> $tahoelafs_nginx_site
567
     echo '' >> $tahoelafs_nginx_site
604
     echo '' >> $tahoelafs_nginx_site
568
     echo '  location / {' >> $tahoelafs_nginx_site
605
     echo '  location / {' >> $tahoelafs_nginx_site
606
+    echo "    # auth_basic \"${TAHOELAFS_LOGIN_TEXT}\";" >> $tahoelafs_nginx_site
607
+    echo '    # auth_basic_user_file /etc/nginx/.htpasswd-tahoelafs;' >> $tahoelafs_nginx_site
569
     function_check nginx_limits
608
     function_check nginx_limits
570
     nginx_limits tahoelafs '15m'
609
     nginx_limits tahoelafs '15m'
571
     echo '    rewrite /(.*) /$1 break;' >> $tahoelafs_nginx_site
610
     echo '    rewrite /(.*) /$1 break;' >> $tahoelafs_nginx_site
578
     echo '  }' >> $tahoelafs_nginx_site
617
     echo '  }' >> $tahoelafs_nginx_site
579
     echo '}' >> $tahoelafs_nginx_site
618
     echo '}' >> $tahoelafs_nginx_site
580
 
619
 
620
+    TAHOELAFS_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
621
+    ${PROJECT_NAME}-pass -u $MY_USERNAME -a tahoelafs -p "$TAHOELAFS_ADMIN_PASSWORD"
622
+    if [ ! -f /etc/nginx/.htpasswd-tahoelafs ]; then
623
+        touch /etc/nginx/.htpasswd-tahoelafs
624
+    fi
625
+    if grep "${MY_USERNAME}:" /etc/nginx/.htpasswd-tahoelafs; then
626
+        sed -i '/${MY_USERNAME}:/d' /etc/nginx/.htpasswd-tahoelafs
627
+    fi
628
+    echo "${TAHOELAFS_ADMIN_PASSWORD}" | htpasswd -i -s /etc/nginx/.htpasswd-tahoelafs ${MY_USERNAME}
629
+
581
     function_check nginx_ensite
630
     function_check nginx_ensite
582
     nginx_ensite tahoelafs
631
     nginx_ensite tahoelafs
583
     systemctl reload nginx
632
     systemctl reload nginx

+ 12
- 12
website/EN/app_tahoelafs.html 查看文件

3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5
 <head>
5
 <head>
6
-<!-- 2017-03-09 Thu 19:21 -->
6
+<!-- 2017-03-09 Thu 22:39 -->
7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9
 <title></title>
9
 <title></title>
251
 This is a robust system for encrypted file storage on one or more server. Files are accessed via a URL which contains the public key with which it was encrypted.
251
 This is a robust system for encrypted file storage on one or more server. Files are accessed via a URL which contains the public key with which it was encrypted.
252
 </p>
252
 </p>
253
 
253
 
254
-<div id="outline-container-org820575c" class="outline-2">
255
-<h2 id="org820575c">Installation</h2>
256
-<div class="outline-text-2" id="text-org820575c">
254
+<div id="outline-container-org852db43" class="outline-2">
255
+<h2 id="org852db43">Installation</h2>
256
+<div class="outline-text-2" id="text-org852db43">
257
 <p>
257
 <p>
258
 Log into your system with:
258
 Log into your system with:
259
 </p>
259
 </p>
273
 </div>
273
 </div>
274
 </div>
274
 </div>
275
 
275
 
276
-<div id="outline-container-org4af4c28" class="outline-2">
277
-<h2 id="org4af4c28">Initial setup</h2>
278
-<div class="outline-text-2" id="text-org4af4c28">
276
+<div id="outline-container-org11f3747" class="outline-2">
277
+<h2 id="org11f3747">Initial setup</h2>
278
+<div class="outline-text-2" id="text-org11f3747">
279
 <p>
279
 <p>
280
-Go to the <b>About</b> screen on the <b>Administrator control panel</b> and look for the onion address for <b>tahoelafs</b> within the list of domains. Enter that into a Tor compatible browser. You can then use the interface to upload files and obtain URLs for them.
280
+Get the login password for your Tahoe-LAFS system by going to <b>Passwords</b> on the <b>Administrator control panel</b> and selecting <b>tahoelafs</b>.
281
 </p>
281
 </p>
282
 
282
 
283
 <p>
283
 <p>
284
-The URL contains the public key needed to decrypt the file. Make a copy of it and then store it somewhere safe, because it won't be stored anywhere else by default and having the URL is the only way to retrieve your file.
284
+Go to the <b>About</b> screen on the <b>Administrator control panel</b> and look for the onion address for <b>tahoelafs</b> within the list of domains. Enter that into a Tor compatible browser. along with your username and the tahoelafs password. You can then use the interface to upload files and obtain URLs for them. The URL contains the public key needed to decrypt the file.
285
 </p>
285
 </p>
286
 </div>
286
 </div>
287
 </div>
287
 </div>
288
 
288
 
289
-<div id="outline-container-org0225e9a" class="outline-2">
290
-<h2 id="org0225e9a">Adding more servers</h2>
291
-<div class="outline-text-2" id="text-org0225e9a">
289
+<div id="outline-container-org2810eb5" class="outline-2">
290
+<h2 id="org2810eb5">Adding more servers</h2>
291
+<div class="outline-text-2" id="text-org2810eb5">
292
 <p>
292
 <p>
293
 You can add more servers to the system to increase its storage capacity. In a typical Tahoe-LAFS new data storage servers are automatically discovered via an introducer node, but that creates a single centralised point of failure. The installation on Freedombone has no introducer node and so details for the servers of your friends need to be entered manually.
293
 You can add more servers to the system to increase its storage capacity. In a typical Tahoe-LAFS new data storage servers are automatically discovered via an introducer node, but that creates a single centralised point of failure. The installation on Freedombone has no introducer node and so details for the servers of your friends need to be entered manually.
294
 </p>
294
 </p>