timedicer-server-setup v8.46 [26 Feb 2024] by Dominic
Description
timedicer-server-setup.sh is part of the TimeDicer suite https://www.timedicer.co.uk, and sets up a TimeDicer Server or updates its existing setup.
It is normally run with -f option after the first boot of a new TimeDicer Server machine. It can be run subsequently with or without -f option to update the machine.
Usage
timedicer-server-setup.sh [option] [you@your_email_address.org]
Options
-v verbose (show normal output from commands)
-f run automatically assuming 'y' for all questions - email address on command line required
-h show this help
-l show changelog
Details
Depending on the user's choices and existing installed software, timedicer-server-setup.sh configures the server as follows -
- download and extract key scripts from www.timedicer.co.uk (including self-updating this script)
- check and update timezone information [requires user response]
- download and install postfix, including optional relay authentication [requires user response]
- download and install updates for Ubuntu
- restrict access so that each user's /home folder is readable only by that user (and the administrator)
- download and install wakeonlan, lvm2, ssh, apache2, php
- bespoke settings for nano, php, postfix, cron, and enable apache2.conf
- create ssh keys for primary user and for root
- if root filesystem is encrypted, setup boot-time ssh to allow remote entering of encryption passphrase
- download and install rdiff-backup, Rdiffweb and incron
- start Rdiffweb, apache2 and postfix
- send a test email
License
Copyright © 2024 Dominic Raferd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Changelog
[for versions prior to 8.12, version number indicates when: 201y.mmdd]
8.46 [26 Feb 2024]: ensure cron-generated outgoing emails use the modern 'From:' form
8.45 [12 Feb 2024]: remove no-longer-required-or-supported nano setting, tweak Rdiffweb settings
8.44 [05 Feb 2024]: bugfix - install bzip2 if missing
8.43 [17 Jan 2024]: updates to undocumented option
8.42 [29 Jun 2023]: small updates
8.41 [13 Jan 2023]: update Rdiffweb installation process
8.40 [12 Jan 2023]: update Rdiffweb installation process
8.35 [07 Nov 2022]: update to use rdiff-backup from standard repo package for Ubuntu>=22.04
8.34 [19 Jul 2022]: update Rdiffweb installation process
8.33 [23 Mar 2021]: update Rdiffweb installation process
8.32 [21 Jan 2021]: bugfix for adding incrontab entry
8.31 [07 Jan 2021]: fixes for rdiff-backup installation
8.30 [26 Nov 2020]: check any current rdiff-backup version and install latest rdiff-backup (currently 2.0.5) from PPA, not the older (possibly broken) version in standard Debian repository
8.20 [07 Jul 2020]: updated for new Rdiffweb
8.15 [24 May 2019]: bugfix for encrypted setup where eth device is not eth0
8.14 [09 May 2019]: bugfixes to prevent hangs
8.13 [23 Dec 2018]: simplify apache2 and postfix localisations
8.12 [19 Dec 2018]: use incron to monitor new TimeDicer user requests, don't request relayhost info if already set up
8.1115: set postfix to refuse any incoming emails
8.1114: bugfixes for encryption setup and for adding TimeDicer user, exit if initial apt-get fails
8.1030: bugfix for Remote Booting with Encrypted LVM (LUKS + dm-crypt) (key was placed in wrong file)
8.0919: set postfix to run at latest compatibility level, allow correction of relayhost when setting up relaying
8.0703: bugfix compatibility with Ubuntu 18.04LTS (for php 7.2)
8.0414: a number of bugfixes (including self-updating code), add testing of relayhost authentication for satellite mail setup (using swaks), tested under Ubuntu 18.04 LTS
8.0413: use pip to install rdiffweb
8.0117: if using LUKS + dm-crypt encrypted root fs, set up initramfs to obtain ip by DHCP
7.0609: new way of obtaining ip addresses
7.0425: add ability to work with, and setup remote login/mounting for, LUKS + dm-crypt encrypted root fs, add full setup of email relayhost authentication
7.0412: very minor text fixes
6.0707: bugfix
6.0706: improve self-updating code, remove php5-common for Ubuntu >=16.04, don't install sshfs
6.0622: make compatible with Ubuntu 16.04 (Xenial), force Rdiffweb 0.6.3 upgrade
6.0426: delete any pre-existing .don files when updating key scripts
6.0422: internal changes
6.0218: no longer compulsory to supply email address on command line (except with -f)
5.1224: install new Rdiffweb >=0.7
5.0806: some bugfixes
5.0129: add dutree.sh
4.1203: bugfix so that local TimeDicer homepage appears correctly after installation
4.1116: further small changes for Ubuntu 14.04
4.1111: fix for Ubuntu 14.04 (copy web page files to /var/www/html)
2.1107: timedicer-mirror.sh updated
2.0827: timedicer-mirror.sh updated, help text updated
2.0701: fix for Ubuntu 12.04 to prevent apache2 messages about undefined ServerName
2.0627: fix for Ubuntu 12.04 to allow creation of primary user rsa key, don't create /home/tmp, add cryptsetup package to prevent inotify_add_watch messages/delay at boot time
2.0515: renamed as timedicer-server-setup.sh, now self-updating
2.0425: fix of a small (but fatal) bug
2.0312: small bugfix, updated help text for rdiffweb-install.sh
2.0308: rename timedicer-mirror as timedicer-mirror.sh
2.0224: remove rdiff-backup-fs-install and vmware-tools-install from package of installed utilities, rename rdiffweb-install as rdiffweb-install.sh
2.0221: rename lv-usage.sh as lvm-usage.sh
1.1231: improved output from lv-usage.sh (cron job test for disk space)
1.1023: create /home/tmp directory when rdiff-backup is installed
1.1011: recoding for timedicer-mirror
1.1009: bugfixes for rdiffweb-install, timedicer-mirror and newuser-request.sh
1.0916a: remove heirloom-mailx (and remove dependency upon it)
1.0916: add timezone configuration
1.0915c: fix rdiffweb-install failure on 2nd run, add rdiffweb setup package to timedicer-server-setup.tar.bz2 so setup can still work if rdiffweb site is down
1.0915: add recognition of any type of network port
1.0914: add make-home-lv.sh, can ease LVM configuration fix for rdiffweb-install to work with python2.7 (Ubuntu 11.04)
1.0913: add install of postfix, lvm2, ssh and heirloom-mailx to assist with VM-based or non-standard TimeDicer Server setup
1.0901: alter Server web pages so no data (css, png) is loaded from www.timedicer.co.uk, all is held and accessed locally - removes an unintended 'phone home' and means page formats are okay even if Server has no internet access
1.0830: alter various files so that when a new TimeDicer user is created, a new rdiffweb user is also created
1.0306: remove installation of rdiff-backup-fv [patched rdiff-backup]
1.0301: bugfix - prevent automatic silent abort on exit code>0 remove daily repo verification from cron
1.0227: added changelog option and updated help text
1.0222: install wakeonlan, add script install-rdiff-backup-fs (but rdiff-backup-fs not installed)
1.0217: install sshfs and auto-add new users to fuse group
1.0216: bugfix - create root rsa key without passphrase
1.0207: bugfixes
Download timedicer-server-setup.sh
Donation
I have provided this software free gratis and for nothing. If you would like to thank me with a contribution, please let me know and I will send you a link. Thank you!
My Other Sites
- TimeDicer - Onsite/offsite data backup for Windows (uses rdiff-backup)
- Finding a 4D Backup Solution
- Web Scraping How To - extracting data from web sites
My Programs
Here is a selection of some (other) programs I have written, most of which run under GNU/Linux from the command line (CLI), are freely available and can be obtained by clicking on the links. Dependencies are shown and while in most cases written and tested on an x86-based Linux server, they should run on a Raspberry Pi, and many can run under Windows using Windows Subsystem for Linux (WSL) or Cygwin. Email me if you have problems or questions, or if you think I could help with a programming requirement.
Backup Utilities
- TimeDicer - Onsite/offsite data backup for Windows (uses rdiff-backup) [ GNU/Linux & MS Windows©: 2008-20 ]
- rdiff-backup-regress - GNU/Linux script to regress an rdiff-backup archive. [ GNU/Linux: 2012-24 ]
Debian/Ubuntu kernel and LVM Utilities
- kernel-remove - GNU/Linux script to list the installed GNU/Linux kernels in a Debian-based distro (e.g. Ubuntu), and can be used to remove an unwanted kernel and related packages, updating grub appropriately. [ GNU/Linux-Debian/Ubuntu: 2010-24 ]
- lvm-usage - GNU/Linux script to show available disk space and how it is used; run as cron job to warn if usage is above a set percentage. Provides additional information if LVM is in use. [ GNU/Linux: 2012-24 ]
- lvm-delete-snapshot - GNU/Linux script to remove LVM snapshot that has been left over by another process. [ GNU/Linux: 2012-21 ]
- netnames - GNU/Linux script shows current name, biosdevname and 'predictable name' of network device - helps with network device name scheme migration. [ GNU/Linux-Debian/Ubuntu: 2020-20 ]
- lv-convert2cache - GNU/Linux script to convert an existing LV into a cache LV using a smaller faster device as a cache. [ GNU/Linux: 2022-24 ]
Miscellaneous Programs
- sleepwalker - Windows© program which can be run from a remote machine to 'wake up' a Windows© machine behind a router, wait for it to start and then initiate Remote Desktop session. [MS Windows©: 2008-22]
- numliststat - GNU/Linux program giving statistical value(s) for a piped-in list of numbers. [ GNU/Linux: 2022-24 ]
- relay-enforcer - GNU/Linux program enabling a postfix-based mail server relaying to Gmail to act on reports from Gmail about blocked emails. [ GNU/Linux: 2016-24 ]
- pdf-compress - GNU/Linux program to create smaller b/w pdf file from an original large pdf file, especially when original resulted from scanning. [ GNU/Linux: 2016-23 ]
- tiny-device-monitor - GNU/Linux program to test webpages (including password-protected) or machines to check they are live; use as a cron job for your own websites, for hardware presenting a webpage, or for any machines with a presence on your local LAN or on the internet. [ GNU/Linux: 2009-24 ]
- form-extractor - GNU/Linux program to extract form tags from a web page or downloaded file. [ GNU/Linux: 2012-24 ]
- mythic-dns-sync - GNU/Linux program to update DNS record at mythic-beasts.com to match local external ip. [ GNU/Linux: 2016-23 ]
- saynoto0870 - For UK, a GNU/Linux script which performs automated lookup of the www.saynoto0870.com database, finding cheap or free geographic number replacements for expensive non-geographic (087* or 084*) numbers. [ GNU/Linux: 2012-12 ]
- bind9-resolved-switch - GNU/Linux program for switching permanently between using bind9 or systemd-resolved as the system DNS resolver. [ GNU/Linux: 2016-24 ]
- unlock - GNU/Linux remote program for easy entering of decrypt passphrase on a remote machine which has root dm-crypt+LUKS. [ GNU/Linux: 2017-18 ]
- wifi-updown - GNU/Linux program to take down wifi interface if there is a working wired interface (or restore wifi if not). [ GNU/Linux: 2018-23 ]
- routefix - GNU/Linux program to restore a default ip traffic route if there is none such (e.g. after running wifi-updown). [ GNU/Linux: 2018-23 ]
- dutree - GNU/Linux program to show a tree-style list of files and directories at the specified location which are greater than the specified size (default 1GB). [ GNU/Linux: 2012-24 ]
- Accounts - Multi-business multi-currency accounting software, uses Access [MS Windows©: 1996-2024]
- Rents Program - Residential lettings/landlord front office program, with many special features for UK market [MS Windows©: 1991-2024]
This section is closed. If you have a question, please submit it by email, thank you.