More work on docs

This commit is contained in:
Zachary Klosko 2020-11-23 13:58:55 -05:00
parent adf8d351f5
commit 68357864b1
11 changed files with 131 additions and 164 deletions

View File

@ -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. 

View File

@ -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

View File

@ -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 <http://www.pool.ntp.org/> 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.

View File

@ -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.

View File

@ -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 <http://www.pool.ntp.org/> 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.

View File

@ -1,6 +1,6 @@
---
layout: article
title: Upgrading LibreTime
title: Upgrading Libretime
category: admin
---

View File

@ -41,36 +41,4 @@
scrollToTop();
}
</script>
<!-- Algolia Search -->
<script>
const search = instantsearch({
appId: 'latency',
apiKey: '6be0576ff61c053d5f9a3225e2a90f76',
indexName: 'instant_search',
routing: true
});
search.start();
</script>
<script>
const search = instantsearch(options);
// initialize SearchBox
search.addWidget(
instantsearch.widgets.searchBox({
container: '#search-searchbox',
placeholder: 'Search the docs'
})
);
// initialize hits widget
search.addWidget(
instantsearch.widgets.hits({
container: '#hits'
})
);
search.start();
</script>

View File

@ -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: '</h2>', ': ' | replace: '</h3>', ': ' | replace: '</h4>', ': ' | replace: '</p>', ' ' | 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: '</h2>', ': ' | replace: '</h3>', ': ' | replace: '</h4>', ': ' | replace: '</p>', ' ' | 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: '</h2>', ': ' | replace: '</h3>', ': ' | replace: '</h4>', ': ' | replace: '</p>', ' ' | strip_html | strip_newlines | replace: ' ', ' ' | replace: '"', ' ' }}"{% assign counter = counter | plus: 1 %}
}{% if forloop.last %}{% else %}, {% endif %}{% endfor %}];
var idx = lunr(function () {

View File

@ -53,6 +53,23 @@ layout: default
</ul>
</div>
</div>
<br>
<!-- Edit Page -->
<a class="card border-0 bg-primary link-white text-white mb-4" href="https://github.com/Libretime/libretime/edit/master/docs/{{ page.path }}">
<div class="card-body z-index-1">
<div class="d-flex align-items-center">
<i class="fa fa-pencil-alt fa-3x mr-4"></i>
<p class="mb-0">Help improve this page</p>
</div>
</div>
<!-- SVG BG -->
<svg class="position-absolute bottom-0 left-0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1920 323" enable-background="new 0 0 1920 323" xml:space="preserve">
<polygon fill="#ffffff" style="fill-opacity: .05;" points="-0.5,322.5 -0.5,121.5 658.3,212.3 "></polygon>
<polygon fill="#ffffff" style="fill-opacity: .1;" points="-2,323 1920,323 1920,-1 "></polygon>
</svg>
<!-- End SVG BG -->
</a>
</div>
</div>
</div>

View File

@ -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 {

View File

@ -25,13 +25,5 @@ title: Search
<section class="pt-11 pb-6">
<div class="container-lg">
{% include search-lunr.html %}
<div id="search-box">
<!-- SearchBox widget will appear here -->
</div>
<div id="hits">
<!-- Hits widget will appear here -->
</div>
</div>
</section>