Commit Graph

4315 Commits

Author SHA1 Message Date
d8753aafb9 Fix:Series collapse series filter out empty sequences #1450 2023-01-31 15:53:04 -06:00
ba5ad228cc Merge pull request #1456 from jramer/master
Fixes m4b chapters only taken from first file.
2023-01-30 17:53:48 -06:00
0203f9cc1b Update server/objects/mediaTypes/Book.js 2023-01-30 17:50:50 -06:00
4770be5a39 Update server/objects/mediaTypes/Book.js 2023-01-30 17:50:45 -06:00
1bac395bed Merge pull request #1453 from lkiesow/bookshelf-view
One Default Bookshelf View
2023-01-30 17:29:44 -06:00
e818f270cd Merge pull request #1457 from tomazed/LocalizedDateFns
Localized date fns
2023-01-30 08:44:06 -06:00
c4e2726622 Update client/plugins/i18n.js 2023-01-30 08:42:56 -06:00
74d8a09f31 Merge branch 'master' into LocalizedDateFns 2023-01-30 15:22:59 +01:00
618338165e Removed unused strings from translations 2023-01-30 15:17:42 +01:00
db494001a2 Import all locales from date-fns/locale 2023-01-30 15:17:04 +01:00
a67213fb7b Simplified languageCodeMap maintainability 2023-01-30 15:09:11 +01:00
5d96b2cc6e Logs correctly and simplifies for single audio file. 2023-01-30 12:56:22 +01:00
72d0b097ab Reverts change of file ending 2023-01-30 12:48:50 +01:00
36d2957fb4 Adds check for duplicated chapter data 2023-01-30 12:46:41 +01:00
b5de517aad Generate days from date-fns locale 2023-01-30 01:49:30 +01:00
41db0e3bb1 Use Date-Fns locale to generate month and day labels 2023-01-30 01:25:35 +01:00
e8d582269b localized date-fns library 2023-01-30 00:52:28 +01:00
80ef8ee890 Fixes m4b chapters only taken from first file. 2023-01-30 00:42:02 +01:00
a65859f575 One Default Bookshelf View
This patch updates the default value of the home page bookshelf view so
that it is identical to the default library view. Having different
styles by default seems odd. I picked the non-wooden view as default
based on the recent discussion on Matrx/Discord that that one looks more
modern.
2023-01-28 23:17:31 +01:00
5724887785 Merge pull request #1451 from springsunx/patch-1
Update zh-cn.json
2023-01-28 15:04:21 -06:00
8908aa7a82 Fix:Podcast RSS feeds update on new/updated episodes #1435 2023-01-28 14:58:10 -06:00
f83dd29213 Update:syncLocalMediaProgress API response payload 2023-01-28 14:46:01 -06:00
99d90778f4 Update zh-cn.json 2023-01-28 20:36:16 +08:00
49279430fc Add:Recommended book home page shelf 2023-01-27 17:59:06 -06:00
030c20b12e Merge pull request #1438 from tomazed/LocalizedStatsPage
Localized stats page
2023-01-24 17:30:32 -06:00
5e943ef152 Fix Localized Days in Your Stats page 2023-01-24 19:19:42 +01:00
4ae057f626 Fix Localized Months displaying in heatmap 2023-01-24 18:03:32 +01:00
9ebe4b55dd Merge pull request #1431 from lkiesow/x-accel
Implement X-Accel Redirect
2023-01-23 17:27:23 -06:00
2f7403adec Merge pull request #1432 from jmt-gh/issue_1410
Align "Series Name" and "Sequence" inputs on Series Editor modal
2023-01-23 17:19:50 -06:00
2777b496ad change the label to be a label instead of a p 2023-01-22 20:44:39 -08:00
f7a3dbf209 Fix:Embed metadata tool embeds cover image 2023-01-22 18:02:57 -06:00
d900093976 Fix:Make m4b embed cover image 2023-01-22 18:00:35 -06:00
08250e266e Implement X-Accel Redirect
This patch implements [X-Accel](https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/)
redirect headers as an optional way for offloading static file delivery
from Express to Nginx, which is far better optimized for static file
delivery.

This provides a really easy to configure way for getting a huge
performance boost over delivering all files through Audiobookshelf.

How it works
------------

The way this works is basically that Audiobookshelf gets an HTTP request
for delivering a static file (let's say an audiobook). It will first
check the user is authorized and then convert the API path to a local
file path.

Now, instead of reading and delivering the file, Audiobookshelf will
return just the HTTP header with an additional `X-Accel-Redirect`
pointing to the file location on the file syste.

This header is picked up by Nginx which will then deliver the file.

Configuration
-------------

The configuration for this is very simple. You need to run Nginx as
reverse proxy and it must have access to your Audiobookshelf data
folder.

You then configure Audiobookshelf to use X-Accel by setting
`USE_X_ACCEL=/protected`. The path is the internal redirect path used by
Nginx.

In the Nginx configuration you then configure this location and map it
to the storage area to serve like this:

```
location /protected/ {
  internal;
  alias /;
}
```

That's all.

Impact
------

I just did a very simple performance test, downloading a 1170620819
bytes large audiobook file from another machine on the same network
like this, using `time -p` to measure how log the process took:

```sh
URL='https://url to audiobook…'

for i in `seq 1 50`
do
  echo "$i"
  curl -s -o /dev/null "${URL}"
done
```

This sequential test with 50 iterations and without x-accel resulted in:

```
real 413.42
user 197.11
sys 82.04
```

That is an average download speed of about 1080 MBit/s.

With X-Accel enabled, serving the files through Nginx, the same test
yielded the following results:

```
real 200.37
user 86.95
sys 29.79
```

That is an average download speed of about 2229 MBit/s, more than
doubling the previous speed.

I have also run the same test with 4 parallel processes and 25 downloads
each. Without x-accel, that test resulted in:

```
real 364.89
user 273.09
sys 112.75
```

That is an average speed of about 2448 MBit/s.

With X-Accel enabled, the parallel test also shows a significant
speedup:

```
real 167.19
user 195.62
sys 78.61
```

That is an average speed of about 5342 MBit/s.

While doing that, I also peaked at the system load which was a bit lower
when using X-Accel. Even though the system was delivering far more data.
But I just looked at the `load1` values and did not build a proper test
for that. That means, I cant provide any definitive data.

Supported Media
---------------

The current implementation works for audio files and book covers. There
are other media files which would benefit from this mechanism like feed
covers or author pictures.

But that's something for a future developer ;-)
2023-01-23 00:02:27 +01:00
da2d1455d7 Merge pull request #1420 from Bostrolicious/master
Fix HTTP links not working in podcast show notes.
2023-01-22 08:07:55 -06:00
b6c6c4c939 Merge pull request #1423 from lkiesow/prod-opts
Ensure default are similar in different environments
2023-01-22 08:05:30 -06:00
22179d82b8 Merge branch 'master' into prod-opts 2023-01-22 08:05:25 -06:00
343ce312f1 Merge pull request #1422 from tomazed/translation-fr
Update fr.json Months and Days
2023-01-22 08:03:44 -06:00
10677d6fb0 Merge pull request #1421 from lkiesow/fingerprinting
Reduce Fingerprinting
2023-01-22 08:03:17 -06:00
49a8aead9b Merge pull request #1425 from lkiesow/undefined-uid-gid
Skip AUDIOBOOKSHELF_UID/GID if undefined
2023-01-22 08:02:53 -06:00
274b0e48be Skip AUDIOBOOKSHELF_UID/GID if undefined
This patch slightly changes the behavior of the `AUDIOBOOKSHELF_UID` and
`AUDIOBOOKSHELF_GID` options. Instead of defining a default user and
group, trying to modify files and silently failing if the filesystem
mode cannot be changed, this patch will just skip the entire process in
the first place.

If these options are defined, Audiobookshelf should behave exactly as
before. If they are not defined, Audiobookshelf will now cause fewer
file modifications (or less failures when trying to modify files).

If this patch gets applied, it should probably be highlighted in the
release notes. This usually shouldn't cause problems for migrations
since the Docker guides explicitly configure the options and the
package installations do not seem to use this at all, but there is still
a change that it will and users should be aware of that.

If a problem arises, users can easily fix the problem by either setting
the permissions once manually to the audiobookshelf user or by simply
defining the `AUDIOBOOKSHELF_UID/GID` options.
2023-01-22 12:30:36 +01:00
4d8ffc5d99 Ensure default are similar in different environments
This patch tries to make sure that defaults and options work in the same
way regardless of users using Docker or a package deployment.

- Commit 10295b0 updated `Host` to be empty by default to better support
  IPv6. This fixes a missed occurrence of the old default.
- This makes sure the `SOURCE` environment variable is honored when
  installing the packages. The `--source` option will still take
  precedence though.
2023-01-22 00:53:10 +01:00
4f3029e5b2 Update fr.json Months and Days 2023-01-22 00:39:23 +01:00
a1b49f5fcf Reduce Fingerprinting
As DieselTech#6997 pointed out in Matrix, it is a good idea to reduce
fingerprinting by removing the `X-Powered-By` response header as pointed
out by the Express security best practices:

See http://expressjs.com/en/advanced/best-practice-security.html#reduce-fingerprinting
2023-01-21 23:18:06 +01:00
89d497a305 Fix mailto links not working in podcast show notes. 2023-01-21 22:46:38 +01:00
9e095a4bc1 Fix HTTP links not working in podcast show notes. 2023-01-21 21:51:05 +01:00
024d052a7b Update:Show total duration of episodes on podcast page 2023-01-19 17:55:40 -06:00
c312979aec Update:Heatmap day of week translations 2023-01-18 18:04:03 -06:00
773e621944 Merge pull request #1404 from burghy86/patch-8
update it
2023-01-18 17:50:42 -06:00
ed4f33b565 Merge pull request #1364 from lkiesow/update-server-libs
Update Server Libraries
2023-01-18 17:36:20 -06:00
f8a0852dfc Merge pull request #1403 from k9withabone/fix-banner
Fix banner view box
2023-01-18 17:35:28 -06:00