mirror of
https://github.com/dmmeteo/docker-shlink-web-client.git
synced 2025-05-01 00:32:45 +01:00
add dockerfile based on shlink-web-client
This commit is contained in:
parent
fb6f5dc141
commit
90aea066ff
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@ -0,0 +1,13 @@
|
||||
FROM shlinkio/shlink-web-client:latest
|
||||
|
||||
ENV SHLINK_BASIC_AUTH_USERS 'shlink:$2y$05$60tNO1beevtKPMj/jaSzhuxOn21U2dEOXPOdUA2b.TbZ9007kCoLK'
|
||||
ENV SHLINK_BASIC_AUTH_NAME 'Shlink Web Client'
|
||||
|
||||
RUN sed -i "6 i auth_basic \"SHLINK_BASIC_AUTH_NAME\";\nauth_basic_user_file /etc/nginx/.htpasswd;" /etc/nginx/conf.d/default.conf
|
||||
|
||||
WORKDIR /usr/share/nginx/html/
|
||||
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
23
README.md
Normal file
23
README.md
Normal file
@ -0,0 +1,23 @@
|
||||
# Shlink Web Client with Basic HTTP Auth
|
||||
|
||||
[](https://hub.docker.com/r/dmmeteo/shlink-web-client/)
|
||||
[](https://hub.docker.com/r/dmmeteo/shlink-web-client/)
|
||||
[](https://hub.docker.com/r/dmmeteo/shlink-web-client/)
|
||||
[](https://hub.docker.com/r/dmmeteo/shlink-web-client/)
|
||||
[](https://hub.docker.com/r/dmmeteo/shlink-web-client/)
|
||||
[](https://hub.docker.com/r/dmmeteo/shlink-web-client/)
|
||||
|
||||
This repository adds Basic HTTP Auth to the web client of [Shlink][2].
|
||||
|
||||
For further documentation see [the official Shlink Dockerhub page][1].
|
||||
|
||||
## Environment variables
|
||||
|
||||
SHLINK_SERVER_URL: The fully qualified URL for the Shlink server.
|
||||
SHLINK_SERVER_API_KEY: The API key.
|
||||
SHLINK_SERVER_NAME: The name to be displayed. Defaults to Shlink if not provided.
|
||||
SHLINK_BASIC_AUTH_NAME: The name to be displayed in the basic auth dialog (default: Shlink).
|
||||
SHLINK_BASIC_AUTH_USERS: A comma separated list of users in the form of `user:password` (default: shlink:shlink).
|
||||
|
||||
[1]: https://hub.docker.com/r/dmmeteo/shlink-web-client
|
||||
[2]: https://shlink.io
|
20
docker-compose.yml
Normal file
20
docker-compose.yml
Normal file
@ -0,0 +1,20 @@
|
||||
version: '3'
|
||||
services:
|
||||
shlink-ui:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
SHLINK_API_KEY: '<your-api-key>'
|
||||
SHLINK_API_URL: 'http://shlink:8080'
|
||||
ports:
|
||||
- 8081:80
|
||||
depends_on:
|
||||
- shlink
|
||||
shlink:
|
||||
image: shlinkio/shlink:latest
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 8080:8080
|
||||
environment:
|
||||
SHORT_DOMAIN_HOST: localhost
|
||||
IS_HTTPS_ENABLED: False
|
18
docker-entrypoint.sh
Executable file
18
docker-entrypoint.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [[ -z "$SHLINK_BASIC_AUTH_USERS" ]]; then
|
||||
echo "No users found for basic auth"
|
||||
else
|
||||
echo "Creating .htpasswd file"
|
||||
echo "$SHLINK_BASIC_AUTH_USERS" > /etc/nginx/.htpasswd
|
||||
fi
|
||||
|
||||
if [[ -z "$SHLINK_BASIC_AUTH_USERS" ]]; then
|
||||
echo "No name found for basic auth"
|
||||
else
|
||||
echo "Setting basic auth name"
|
||||
sed -i "s/SHLINK_BASIC_AUTH_NAME/$SHLINK_BASIC_AUTH_NAME/g" /etc/nginx/conf.d/default.conf
|
||||
fi
|
||||
|
||||
exec "$@"
|
Loading…
x
Reference in New Issue
Block a user