Skip to content

Commit 2035a3d

Browse files
authored
Merge pull request #54 from KIMB-technologies/logo-cache
Logo cache
2 parents 5e22972 + ae96a27 commit 2035a3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+252
-50
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
/php/getr.php
44

55
/data/
6+
/media/
67
/redis/
78
.DS_Store

Setup.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The image of [Radio DNS](https://hub.docker.com/r/kimbtechnologies/radio_dns) is
6363
- You may change the folder for cache files to, e.g., a ramdisk. If you do so, use the script `./utils/backup-restore.php` to backup data which is only stored by the cache (using Docker this is done by the cron job).
6464
- The proxy feature is provided by PHP, but might be less stable than the NGINX proxy.
6565
- The EndURL feature uses the cURL extension of PHP (else it will error!).
66-
- Assure, that PHP/ the webserver can write to `./data/` (and the folders configured for logs and cache files)!
66+
- Assure, that PHP/ the webserver can write to `./data/` (and the folders configured for logs and cache files)! If you use logo caching, also `./media/` needs to be writable.
6767
- Download the lastest source of the *Radio-API* [here](https://github.com/KIMB-technologies/Radio-API/releases/latest).
6868
- Extract the zip and place the folder `php` in the web-root of our server (this is our `./`, other files are not needed).
6969
- Configure *Radio-API* in `./data/env.json` (The config values are the same as for the Docker-based mode, always use strings for the values!):
@@ -80,6 +80,7 @@ The image of [Radio DNS](https://hub.docker.com/r/kimbtechnologies/radio_dns) is
8080
- `CONF_LOG_DIR` (optional) Change the folder where log files are written to (defaults to `./data/`).
8181
- `CONF_CACHE_DIR` (optional) Change the folder used by the file based cache (defaults to `./data/cache/`).
8282
- `CONF_IM_EXPORT_TOKEN` (optional) Define a token for use with the Im- & Export web interface *Im- & Export* [↓](#im---export).
83+
- `CONF_USE_LOGO_CACHE` (optional, default `false`) Cache logos of radio stations. This will make sure logos are served without https and convert svg file to png (assuming [`rsvg-convert`](https://pkgs.alpinelinux.org/package/v3.19/community/x86_64/rsvg-convert) is available on system). Logos are stored in `./media/`.
8384
- **Attention:** Optional parameters have a leading `____` in the default `env.json`, make sure to remove them.
8485
- The `CONF_REDIS_*` values are ignored and `CONF_USE_JSON_CACHE` is always `true`.
8586
- Make sure, that *Radio-API* is available at port `80` for requests with the hostname `*.wifiradiofrontier.com` and `CONF_DOMAIN`.

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
2.8.4
2-
2.8
1+
2.9.0
2+
2.9
33
2

docker-compose.dev.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
volumes:
1717
- ./php/:/php-code/
1818
- ./data/:/php-code/data/
19+
- ./media/:/php-code/media/
1920
- ./utils/getr.php:/php-code/getr.php:ro # redis all values listing
2021
- ./utils/backup-restore.php:/backup-restore.php:ro # backup restore tool for cache values
2122
environment:
@@ -29,6 +30,7 @@ services:
2930
- CONF_REDIS_HOST=redis
3031
- CONF_STREAM_JSON=false #http://192.168.0.10:8081/list.json
3132
- CONF_IM_EXPORT_TOKEN=LP75Djdj195DL8SZnfY3
33+
- CONF_USE_LOGO_CACHE=true
3234
depends_on:
3335
- redis
3436
redis:

docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ services:
88
ports:
99
- "80:80" # make sure, Radio-API is avaliable at port 80
1010
volumes:
11-
- ./data/:/php-code/data/
12-
#- ./media/:/php-code/media/:ro # directory to add images for stations
11+
- ./data/:/php-code/data/ # directory storing data, cache, and setting od Radio-API
12+
- ./media/:/php-code/media/ # directory storing images for stations
1313
environment:
1414
- CONF_DOMAIN=http://radio.example.com/ # the domain where the system is hosted
1515
# - CONF_RADIO_DOMAIN=http://hama.wifiradiofrontier.com # different domain to use for connections of the radio (if set CONF_DOMAIN is for GUI)
@@ -23,6 +23,7 @@ services:
2323
- CONF_STREAM_JSON=false # to disable or an url where to fetch list of own streams, e.g., http://stream.example.com/list.json
2424
# -CONF_LOG_DIR= # set a custom directory for log files (defaults to ./data/)
2525
# -CONF_IM_EXPORT_TOKEN= # define a token for use with the im-, export web interface at ./gui/im-export.php
26+
- CONF_USE_LOGO_CACHE=true # cache logos (make them accessible without ssl and convert svgs to pngs for the radio, stores files in ./media/)
2627
depends_on:
2728
- redis
2829

php/classes/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Radio-API
44
* https://github.com/KIMB-technologies/Radio-API
55
*
6-
* (c) 2019 - 2023 KIMB-technologies
6+
* (c) 2019 - 2024 KIMB-technologies
77
* https://github.com/KIMB-technologies/
88
*
99
* released under the terms of GNU Public License Version 3

php/classes/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Radio-API
44
* https://github.com/KIMB-technologies/Radio-API
55
*
6-
* (c) 2019 - 2023 KIMB-technologies
6+
* (c) 2019 - 2024 KIMB-technologies
77
* https://github.com/KIMB-technologies/
88
*
99
* released under the terms of GNU Public License Version 3

php/classes/Config.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Radio-API
44
* https://github.com/KIMB-technologies/Radio-API
55
*
6-
* (c) 2019 - 2023 KIMB-technologies
6+
* (c) 2019 - 2024 KIMB-technologies
77
* https://github.com/KIMB-technologies/
88
*
99
* released under the terms of GNU Public License Version 3
@@ -64,7 +64,11 @@
6464
);
6565
define(
6666
'ENV_USE_JSON_CACHE',
67-
!empty($_ENV['CONF_USE_JSON_CACHE']) && $_ENV['CONF_USE_JSON_CACHE'] == 'true'
67+
!empty($ENV['CONF_USE_JSON_CACHE']) && $ENV['CONF_USE_JSON_CACHE'] == 'true'
68+
);
69+
define(
70+
'ENV_USE_LOGO_CACHE',
71+
!empty($ENV['CONF_USE_LOGO_CACHE']) && $ENV['CONF_USE_LOGO_CACHE'] == 'true'
6872
);
6973

7074
// IP on reverse proxy setup
@@ -81,7 +85,7 @@ class Config {
8185
/**
8286
* The system's version.
8387
*/
84-
const VERSION = 'v2.8.4';
88+
const VERSION = 'v2.9.0';
8589

8690
/**
8791
* The real domain which should be used.
@@ -130,6 +134,11 @@ class Config {
130134
*/
131135
const USE_JSON_CACHE = ENV_USE_JSON_CACHE;
132136

137+
/**
138+
* Cache logos and make them accessible without ssl.
139+
*/
140+
const USE_LOGO_CACHE = ENV_USE_LOGO_CACHE;
141+
133142
/**
134143
* Store redis cache for ALLOWED_DOMAINS
135144
*/

php/classes/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Radio-API
44
* https://github.com/KIMB-technologies/Radio-API
55
*
6-
* (c) 2019 - 2023 KIMB-technologies
6+
* (c) 2019 - 2024 KIMB-technologies
77
* https://github.com/KIMB-technologies/
88
*
99
* released under the terms of GNU Public License Version 3

php/classes/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Radio-API
44
* https://github.com/KIMB-technologies/Radio-API
55
*
6-
* (c) 2019 - 2023 KIMB-technologies
6+
* (c) 2019 - 2024 KIMB-technologies
77
* https://github.com/KIMB-technologies/
88
*
99
* released under the terms of GNU Public License Version 3

0 commit comments

Comments
 (0)