syncthing stuff
authorIan Kelling <ian@iankelling.org>
Mon, 6 Feb 2017 00:55:26 +0000 (16:55 -0800)
committerIan Kelling <ian@iankelling.org>
Mon, 6 Feb 2017 00:55:26 +0000 (16:55 -0800)
distro-end
mail-setup

index 95a6e2ddd94de0c1b31b8b2cd0dd0538e0868e03..920de7f70a6a22405bd6c3535a03e23b70007d06 100755 (executable)
@@ -306,42 +306,67 @@ lnf /a/opt/.AndroidStudio2.2 ~
 spa lib32stdc++6 default-jdk
 
 
-case $distro in
-    arch) pi syncthing ;;
-    ubuntu|debian)
-        # testing has relatively up to date packages
-        if ! isdebian-testing; then
-            # based on error when doing apt-get update:
-            # E: The method driver /usr/lib/apt/methods/https could not be found.
-            pi apt-transport-https
-            # google led me here:
-            # https://apt.syncthing.net/
-            curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
-            s="deb http://apt.syncthing.net/ syncthing release"
-            if [[ $(cat /etc/apt/sources.list.d/syncthing.list) != $s ]]; then
-                echo "$s" | s dd of=/etc/apt/sources.list.d/syncthing.list
-                p update
+if [[ $HOSTNAME == treetowl ]]; then
+    # It\'s simpler to just worry about running it in one place for now.
+    # I assume it would work to clone it\'s config to another non-phone
+    # and just run it in one place instead of the normal having a
+    # separate config.  I lean toward using the same config, since btrfs
+    # syncs between comps.
+    case $distro in
+        arch) pi syncthing ;;
+        ubuntu|debian)
+            # testing has relatively up to date packages
+            if ! isdebian-testing; then
+                # based on error when doing apt-get update:
+                # E: The method driver /usr/lib/apt/methods/https could not be found.
+                pi apt-transport-https
+                # google led me here:
+                # https://apt.syncthing.net/
+                curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
+                s="deb http://apt.syncthing.net/ syncthing release"
+                if [[ $(cat /etc/apt/sources.list.d/syncthing.list) != $s ]]; then
+                    echo "$s" | s dd of=/etc/apt/sources.list.d/syncthing.list
+                    p update
+                fi
             fi
-        fi
-        pi syncthing
-        ;;
-esac
-# installed via f-droid
-# top right, actions, device id
-#
-# for installing on a remote comp:
-# ssh -L 8384:localhost:8384 -N frodo
-# went to http://localhost:8384/
-#
-# add folder to sync phone,
-# staggered file versioning would be my normal choice, but choose
-# trash can versioning for sake of space on phone, with
-# clean out after 7 days.
-#
-# did:
-# ser start syncthing@ian
-# then on phone, add device, hit bar code icon,
-# install bar code scanner.
+            pi syncthing
+            ;;
+    esac
+    sgo syncthing@ian # runs as ian
+
+    # these things persist in ~/.config/syncthing, which I save in
+    # /p/c/machine_specific
+    # open http://localhost:8384/
+    # change listen address from default to tcp://:22001,
+    # this is because we do port forward so it doesn\'t have to use
+    # some external server, but the syncthing is broken for port forward,
+    # you get a message, something "like connected to myself, this should not happen"
+    # when connecting to other local devices, so I bump the port up by 1,
+    # based on
+    # https://forum.syncthing.net/t/connected-to-myself-should-not-happen/1763/19.
+    # Without this, it was being stuck syncing at 0%.
+    # Set gui username and password.
+    #
+    # install syncthing via f-droid,
+    # folder setting, turn off master folder (makes it read only).
+    # on phone, add device, click bar code icon
+    # on dekstop, top right, actions, device id
+    # after adding, notification will appear on desktop to confirm
+    #
+    # add folder to sync phone, notification will appear on desktop
+    # to set folder location.
+    #
+    # Folder versioning would make sense if I didn\'t already use btrfs
+    # for backups. I would choose staggered, or trash can for more space.
+    #
+    # if needed to install on a remote comp:
+    # ssh -L 8384:localhost:8384 -N frodo
+    # open http://localhost:8384/
+    #
+    # Note, the other thing i did was port forward port 22000,
+    # per https://docs.syncthing.net/users/firewall.html
+fi
+
 
 
 # no equivalent in other distros:
@@ -409,8 +434,8 @@ EOF
             ser disable transmission-daemon
             sgo transmission-daemon-nn
             ;;
-        # todo: others unknown
-    esac
+    # todo: others unknown
+esac
 fi
 
 # adapted from /var/lib/dpkg/info/transmission-daemon.postinst
@@ -514,7 +539,7 @@ case $HOSTNAME in
                     0) : ;;
                     *)
                         # previously I had a more specific search, but dpkg
-                        # changed it's output as of 7/2016
+                        # changed it\'s output as of 7/2016
                         if grep 'dependency problems' \
                                 $log &>/dev/null; then
                             s apt-get -fy install
@@ -522,13 +547,13 @@ case $HOSTNAME in
                             exit 1
                         fi
                         ;;
-esac
-;;
-arch)
-    pi google-chrome
-    ;;
-esac
-;;
+                esac
+                ;;
+            arch)
+                pi google-chrome
+                ;;
+        esac
+        ;;
 esac
 
 # printer
index ede33e482b868671927830f220eea41e737987f6..ead9423f012f9268a97a9d8efcff1ed55e7d11fe 100755 (executable)
@@ -183,7 +183,7 @@ After=multi-user.target
 
 [Service]
 Type=oneshot
-ExecStart=/a/bin/log-quiet/sysd-mail-once /a/bin/distro-setup/mail-cert-cron
+ExecStart=/a/bin/log-quiet/sysd-mail-once mailcert /a/bin/distro-setup/mail-cert-cron
 EOF
 
     s dd of=/etc/systemd/system/mailcert.timer <<'EOF'