3 # this is from distro-end
4 if [[ -s ~
/.bashrc
]];then . ~
/.bashrc
;fi
8 # based on https://wiki.debian.org/SecuringNFS
9 # but the quota stuff is either outdated or optional,
10 # i guessed that it was not needed and it worked fine.
11 s
dd of
=/etc
/sysctl.d
/nfs-static-ports.conf
<<'EOF'
12 fs.nfs.nfs_callback_tcpport = 32764
13 fs.nfs.nlm_tcpport = 32768
14 fs.nfs.nlm_udpport = 32768
17 s
$sed -ri -f - /etc
/default
/nfs-common
<<'EOF'
19 $a STATDOPTS="--port 32765 --outgoing-port 32766"
22 s
$sed -ri -f - /etc
/default
/nfs-kernel-server
<<'EOF'
24 $a RPCMOUNTDOPTS="--manage-gids --port 32767"
26 ser restart nfs-kernel-server
28 if [[ $HOSTNAME == kd
]]; then
29 # persistent one time steps for webdav:
30 # create persistent password, put it in ~/.kodi/userdata/advancedsettings.xml,
31 # per http://kodi.wiki/view/MySQL/Sync_other_parts_of_Kodi
32 # htpasswd -c /p/c/filesystem/etc/davpass dav
33 # chmod 640 /p/c/filesystem/etc/davpass
34 # in conflink, set group to www-data.
35 # In kodi, i set the music source, server address: my domain,
36 # path: k/music. Then copied the file
37 # /p/c/subdir_files/.kodi/userdata/sources.xml to save that setting.
39 web-conf
-r /a
/c
/playlists
- apache2 dav.
$HOME_DOMAIN <<'EOF'
40 <Directory /a/c/playlists>
43 AuthName "Authentication Required"
44 AuthUserFile "/etc/davpass"
47 # outside the standard /var/www, so use this:
52 s mkdir
-p /var
/www
/davlock
53 s chown www-data
:www-data
/var
/www
/davlock
54 s
sed -i "1i DavLockDB /var/www/davlock/davlock" /etc
/apache
2/sites-enabled
/dav.
$HOME_DOMAIN.conf
57 teeu
/etc
/exports
"/k/music *(ro,nohide,async,no_subtree_check,insecure)"
60 # kodi uses sqlite by default, but supports mysql.
63 # see ofswiki.org for explanation.
64 dbpass
="$(cat /p/mysql-root-pass)"
65 if ! echo exit|mysql
-uroot "-p$dbpass"; then
66 echo -e "\n\n$dbpass\n$dbpass\n\n\n\n\n" | mysql_secure_installation
68 mysql
-uroot "-p$dbpass" <<EOF
69 GRANT ALL PRIVILEGES ON *.* TO 'kodi' IDENTIFIED BY '$(</p/mysql-kodi-pass)';
71 s
sed -ri 's/^(\s*bind-address\s*=).*/\1 0.0.0.0/' /etc
/mysql
/mariadb.conf.d
/50-server.cnf