diff --git a/README.md b/README.md index 7511827..dcf4705 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,9 @@ Modern responsive web frontend for [Airsonic](https://github.com/airsonic/airson https://airsonic.netlify.com -Password is `guest`. +Server: `/api` +Username: `guest1` +Password:`guest` You can use the URL and credentials for your own server if you prefer. **Note**: if your server is using http only you must allow mixed content in your browser otherwise login will not work. @@ -37,6 +39,10 @@ $ docker run -d -p 8080:80 tamland/airsonic-frontend:latest You can now access the application at http://localhost:8080/ +Environment variables: +- `SERVER_URL` (Optional): The backend server URL. When set the server input on the login page will not be displayed. + + ### Pre-built bundle Pre-built bundles can be found in the [Actions](https://github.com/tamland/airsonic-frontend/actions) diff --git a/docker/Dockerfile b/docker/Dockerfile index 583ad5e..8c16b89 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,5 +2,12 @@ FROM nginx:alpine EXPOSE 80 +RUN apk add gettext COPY docker/nginx.conf /etc/nginx/conf.d/default.conf +COPY docker/env.js.template /env.js.template +COPY docker/docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x /docker-entrypoint.sh COPY dist/ /var/www/html/ + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["nginx", "-g", "daemon off;"] diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh new file mode 100644 index 0000000..cd8a63a --- /dev/null +++ b/docker/docker-entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e +envsubst < env.js.template > /var/www/html/env.js +exec "$@" diff --git a/docker/env.js.template b/docker/env.js.template new file mode 100644 index 0000000..bdf8525 --- /dev/null +++ b/docker/env.js.template @@ -0,0 +1,3 @@ +window.env = { + SERVER_URL: "$SERVER_URL", +} diff --git a/docker/nginx.conf b/docker/nginx.conf index 984efb0..16357fd 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -17,4 +17,8 @@ server { location = /index.html { add_header 'Cache-Control' 'no-cache'; } + + location = /env.js { + add_header 'Cache-Control' 'no-cache'; + } } diff --git a/public/index.html b/public/index.html index 9479827..c16637f 100644 --- a/public/index.html +++ b/public/index.html @@ -12,6 +12,7 @@ + diff --git a/src/auth/Login.vue b/src/auth/Login.vue index 375fcac..cade69f 100644 --- a/src/auth/Login.vue +++ b/src/auth/Login.vue @@ -5,7 +5,7 @@
- + @@ -28,6 +28,7 @@ >