From 68357864b119911c621076751ec84486c2b1994e Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Mon, 23 Nov 2020 13:58:55 -0500 Subject: [PATCH] More work on docs --- docs/_docs/backing-up-the-server.md | 71 ++++++++++++---------------- docs/_docs/contribute.md | 3 +- docs/_docs/host-configuration.md | 73 +---------------------------- docs/_docs/icecast.md | 2 +- docs/_docs/set-server-time.md | 73 +++++++++++++++++++++++++++++ docs/_docs/upgrading.md | 2 +- docs/_includes/scripts.html | 34 +------------- docs/_includes/search-lunr.html | 8 ++-- docs/_layouts/article.html | 17 +++++++ docs/css/creative.min.css | 4 +- docs/search.html | 8 ---- 11 files changed, 131 insertions(+), 164 deletions(-) create mode 100644 docs/_docs/set-server-time.md diff --git a/docs/_docs/backing-up-the-server.md b/docs/_docs/backing-up-the-server.md index 60d4a2bab..1a0a2f1d7 100644 --- a/docs/_docs/backing-up-the-server.md +++ b/docs/_docs/backing-up-the-server.md @@ -4,7 +4,10 @@ title: Backing Up Libretime category: admin --- -## Backup +> At the moment, there is not a way to automatically restore a Libretime backup. +> To restore a failed Libretime instance, install a fresh copy, go through the +> standard setup process, and reupload the backed-up media files. A *Watched Folders* +> feature is [currently in development](https://github.com/LibreTime/libretime/issues/70). A backup script is supplied for your convenience in the *utils/* folder of the Libretime repo. Run it using: @@ -16,23 +19,38 @@ sudo bash libretime-backup.sh /backupdir/ ``` The backup process can be automated with Cron. Simply add the following to the root user's -crontab with *sudo crontab -e*: +crontab with `sudo crontab -e`: ``` -0 0 1 * * root /locationoflibretimerepo/libretime/backup.sh +0 0 1 * * /locationoflibretimerepo/libretime/backup.sh ``` > For more information on how Cron works, check out [this Redhat guide](https://www.redhat.com/sysadmin/automate-linux-tasks-cron). -### Backup Methods +If you wish to deploy your own backup solution, the following files and folders need to +be backed up. -You can dump the entire *PostgreSQL* database to a zipped file with the combination of the -**pg\_dumpall** command and **gzip**. The **pg\_dumpall** command is executed -as the user *postgres*, by using the **sudo** command and the **-u** switch. It -is separated from the **gzip** command with the pipe symbol. +``` +/srv + /airtime + /stor + /imported - Sucessfully imported media + /organize - A temporary holding place for uploaded media as the importer works +/etc + /airtime + airtime.conf - The main Libretime configuration + icecast_pass - Holds the password for the Icecast server + liquidsoap.cfg - The main configuration file for Liquidsoap +``` -This command can be automated to run on a regular basis using the standard -**cron** tool on your server. +In addition, you should keep a copy of the database current to the backup. The below code +can be used to export the Libretime database to a file. + +``` +sudo -u postgres pg_dumpall filename +# or to a zipped archive +sudo -u postgres pg_dumpall | gzip -c > archivename.gz +``` It is recommended to use an incremental backup technique to synchronize the your LibreTime track library with a backup server regularly. (If @@ -44,36 +62,5 @@ Two notible backup tools are [rsync](http://rsync.samba.org/) (without version c [rdiff-backup](http://www.nongnu.org/rdiff-backup/) (with version control). *rsync* comes preinstalled with Ubuntu Server. -> **Note:** Standard *rsync* backups cannot restore files deleted in the backup itself +> **Note:** Standard *rsync* backups, which are used by the backup script, cannot restore files deleted in the backup itself -## Restore from a Backup - -When restoring a production database on a cleanly installed LibreTime system, it -may be necessary to drop the empty database that was created during the new -installation, by using the **dropdb** command. Again, this command is executed -with **sudo** as the user *postgres*:  - -```bash -sudo -u postgres dropdb airtime -``` - -This **dropdb** command above is necessary to avoid 'already exists' errors on -table creation when overwriting an empty LibreTime database in the next step. -These errors might prevent some data from being restored, such as user account -data. - -To restore, first unzip the backup file with **gunzip**, then use the **psql** -command as the *postgres* user: - -```bash -gunzip libretime-db-backup.gz -sudo -u postgres psql -f libretim-db-backup -``` - -You should now be able to log in to the LibreTime web interface in the usual way. - -For safety reasons, your regular database backups should be kept in a directory -which is backed up by your storage backup tool of choice; for example, the -*/srv/airtime/database\_backups* directory. This should ensure that a storage -restore can be made along with a matching and complete version of the LibreTime -database from the day that the storage backup was made.  diff --git a/docs/_docs/contribute.md b/docs/_docs/contribute.md index c2985ba60..64352951e 100644 --- a/docs/_docs/contribute.md +++ b/docs/_docs/contribute.md @@ -35,7 +35,8 @@ bundle install jekyll serve ``` -> If you get an error, try running `bundle exec jekyll serve`. +> If running the test code from a virtual machine, feel free to use the *jekyll.sh* script in the +> root directory of the repo ## Help write code for LibreTime diff --git a/docs/_docs/host-configuration.md b/docs/_docs/host-configuration.md index 0889f93f8..23946709f 100644 --- a/docs/_docs/host-configuration.md +++ b/docs/_docs/host-configuration.md @@ -206,75 +206,4 @@ for the changes to take effect. # while 'otf' (on the fly) cues while loading into ls # (needs the post_processor patch) cue_style = pre - ---- - -## Setting the server time - -Accurate time keeping on your server is vital for LibreTime performance. You can confirm that the date and time of your server are set correctly with the `date` command. -The server should respond with the date, time, time zone and year in a format similar to the following example: - - Tue Jul 2 15:08:57 BST 2013 - -If the time on your server is wrong, it is strongly recommended that you take LibreTime off-air until the problem is fixed. - -### Configuring NTP - -Although it is possible to set the date and time of the server manually, this is not recommended because the server clock can drift over time, compromising the accuracy of your broadcast schedule. If your LibreTime server is permanently connected to the Internet, you can synchronize your server to a time server with the **ntp** ** program. If **ntp** is not yet installed, you can enter the following command on Debian or Ubuntu: - - sudo apt-get install ntp - -Optionally, open the **ntp** configuration file in the **nano** editor to add further time server names: - - sudo nano /etc/ntp.conf - -On Ubuntu GNU/Linux, the default time server is *ntp.ubuntu.com*, but there are many other time servers available on the public Internet, including the group of servers listed at for each country. Using a variety of NTP servers located closely to your LibreTime server should produce the most accurate results. For example, for a server in the United Kingdom you could use the following list: - - # You do need to talk to an NTP server or two (or three). - server ntp.ubuntu.com - server 0.uk.pool.ntp.org - server 1.uk.pool.ntp.org - server 2.uk.pool.ntp.org - server 3.uk.pool.ntp.org - -Enter the server names you require, press **Ctrl+O** to write out the */etc/ntp.conf* file, then **Ctrl+X** to exit **nano**. Restart the **ntp** service with: - - sudo invoke-rc.d ntp restart - -The server should respond: - - * Stopping NTP server ntpd                                 [ OK ] - * Starting NTP server ntpd                                 [ OK ] - -Then use the **ntpq -p** command to confirm that **ntp** is working. This command should produce output similar to the following: - - ntpq -p - remote      refid    st t when poll reach delay offset jitter - ================================================================== - europium. 193.79.237.14  2 u   28   64    3 39.571  12.600  3.590 - norb.v4.c 46.227.200.72  3 u   28   64    3 47.856  -6.908 10.028 - 82.113.15 193.62.22.82   2 u   29   64    3 11.458  -0.513  2.629 - ntppub.le 158.43.192.66  2 u   91   64    2 122.781  44.864  0.001 - dns0.rmpl 195.66.241.3   2 u   27   64    3  22.171   1.464  4.242 - -### Adjusting the server time zone - -The data centre which hosts your LibreTime server could be located anywhere in the world. Some servers are set to *Coordinated Universal Time* or UTC (similar to *Greenwich Mean Time* or GMT), regardless of their location. LibreTime uses UTC time in its database for scheduling purposes, independent of the server time zone. - -If the server time zone is not appropriate for integration with your station's other systems, on a Debian or Ubuntu server you can reconfigure the **tzdata** (time zone data) package with the command: - - sudo dpkg-reconfigure tzdata - -This command opens a menu in which you can select the continent that you require, by pressing the Enter key. - -![](/img/Screenshot15-Configuring_tzdata.png) - -The next step is to select your nearest city, again by pressing the Enter key. The appropriate time zone is selected according to the information that you have entered. - -![](/img/Screenshot16-Configure_city.png) - -The console output from the **dpkg-reconfigure tzdata** command will confirm the new setting: - - Current default time zone: 'Europe/London' - Local time is now: Tue Jul 2 15:18:01 BST 2013. - Universal Time is now: Tue Jul 2 14:18:01 UTC 2013. + \ No newline at end of file diff --git a/docs/_docs/icecast.md b/docs/_docs/icecast.md index 206766b5c..70c59d3bb 100644 --- a/docs/_docs/icecast.md +++ b/docs/_docs/icecast.md @@ -79,7 +79,7 @@ Connect the other source to the Icecast server with the same parameters defined To configure **Mixxx** for streaming to Icecast, click *Options*, *Preferences*, then *Live Broadcasting*. For server *Type*, select the default of *Icecast 2* when streaming to Debian or Ubuntu servers, as this is the current version of Icecast supplied with those GNU/Linux distributions. -![](img/Screenshot123-Mixxx_Preferences.png)  +![](/img/Screenshot123-Mixxx_Preferences.png)  By default, Icecast streams are buffered to guard against network problems, which causes latency for remote listeners. When monitoring the stream from a remote location, you may have to begin the live stream a few seconds before the previous stream ends to enable a smooth transition. diff --git a/docs/_docs/set-server-time.md b/docs/_docs/set-server-time.md new file mode 100644 index 000000000..95427b7db --- /dev/null +++ b/docs/_docs/set-server-time.md @@ -0,0 +1,73 @@ +--- +title: Setting the Server Time +layout: article +category: install +--- + +Accurate time keeping on your server is vital for LibreTime performance. You can confirm that the date and time of your server are set correctly with the `date` command. +The server should respond with the date, time, time zone and year in a format similar to the following example: + + Tue Jul 2 15:08:57 BST 2013 + +If the time on your server is wrong, it is strongly recommended that you take LibreTime off-air until the problem is fixed. + +### Configuring NTP + +Although it is possible to set the date and time of the server manually, this is not recommended because the server clock can drift over time, compromising the accuracy of your broadcast schedule. If your LibreTime server is permanently connected to the Internet, you can synchronize your server to a time server with the **ntp** ** program. If **ntp** is not yet installed, you can enter the following command on Debian or Ubuntu: + + sudo apt-get install ntp + +Optionally, open the **ntp** configuration file in the **nano** editor to add further time server names: + + sudo nano /etc/ntp.conf + +On Ubuntu GNU/Linux, the default time server is *ntp.ubuntu.com*, but there are many other time servers available on the public Internet, including the group of servers listed at for each country. Using a variety of NTP servers located closely to your LibreTime server should produce the most accurate results. For example, for a server in the United Kingdom you could use the following list: + + # You do need to talk to an NTP server or two (or three). + server ntp.ubuntu.com + server 0.uk.pool.ntp.org + server 1.uk.pool.ntp.org + server 2.uk.pool.ntp.org + server 3.uk.pool.ntp.org + +Enter the server names you require, press **Ctrl+O** to write out the */etc/ntp.conf* file, then **Ctrl+X** to exit **nano**. Restart the **ntp** service with: + + sudo invoke-rc.d ntp restart + +The server should respond: + + * Stopping NTP server ntpd                                 [ OK ] + * Starting NTP server ntpd                                 [ OK ] + +Then use the **ntpq -p** command to confirm that **ntp** is working. This command should produce output similar to the following: + + ntpq -p + remote      refid    st t when poll reach delay offset jitter + ================================================================== + europium. 193.79.237.14  2 u   28   64    3 39.571  12.600  3.590 + norb.v4.c 46.227.200.72  3 u   28   64    3 47.856  -6.908 10.028 + 82.113.15 193.62.22.82   2 u   29   64    3 11.458  -0.513  2.629 + ntppub.le 158.43.192.66  2 u   91   64    2 122.781  44.864  0.001 + dns0.rmpl 195.66.241.3   2 u   27   64    3  22.171   1.464  4.242 + +### Adjusting the server time zone + +The data centre which hosts your LibreTime server could be located anywhere in the world. Some servers are set to *Coordinated Universal Time* or UTC (similar to *Greenwich Mean Time* or GMT), regardless of their location. LibreTime uses UTC time in its database for scheduling purposes, independent of the server time zone. + +If the server time zone is not appropriate for integration with your station's other systems, on a Debian or Ubuntu server you can reconfigure the **tzdata** (time zone data) package with the command: + + sudo dpkg-reconfigure tzdata + +This command opens a menu in which you can select the continent that you require, by pressing the Enter key. + +![](/img/Screenshot15-Configuring_tzdata.png) + +The next step is to select your nearest city, again by pressing the Enter key. The appropriate time zone is selected according to the information that you have entered. + +![](/img/Screenshot16-Configure_city.png) + +The console output from the **dpkg-reconfigure tzdata** command will confirm the new setting: + + Current default time zone: 'Europe/London' + Local time is now: Tue Jul 2 15:18:01 BST 2013. + Universal Time is now: Tue Jul 2 14:18:01 UTC 2013. diff --git a/docs/_docs/upgrading.md b/docs/_docs/upgrading.md index 6eba7afc9..bf80c1d36 100644 --- a/docs/_docs/upgrading.md +++ b/docs/_docs/upgrading.md @@ -1,6 +1,6 @@ --- layout: article -title: Upgrading LibreTime +title: Upgrading Libretime category: admin --- diff --git a/docs/_includes/scripts.html b/docs/_includes/scripts.html index f5e1c878c..d61419e2a 100644 --- a/docs/_includes/scripts.html +++ b/docs/_includes/scripts.html @@ -41,36 +41,4 @@ scrollToTop(); } - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/docs/_includes/search-lunr.html b/docs/_includes/search-lunr.html index 54f79c453..dbf9a482d 100644 --- a/docs/_includes/search-lunr.html +++ b/docs/_includes/search-lunr.html @@ -12,11 +12,11 @@ var documents = [{% for page in site.pages %}{% if page.url contains '.xml' or p "url": "{{ site.url }}{{ page.url }}", "title": "{{ page.title }}", "body": "{{ page.content | markdownify | replace: '.', '. ' | replace: '', ': ' | replace: '', ': ' | replace: '', ': ' | replace: '

', ' ' | strip_html | strip_newlines | replace: ' ', ' ' | replace: '"', ' ' }}"{% assign counter = counter | plus: 1 %} - }, {% endfor %}{% for page in site.docs %}{ + }, {% endfor %}{% for doc in site.docs %}{ "id": {{ counter }}, - "url": "{{ site.url }}{{ page.url }}", - "title": "{{ page.title }}", - "body": "{{ page.content | markdownify | replace: '.', '. ' | replace: '', ': ' | replace: '', ': ' | replace: '', ': ' | replace: '

', ' ' | strip_html | strip_newlines | replace: ' ', ' ' | replace: '"', ' ' }}"{% assign counter = counter | plus: 1 %} + "url": "{{ site.url }}{{ doc.url }}", + "title": "{{ doc.title }}", + "body": "{{ doc.content | markdownify | replace: '.', '. ' | replace: '', ': ' | replace: '', ': ' | replace: '', ': ' | replace: '

', ' ' | strip_html | strip_newlines | replace: ' ', ' ' | replace: '"', ' ' }}"{% assign counter = counter | plus: 1 %} }{% if forloop.last %}{% else %}, {% endif %}{% endfor %}]; var idx = lunr(function () { diff --git a/docs/_layouts/article.html b/docs/_layouts/article.html index 2bf62614d..649022afa 100644 --- a/docs/_layouts/article.html +++ b/docs/_layouts/article.html @@ -53,6 +53,23 @@ layout: default +
+ + +
+
+ +

Help improve this page

+
+
+ + + + + + + +
diff --git a/docs/css/creative.min.css b/docs/css/creative.min.css index 982cb1936..4678495ac 100755 --- a/docs/css/creative.min.css +++ b/docs/css/creative.min.css @@ -214,8 +214,7 @@ padding: 10px 20px; blockquote p { margin: 0; -line-height: 30px; -padding-bottom: 20px; +line-height: 25px; } blockquote .small { @@ -303,6 +302,7 @@ padding: 10px 20px; .station-logos img { max-height: 200px; max-width: 200px; + margin: auto; } .station-logos-row { diff --git a/docs/search.html b/docs/search.html index f78e682d2..c8feeefd7 100644 --- a/docs/search.html +++ b/docs/search.html @@ -25,13 +25,5 @@ title: Search
{% include search-lunr.html %} - - - -
- -
\ No newline at end of file