Bläddra i källkod

Merge branch 'stretch' of https://github.com/bashrc/freedombone

Bob Mottram 7 år sedan
förälder
incheckning
c33d3ac1d2

+ 37
- 0
CONTRIBUTING.md Visa fil

@@ -0,0 +1,37 @@
1
+There are many ways to contribute.
2
+
3
+# Software Testing
4
+Currently there isn't any CI system and with the increasing number of apps there is always the need to test on different or new hardware. Pick some hardware. Try installing the system onto it.
5
+ * Are the instructions clear enough?
6
+ * Were there any failures during the install?
7
+ * Do any of the apps fail?
8
+Reporting any failures, either as issues or by any other method is very useful.
9
+
10
+# Physical Testing
11
+Testing of the mesh system in various environments. What's the maximum range for a given wifi adapter? What type of cantennas or reflectors work best on an ultra-low budget? Which wifi adapters have free software drivers? What are the simplest antenna designs which are quickest to make? Perhaps antenna advice or example deployment descriptions could be part of the documentation.
12
+
13
+# Documentation
14
+ * Improving descriptions of processes or apps
15
+ * Fixing spelling or typos
16
+ * Adding any documentation which might be missing
17
+ * Better screenshots for apps
18
+ * Translations for the website, within the *doc* subdirectory.
19
+ * Translations of the manpages with the *man* subdirectory.
20
+
21
+# Artwork
22
+The project doesn't have much of this. There are some desktop backgrounds within the *img/backgrounds* subdirectory which could be improved. Cute mascots and things like that can also help to attract interest. The mesh variant of the system has desktop icons which could also be better.
23
+
24
+# Security Auditing
25
+Looking for any obvious security mistakes, doing pentesting on an installed test system and reporting the results would be useful. There are already many STIG tests in the *tests* subdirectory, but having more wouldn't hurt.
26
+
27
+# Campaigning
28
+Ensuring that the internet doesn't become far less neutral than it already is. Encouraging ISPs not to have policies which ban people from running servers. Promoting and raising awareness that self-hosting is a thing which is actually useful. All of these activities are incredibly important to allow self-hosting to remain a viable possibility. ISPs are the bottleneck, and if they implement bad government mandated policies then it may become no longer practical or legal to run your own internet systems on your own hardware in your own home.
29
+
30
+# Adding more apps or maintaining existing ones
31
+Typically apps are pegged to a known good commit. One useful thing is to try recent commits and see if the app installs successfully. Do any new packages need to be installed, or old ones removed? See the developer's guide for how to add new apps to the system.
32
+
33
+# Code Audit
34
+It's all just bash scripts and the more eyeballs on it the more likely that mistakes will be found and fixed.
35
+
36
+# Blogging
37
+Just blogging about the project can help to inform people that decentralised systems exist and that they don't need to be trapped in the cloud services of $bigcorp. Even if you find some aspect of the project which sucks badly, blogging about it is one way to provide feedback which could lead to future improvements being made.

+ 11
- 0
code-of-conduct.md Visa fil

@@ -0,0 +1,11 @@
1
+Instead of having some tedious *Code of Conduct* which tries to micro-manage how folks communicate privately with each other this project has a set of guiding principles, which are as follows:
2
+
3
+ * Enable users to help themselves to provide their own personal software infrastructure.
4
+ * Enable users to help each other to provide software infrastructure for a community.
5
+ * Principle of self-management: apps should require miniumum configuration and maintain themselves as far as possible.
6
+ * There should be no single point of failure. Assume that other servers can and will fail occasionally.
7
+ * Minimum data retention. Only store the data which users actually want or need, and within apps implement the function which allows logging to be turned off.
8
+ * Respect other users right to run their own stuff and have their own policies on their own hardware.
9
+ * Remove as many intermediating organisations as possible. For example, Google tracking embedded within some Free Software apps.
10
+ * No tollbooths, rent-seeking, gatekeepers or paywalls.
11
+ * Maximize energy efficiency. No systems which fundamentally depend upon proof-of-work block solving or other compute-heavy methods. The target here is small single board computers.

+ 12
- 7
doc/EN/devguide.org Visa fil

@@ -16,14 +16,19 @@
16 16
 
17 17
 * Introduction
18 18
 Freedombone consists of a set of bash scripts. There are a lot of them, but they're not very complicated. If you're familiar with the GNU/Linux commandline and can hack a bash script then you can probably add a new app or fix a bug in the system. There are no trendy development frameworks to learn or to get in your way.
19
-* Community Statement
20
-This project doesn't require you to take any special pledge of allegiance or subscribe to any guru's list of commandments. It does not care about your gender, race, national flag or political alignment. It is agnostic towards your religion or lack thereof. It doesn't give one hoot as to whether you are young or old, rich or poor, gay, trans, straight or just "other". It does not care if you like your eggs sunny side up or if you are a vegan.
19
+* Substitute for a Code of Conduct
20
+Instead of having some tedious /Code of Conduct/ which tries to micro-manage how folks communicate privately with each other this project has a set of guiding principles, which are as follows:
21
+
22
+ * Enable users to help themselves to provide their own personal software infrastructure.
23
+ * Enable users to help each other to provide software infrastructure for a community.
24
+ * Principle of self-management: apps should require miniumum configuration and maintain themselves as far as possible.
25
+ * There should be no single point of failure. Assume that other servers can and will fail occasionally.
26
+ * Minimum data retention. Only store the data which users actually want or need, and within apps implement the function which allows logging to be turned off.
27
+ * Respect other users right to run their own stuff and have their own policies on their own hardware.
28
+ * Remove as many intermediating organisations as possible. For example, Google tracking embedded within some Free Software apps.
29
+ * No tollbooths, rent-seeking, gatekeepers or paywalls.
30
+ * Maximize energy efficiency. No systems which fundamentally depend upon proof-of-work block solving or other compute-heavy methods. The target here is small single board computers.
21 31
 
22
-This is an inclusive project which will take patches or pull requests from anyone, in a generous manner along the lines described by the late Pieter Hintjens in his book /Social Architecture/. Any useful patch is likely to be merged so long as it is submitted under a license compatible with AGPL3. Copyright assignment is not required.
23
-
24
-Freedombone is a free system. That's free as in no secret source. For anything. Although there's nothing to stop you from adding proprietary utilities or apps if you wish, any patches containing closed stuff or which create dependencies upon closed systems will be regarded as trash and ignored.
25
-
26
-This project also has a no bullshit policy. Anyone trying to cause a ruckus by trolling or engaging in behavior which is disruptive or disrespectful to others will be speedily blocked and ignored. Life's too short, and there's too much to be done.
27 32
 * Adding extra apps
28 33
 Suppose you have some internet application which you want to add to the system. To do this you need to create an app script which tells the system how to install/remove and also backup/restore. The script should be designed to work with the current stable version of Debian.
29 34
 

+ 1
- 1
src/freedombone-app-gnusocial Visa fil

@@ -351,7 +351,7 @@ function upgrade_gnusocial {
351 351
         rm /var/www/$GNUSOCIAL_DOMAIN_NAME/htdocs/install.php
352 352
     fi
353 353
 
354
-    if [ -d $INSTALL_DIR/pleroma ]; then
354
+    if [ -f /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs/index_qvitter.php ]; then
355 355
         if [ -f /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs/index.php ]; then
356 356
             mv /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs/index.php /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs/index_qvitter.php
357 357
         fi

+ 1
- 1
src/freedombone-app-postactiv Visa fil

@@ -365,7 +365,7 @@ function upgrade_postactiv {
365 365
         rm /var/www/$POSTACTIV_DOMAIN_NAME/htdocs/install.php
366 366
     fi
367 367
 
368
-    if [ -d $INSTALL_DIR/pleroma ]; then
368
+    if [ -f /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs/index_qvitter.php ]; then
369 369
         if [ -f /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs/index.php ]; then
370 370
             mv /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs/index.php /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs/index_qvitter.php
371 371
         fi

+ 9
- 2
src/freedombone-archive-mail Visa fil

@@ -50,9 +50,16 @@ for d in /home/*/ ; do
50 50
             # add the archive to .muttrc if needed
51 51
             if [ -f $MUTTRC ]; then
52 52
                 MUTT_MAILBOXES=$(grep "mailboxes =" $MUTTRC)
53
-                BACKUP_DIRECTORY=archive-$(date +"%Y")
53
+                YR=$(date +"%Y")
54
+                PREV_YR=$((YR - 1))
55
+                BACKUP_DIRECTORY=archive-$YR
56
+                PREV_BACKUP_DIRECTORY=archive-$PREV_YR
54 57
                 if [[ $MUTT_MAILBOXES != *$BACKUP_DIRECTORY* ]]; then
55
-                    sed -i "s|$MUTT_MAILBOXES|$MUTT_MAILBOXES =$BACKUP_DIRECTORY|g" $MUTTRC
58
+                    if [[ $MUTT_MAILBOXES == *$PREV_BACKUP_DIRECTORY* ]]; then
59
+                        sed -i "s|$PREV_BACKUP_DIRECTORY|$PREV_BACKUP_DIRECTORY =$BACKUP_DIRECTORY|g" $MUTTRC
60
+                    else
61
+                        sed -i "s|$MUTT_MAILBOXES|$MUTT_MAILBOXES =$BACKUP_DIRECTORY|g" $MUTTRC
62
+                    fi
56 63
                     chown $USERNAME:$USERNAME $MUTTRC
57 64
                 fi
58 65
             fi

+ 11
- 0
src/freedombone-image Visa fil

@@ -552,6 +552,17 @@ if [[ $VARIANT == 'usb' ]]; then
552 552
     IMAGE_NAME=$'usb'
553 553
 fi
554 554
 
555
+if [[ $VARIANT == 'beaglebonewifi' ]]; then
556
+    if [ ! $WIFI_SSID ]; then
557
+        WIFI_SSID=${PROJECT_NAME}
558
+    fi
559
+    if [ ! "$WIFI_PASSPHRASE" ]; then
560
+        WIFI_PASSPHRASE=${PROJECT_NAME}
561
+    fi
562
+    WIFI_TYPE='wpa2-psk'
563
+    WIFI_HOTSPOT='yes'
564
+fi
565
+
555 566
 # append amnesic to the image name if needed
556 567
 if [[ $AMNESIC != 'no' ]]; then
557 568
     IMAGE_NAME="${IMAGE_NAME}-amnesic"

+ 2
- 2
src/freedombone-image-customise Visa fil

@@ -1045,7 +1045,7 @@ function image_setup_utils {
1045 1045
     fi
1046 1046
 
1047 1047
     if [[ $ARCHITECTURE == 'qemu'* || $ARCHITECTURE == 'amd64' || $ARCHITECTURE == 'x86_64' || $ARCHITECTURE == 'i686' || $ARCHITECTURE == 'i386' ]]; then
1048
-        chroot "$rootdir" apt-get -yq install grub2 lvm2 initramfs-tools
1048
+        chroot "$rootdir" apt-get -yq install grub2 lvm2
1049 1049
     fi
1050 1050
 
1051 1051
     chroot "$rootdir" apt-get -yq install locales locales-all debconf
@@ -1356,7 +1356,7 @@ chroot "$rootdir" apt-get install -y libnss-mdns libnss-myhostname libnss-gw-nam
1356 1356
 chroot "$rootdir" apt-get install -y locales locales-all debconf wireless-tools wpasupplicant usbutils
1357 1357
 if [[ $ARCHITECTURE == 'qemu'* || $ARCHITECTURE == 'i386' || $ARCHITECTURE == 'i686' || $ARCHITECTURE == 'amd64' || $ARCHITECTURE == 'x86_64' ]]; then
1358 1358
     chroot "$rootdir" apt-get install -y cryptsetup zsh pinentry-curses iotop bc
1359
-    chroot "$rootdir" apt-get install -y grub2 hostapd lvm2 initramfs-tools
1359
+    chroot "$rootdir" apt-get install -y grub2 hostapd lvm2
1360 1360
 fi
1361 1361
 
1362 1362
 sed -i "s|#host-name=.*|host-name=${LOCAL_NAME}|g" $rootdir/etc/avahi/avahi-daemon.conf

+ 7
- 2
src/freedombone-image-hardware-setup Visa fil

@@ -94,11 +94,16 @@ EOF
94 94
 }
95 95
 
96 96
 beaglebone_flash() {
97
+    bbb_version=$1
97 98
     # allow flash-kernel to work without valid /proc contents
98 99
     # ** this doesn't *really* work, since there are too many checks
99 100
     #    that fail in an emulated environment!  We'll have to do it by
100 101
     #    hand below anyway...
101
-    export FK_MACHINE="TI AM335x BeagleBone"
102
+    if [[ "$bbb_version" == 'wireless' ]]; then
103
+        export FK_MACHINE="TI AM335x BeagleBone Black Wireless"
104
+    else
105
+        export FK_MACHINE="TI AM335x BeagleBone Black"
106
+    fi
102 107
     apt-get install -y flash-kernel
103 108
 }
104 109
 
@@ -228,7 +233,7 @@ case "$MACHINE" in
228 233
         ;;
229 234
     beaglebonewifi)
230 235
         beaglebone_setup_boot wireless
231
-        beaglebone_flash
236
+        beaglebone_flash wireless
232 237
         beaglebone_repack_kernel wireless
233 238
         enable_serial_console ttyO0
234 239
         ;;

+ 17
- 1
src/freedombone-utils-setup Visa fil

@@ -85,6 +85,19 @@ CHECK_MESSAGE="Check your internet connection, /etc/network/interfaces and /etc/
85 85
 # Default diffie-hellman key length in bits
86 86
 DH_KEYLENGTH=2048
87 87
 
88
+function support_256_colours {
89
+    if ! grep 'xterm-256color' /etc/skel/.profile; then
90
+        echo '' >> /etc/skel/.profile
91
+        echo 'export TERM=xterm-256color' >> /etc/skel/.profile
92
+    fi
93
+
94
+    if ! grep 'xterm-256color' /home/$MY_USERNAME/.profile; then
95
+        echo '' >> /home/$MY_USERNAME/.profile
96
+        echo 'export TERM=xterm-256color' >> /home/$MY_USERNAME/.profile
97
+        chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.profile
98
+    fi
99
+}
100
+
88 101
 function detect_usb_drive {
89 102
     # sets to the highest available drive letter
90 103
     # which is likely to be the last drive connected
@@ -240,7 +253,7 @@ function initial_setup {
240 253
     fi
241 254
 
242 255
     if [[ $ARCHITECTURE == 'qemu'* || $ARCHITECTURE == 'amd64' || $ARCHITECTURE == 'x86_64' || $ARCHITECTURE == 'i686' || $ARCHITECTURE == 'i386' ]]; then
243
-        apt-get -yq install grub2 lvm2 initramfs-tools
256
+        apt-get -yq install grub2 lvm2
244 257
     fi
245 258
 
246 259
     if [ ! -d $INSTALL_DIR ]; then
@@ -679,6 +692,9 @@ function setup_utils {
679 692
     function_check remove_management_engine_interface
680 693
     remove_management_engine_interface
681 694
 
695
+    function_check support_256_colours
696
+    support_256_colours
697
+
682 698
     function_check enable_predictable_device_names
683 699
     enable_predictable_device_names
684 700
 

+ 26
- 25
website/EN/devguide.html Visa fil

@@ -3,7 +3,7 @@
3 3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5 5
 <head>
6
-<!-- 2017-07-01 Sat 20:33 -->
6
+<!-- 2017-07-18 Tue 11:19 -->
7 7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9 9
 <title></title>
@@ -246,37 +246,38 @@ for the JavaScript code in this tag.
246 246
 
247 247
 <center><h1>Developers Guide</h1></center>
248 248
 
249
-<div id="outline-container-orgebff6ef" class="outline-2">
250
-<h2 id="orgebff6ef">Introduction</h2>
251
-<div class="outline-text-2" id="text-orgebff6ef">
249
+<div id="outline-container-orgeb19df0" class="outline-2">
250
+<h2 id="orgeb19df0">Introduction</h2>
251
+<div class="outline-text-2" id="text-orgeb19df0">
252 252
 <p>
253 253
 Freedombone consists of a set of bash scripts. There are a lot of them, but they're not very complicated. If you're familiar with the GNU/Linux commandline and can hack a bash script then you can probably add a new app or fix a bug in the system. There are no trendy development frameworks to learn or to get in your way.
254 254
 </p>
255 255
 </div>
256 256
 </div>
257
-<div id="outline-container-org771f3cc" class="outline-2">
258
-<h2 id="org771f3cc">Community Statement</h2>
259
-<div class="outline-text-2" id="text-org771f3cc">
257
+<div id="outline-container-org70ef738" class="outline-2">
258
+<h2 id="org70ef738">Substitute for a Code of Conduct</h2>
259
+<div class="outline-text-2" id="text-org70ef738">
260 260
 <p>
261
-This project doesn't require you to take any special pledge of allegiance or subscribe to any guru's list of commandments. It does not care about your gender, race, national flag or political alignment. It is agnostic towards your religion or lack thereof. It doesn't give one hoot as to whether you are young or old, rich or poor, gay, trans, straight or just "other". It does not care if you like your eggs sunny side up or if you are a vegan.
261
+Instead of having some tedious <i>Code of Conduct</i> which tries to micro-manage how folks communicate privately with each other this project has a set of guiding principles, which are as follows:
262 262
 </p>
263 263
 
264
-<p>
265
-This is an inclusive project which will take patches or pull requests from anyone, in a generous manner along the lines described by the late Pieter Hintjens in his book <i>Social Architecture</i>. Any useful patch is likely to be merged so long as it is submitted under a license compatible with AGPL3. Copyright assignment is not required.
266
-</p>
267
-
268
-<p>
269
-Freedombone is a free system. That's free as in no secret source. For anything. Although there's nothing to stop you from adding proprietary utilities or apps if you wish, any patches containing closed stuff or which create dependencies upon closed systems will be regarded as trash and ignored.
270
-</p>
271
-
272
-<p>
273
-This project also has a no bullshit policy. Anyone trying to cause a ruckus by trolling or engaging in behavior which is disruptive or disrespectful to others will be speedily blocked and ignored. Life's too short, and there's too much to be done.
274
-</p>
264
+<ul class="org-ul">
265
+<li>Enable users to help themselves to provide their own personal software infrastructure.</li>
266
+<li>Enable users to help each other to provide software infrastructure for a community.</li>
267
+<li>Principle of self-management: apps should require miniumum configuration and maintain themselves as far as possible.</li>
268
+<li>There should be no single point of failure. Assume that other servers can and will fail occasionally.</li>
269
+<li>Minimum data retention. Only store the data which users actually want or need, and within apps implement the function which allows logging to be turned off.</li>
270
+<li>Respect other users right to run their own stuff and have their own policies on their own hardware.</li>
271
+<li>Remove as many intermediating organisations as possible. For example, Google tracking embedded within some Free Software apps.</li>
272
+<li>No tollbooths, rent-seeking, gatekeepers or paywalls.</li>
273
+<li>Maximize energy efficiency. No systems which fundamentally depend upon proof-of-work block solving or other compute-heavy methods. The target here is small single board computers.</li>
274
+</ul>
275 275
 </div>
276 276
 </div>
277
-<div id="outline-container-orgd032712" class="outline-2">
278
-<h2 id="orgd032712">Adding extra apps</h2>
279
-<div class="outline-text-2" id="text-orgd032712">
277
+
278
+<div id="outline-container-orgce166ed" class="outline-2">
279
+<h2 id="orgce166ed">Adding extra apps</h2>
280
+<div class="outline-text-2" id="text-orgce166ed">
280 281
 <p>
281 282
 Suppose you have some internet application which you want to add to the system. To do this you need to create an app script which tells the system how to install/remove and also backup/restore. The script should be designed to work with the current stable version of Debian.
282 283
 </p>
@@ -554,9 +555,9 @@ Submit your working app to <b><a href="https://github.com/bashrc/freedombone/iss
554 555
 </div>
555 556
 </div>
556 557
 
557
-<div id="outline-container-org169d9d2" class="outline-2">
558
-<h2 id="org169d9d2">Customising mesh images</h2>
559
-<div class="outline-text-2" id="text-org169d9d2">
558
+<div id="outline-container-org2e7b384" class="outline-2">
559
+<h2 id="org2e7b384">Customising mesh images</h2>
560
+<div class="outline-text-2" id="text-org2e7b384">
560 561
 <p>
561 562
 If you want to make your own specially branded version of the mesh images, such as for a particular event, then to change the default desktop backgrounds edit the images within <b>img/backgrounds</b> and to change the available avatars and desktop icons edit the images within <b>img/avatars</b>. Re-create disk images using the instructions shown previously.
562 563
 </p>