diff --git a/README.md b/README.md index d89384f..c36d3d8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Jump is yet another self-hosted startpage for your server designed to be simple, Get the container image from Docker Hub (https://hub.docker.com/r/daledavies/jump). -The following will start Jump and serve the page at http://localhost:8123 with a custom site name, Open Weather Map support, and volumes to map Jump's "backgrounds" and "sites" directories to local directories on your machine (`OWMAPIKEY` and `LATLONG` values below are just for example)... +The following will start Jump and serve the page at http://localhost:8123 with a custom site name, Open Weather Map support, and volumes to map Jump's "backgrounds", "favicon", "search" and "sites" directories to local directories on your machine (`OWMAPIKEY` and `LATLONG` values below are just for example)... ```yaml version: '3' @@ -37,6 +37,7 @@ services: - 8123:8080 volumes: - ./backgrounds:/backgrounds + - ./favicon:/favicon - ./search:/search - ./sites:/sites environment: @@ -70,7 +71,7 @@ You can use the following optional environment variables to configure/customise #### Volume Mapping -You can map the "backgrounds", "search" and "sites" directories to local directories as shown in the Docker Compose example above. Your local directories will be populated with Jump's default files when the container is next started unless the local directories already contain files, in which case the local files will be used by Jump instead. +You can map the "backgrounds", "favicon", "search" and "sites" directories to local directories as shown in the Docker Compose example above. Your local directories will be populated with Jump's default files when the container is next started unless the local directories already contain files, in which case the local files will be used by Jump instead. #### Docker @@ -79,6 +80,7 @@ The same can be achieved just using Docker CLI... ```bash docker run -d -p 8123:8080 \ --volume :/backgrounds \ +--volume :/favicon \ --volume :/sites \ --volume :/search \ --env SITENAME='Custom site name' \ @@ -221,6 +223,10 @@ To use your own background images just copy them to the `/backgrounds/` director If instead you want to use Unsplash for random background images add an Unsplash API key to `config.php` or pass the `UNSPLASHAPIKEY ` environment variable to the Docker container. You can provide a comma separated list of collection ID's using the `unsplashcollections` option in `config.php` or by passing them to the Docker container via the `UNSPLASHCOLLECTIONS` environment variable. +### Favicon + +After mapping the `favicon` directory as shown in the Docker Compose or Docker examples above, replace the default `icon.png` file with whatever PNG icon image you want (ensuring that the filename is always `icon.png`). + ## Development Patches, improvements and feature requests are welcomed although I want to avoid anything that requires an admin interface or user accounts. diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index e0c1847..8ca06b1 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -28,7 +28,7 @@ if [ -z "${DEVELOPMENT-}" ]; then echo >&2 "-------------------------------------------------------------" echo >&2 ""; - echo >&2 "- Checking if backgrounds, search or sites volumes have been mounted." + echo >&2 "- Checking if backgrounds, favicon, search or sites volumes have been mounted." if [ -e "/backgrounds" ]; then echo >&2 " - Backgrounds directory is mapped... symlinking." rm /var/www/html/assets/backgrounds -r @@ -39,6 +39,16 @@ if [ -z "${DEVELOPMENT-}" ]; then fi fi + if [ -e "/favicon" ]; then + echo >&2 " - Favicon directory is mapped... symlinking." + rm /var/www/html/assets/images/favicon -r + ln -s /favicon /var/www/html/assets/images/ + if [ ! "$(ls -A /favicon)" ]; then + echo >&2 " -- Empty so populating with default favicon image." + cp /usr/src/jumpapp/assets/images/favicon/* /favicon -r + fi + fi + if [ -e "/sites" ]; then echo >&2 " - Sites directory is mapped... symlinking." rm /var/www/html/sites -r diff --git a/jumpapp/favicon.png b/jumpapp/assets/images/favicon/icon.png similarity index 100% rename from jumpapp/favicon.png rename to jumpapp/assets/images/favicon/icon.png diff --git a/jumpapp/templates/header.mustache b/jumpapp/templates/header.mustache index 67d034a..12f8bf9 100644 --- a/jumpapp/templates/header.mustache +++ b/jumpapp/templates/header.mustache @@ -8,7 +8,7 @@ {{> partials/cssbundle}} - + {{title}}