apt-listchanges
aptitude-doc-en
bash-doc
+ beets
+ beets-doc
binutils-doc
bind9-doc
bwm-ng
i3lock
iproute2-doc
jq
+ kid3-qt
+ kid3-cli
linux-doc
locate
make-doc
manpages-dev
meld
mumble
+ nginx-doc
nmap
offlineimap
p7zip
case $distro in
debian)
+ # note, need python-certbot-nginx for nginx, but it depends on nginx,
+ # and I'm not installing nginx by default right now
if isdebian-testing; then
- p install --install-suggests jessie-backports certbot python-certbot-nginx
+ pi --install-suggests certbot
else
- p install --install-suggests -t jessie-backports certbot python-certbot-nginx
+ pi --install-suggests -t jessie-backports certbot
fi
# make a version of the certbot timer that emails me.
x=/systemd/system/certbot
s,^Description.*,\0 mail version,
EOF
$sed -r -f - /lib$x.service <<'EOF' |s dd of=/etc${x}mail.service
-s,(ExecStart=)(/usr/bin/certbot),\1/a/bin/log-quiet/sysd-mail-once certbotmail \2,
+s,(ExecStart=)(/usr/bin/certbot),\1/a/bin/log-quiet/sysd-mail-once certbotmail \2 --renew-hook /a/bin/distro-setup/certbot-renew-hook,
EOF
ser daemon-reload
sgo certbotmail.timer
ser daemon-reload
ser enable vpnmail.service
# needed for li's local mail delivery.
- l="10.8.0.4 mail.iankelling.org"
- tu /etc/hosts <<<"$l"
+ tu /etc/hosts <<<"10.8.0.4 mail.iankelling.org"
sgo openvpn
+ # setup let's encrypt cert
+ web-conf apache2 mail.iankelling.org
+ s rm /etc/apache2/sites-enabled/mail.iankelling.org{,-redir}.conf
+ ser reload apache2
+
domain=cal.iankelling.org
web-conf -f 10.8.0.4:5232 - apache2 $domain <<'EOF'
#https://httpd.apache.org/docs/2.4/mod/mod_authn_core.html#authtype
"debugClient": false,
"disableRegistration": true,
"noCDN": true,
- "key": "/home/pumpio/pump.iankelling.org-domain.key",
- "cert": "/home/pumpio/pump.iankelling.org-chained.pem",
+ "key": "/home/pumpio/privkey.pem",
+ "cert": "/home/pumpio/fullchain.pem",
"address": "localhost",
"sockjs": false
}
s mkdir -p /var/log/pumpio/
s chown pumpio:pumpio /var/log/pumpio/
- web-conf -c /home/pumpio - apache2 pump.iankelling.org <<'EOF'
+ web-conf - apache2 pump.iankelling.org <<'EOF'
# currently a bug in pump that we cant terminate ssl
SSLProxyEngine On
ProxyPreserveHost On
</Location>
EOF
+ sudo -i <<'EOF'
+export RENEWED_LINEAGE=/etc/letsencrypt/live/pump.iankelling.org
+/a/bin/distro-setup/certbot-renew-hook
+EOF
+
s dd of=/etc/systemd/system/pump.service <<'EOF'
[Unit]
Description=pump.io
############# begin setup mastodon ##############
# https://store.docker.com/editions/community/docker-ce-server-debian?tab=description
- pi software-properties-common
+ pi software-properties-common apt-transport-https
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
p update
pi docker-ce
sgo docker
- # this may not be needed
- ser start docker
curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` | s dd of=/usr/local/bin/docker-compose
s chmod +x /usr/local/bin/docker-compose
####### misc packages ###########
-if [[ $HOSTNAME == treetowl ]]; then
- case $distro in
- debian|ubuntu)
- # note i had to do this, which is persistent:
- # cd /i/k
- # s chgrp debian-transmission torrents partial-torrents
-
- # syslog says things like
- # 'Failed to set receive buffer: requested 4194304, got 425984'
- # google suggets giving it even more than that
- tu /etc/sysctl.conf<<'EOF'
+case $distro in
+ debian|ubuntu)
+ # note i had to do this, which is persistent:
+ # cd /i/k
+ # s chgrp debian-transmission torrents partial-torrents
+
+ # syslog says things like
+ # 'Failed to set receive buffer: requested 4194304, got 425984'
+ # google suggets giving it even more than that
+ tu /etc/sysctl.conf<<'EOF'
net.core.rmem_max = 67108864
net.core.wmem_max = 16777216
EOF
- s sysctl -p
-
- # some reason it doesn\'t seem to start automatically anyways
- pi-nostart transmission-daemon
-
- # the folder was moved here after an install around 02/2017.
- # it contains runtime data,
- # plus a simple symlink to the config file which it\'s
- # not worth separating out.
- s lnf -T /i/transmission-daemon /var/lib/transmission-daemon/.config/transmission-daemon
- #
- # config file documented here, and it\'s the same config
- # for daemon vs client, so it\'s documented in the gui.
- # https://trac.transmissionbt.com/wiki/EditConfigFiles#Options
- #
- # I originaly setup rpc-whitelist, but after using
- # routing to a network namespace, it doesn\'t see the
- # real source address, so it\'s disabled.
- #
- # Changed the cache-size to 256 mb, reduces disk use.
- # It is a read & write cache.
- #
- s ruby <<'EOF'
+ s sysctl -p
+
+ # some reason it doesn\'t seem to start automatically anyways
+ pi-nostart transmission-daemon
+
+ # the folder was moved here after an install around 02/2017.
+ # it contains runtime data,
+ # plus a simple symlink to the config file which it\'s
+ # not worth separating out.
+ s lnf -T /i/transmission-daemon /var/lib/transmission-daemon/.config/transmission-daemon
+ #
+ # config file documented here, and it\'s the same config
+ # for daemon vs client, so it\'s documented in the gui.
+ # https://trac.transmissionbt.com/wiki/EditConfigFiles#Options
+ #
+ # I originaly setup rpc-whitelist, but after using
+ # routing to a network namespace, it doesn\'t see the
+ # real source address, so it\'s disabled.
+ #
+ # Changed the cache-size to 256 mb, reduces disk use.
+ # It is a read & write cache.
+ #
+ s ruby <<'EOF'
require 'json'
p = '/etc/transmission-daemon/settings.json'
File.write(p, JSON.pretty_generate(JSON.parse(File.read(p)).merge({
})) + "\n")
EOF
- # make sure its not enabled, not sure if this is needed
- ser disable transmission-daemon
- sgo transmission-daemon-nn
- ;;
- # todo: others unknown
- esac
-fi
-
+ # make sure its not enabled, not sure if this is needed
+ ser disable transmission-daemon
+ ;;
+ # todo: others unknown
+esac
# adapted from /var/lib/dpkg/info/transmission-daemon.postinst
if ! getent passwd debian-transmission > /dev/null; then
case $distro in
;;
esac
fi
+if [[ $HOSTNAME == treetowl ]]; then
+ sgo transmission-daemon-nn
+fi
-# dunno why it\'s there, but get rid of it
-case $HOSTNAME in
- li|lj) s rm -rf /home/linode ;;
-esac
-
-# arch had a default config,
-# debian had nothing until you start it.
-# With a little trial an error, here is a minimal config
-# taken from the generated one, plus changes that the
-# settings ui does, without a bunch of ui crap settings.
-#
-# only settings I set were
-# hostname
-# auto-connect
-# password
+######### begin transmission client setup ######
-# the password is randomly generated on first run
-rpc_pass=$(s ruby <<'EOF'
+if [[ -e /p/transmission-rpc-pass ]]; then
+ # arch had a default config,
+ # debian had nothing until you start it.
+ # With a little trial an error, here is a minimal config
+ # taken from the generated one, plus changes that the
+ # settings ui does, without a bunch of ui crap settings.
+ #
+ # only settings I set were
+ # hostname
+ # auto-connect
+ # password
+
+ # the password is randomly generated on first run, i copied it out
+ # so it could be used by other hosts.
+ s ruby <<'EOF'
require 'json'
p = '/etc/transmission-daemon/settings.json'
-puts JSON.parse(File.read(p))["rpc-password"]
+s = JSON.parse(File.read(p))
+s["rpc-password"] = File.read("/p/transmission-rpc-pass").chomp
+File.write p, JSON.pretty_generate(s)
EOF
- )
-for f in /home/*; do
- d=$f/.config/transmission-remote-gtk
- u=${f##*/}
- s -u $u mkdir -p $d
- s -u $u dd of=$d/config.json <<EOF
+ rpc_pass=$(</p/transmission-rpc-pass)
+ for f in /home/*; do
+ d=$f/.config/transmission-remote-gtk
+ u=${f##*/}
+ s -u $u mkdir -p $d
+ s -u $u dd of=$d/config.json <<EOF
{
"profiles" : [
{
"add-options-dialog" : false
}
EOF
-done
+ done
+fi
+
+# dunno why it\'s there, but get rid of it
+case $HOSTNAME in
+ li|lj) s rm -rf /home/linode ;;
+esac
+
pi wget
case $HOSTNAME in
+
# note this failed running at the beginning of this file,
# because no systemd user instance was running.
# Doing systemd --user resulted in
;;
esac
+
+########### begin kodi setup ############
+pi kodi
+
+# based on https://wiki.debian.org/SecuringNFS
+# but the quota stuff is either outdated or optional,
+# i guessed that it was not needed and it worked fine.
+s dd of=/etc/sysctl.d/nfs-static-ports.conf <<'EOF'
+fs.nfs.nfs_callback_tcpport = 32764
+fs.nfs.nlm_tcpport = 32768
+fs.nfs.nlm_udpport = 32768
+EOF
+s sysctl --system
+s $sed -ri -f - /etc/default/nfs-common <<'EOF'
+/^\s*STATDOPTS=/d
+$a STATDOPTS="--port 32765 --outgoing-port 32766"
+EOF
+
+s $sed -ri -f - /etc/default/nfs-kernel-server <<'EOF'
+/^\s*RPCMOUNTDOPTS=/d
+$a RPCMOUNTDOPTS="--manage-gids --port 32767"
+EOF
+ser restart nfs-kernel-server
+
+if [[ $HOSTNAME == treetowl ]]; then
+ # persistent one time steps for webdav:
+ # create persistent password, put it in ~/.kodi/userdata/advancedsettings.xml,
+ # per http://kodi.wiki/view/MySQL/Sync_other_parts_of_Kodi
+ # htpasswd -c /p/c/filesystem/etc/davpass dav
+ # chmod 640 /p/c/filesystem/etc/davpass
+ # in conflink, set group to www-data.
+ # In kodi, i set the music source, server address: my domain,
+ # path: k/music. Then copied the file
+ # /p/c/subdir_files/.kodi/userdata/sources.xml to save that setting.
+ s a2enmod dav dav_fs
+ web-conf -r /a/c/playlists - apache2 dav.iank.pw <<'EOF'
+<Directory /a/c/playlists>
+ DAV On
+ AuthType Basic
+ AuthName "Authentication Required"
+ AuthUserFile "/etc/davpass"
+ Require valid-user
+
+# outside the standard /var/www, so use this:
+ Order allow,deny
+ Allow from all
+</Directory>
+EOF
+ s mkdir -p /var/www/davlock
+ s chown www-data:www-data /var/www/davlock
+ s sed -i "1i DavLockDB /var/www/davlock/davlock" /etc/apache2/sites-enabled/dav.iank.pw.conf
+ ser reload apache2
+
+ teeu /etc/exports "/k/music *(ro,nohide,async,no_subtree_check,insecure)"
+ exportfs -ra
+
+ # kodi uses sqlite by default, but supports mysql.
+ pi mariadb-server
+
+ # see ofswiki.org for explanation.
+ dbpass="$(cat /p/mysql-root-pass)"
+ if ! echo exit|mysql -uroot "-p$dbpass"; then
+ echo -e "\n\n$dbpass\n$dbpass\n\n\n\n\n" | mysql_secure_installation
+ fi
+ mysql -uroot "-p$dbpass" <<EOF
+GRANT ALL PRIVILEGES ON *.* TO 'kodi' IDENTIFIED BY '$(</p/mysql-kodi-pass)';
+EOF
+ s sed -ri 's/^(\s*bind-address\s*=).*/\1 0.0.0.0/' /etc/mysql/mariadb.conf.d/50-server.cnf
+ ser restart mariadb
+
+fi
+
+########### end kodi setup ############
+
+
if [[ $HOSTNAME == treetowl ]]; then
# nohide = export filesystems mounted deeper than the export point
# fsid=0 makes this export the "root" export