fix(examples): change config in example projects to solve startup issues (#2199)
* fix(configuration): change config in example projects to solve startup issues * fix(configuration): use new log level key * fix(configuration): remove redundant docker-compose error message Co-authored-by: hoflogic <hoflogic@users.noreply.github.com> Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com> Co-authored-by: Amir Zarrinkafsh <nightah@me.com>pull/2222/head
parent
71fe953a4e
commit
192219578a
|
@ -9,7 +9,7 @@
|
||||||
users:
|
users:
|
||||||
authelia:
|
authelia:
|
||||||
displayname: "Authelia User"
|
displayname: "Authelia User"
|
||||||
# Password is Authelia
|
# Password is authelia
|
||||||
password: "$6$rounds=50000$BpLnfgDsc2WD8F2q$Zis.ixdg9s/UOJYrs56b5QEZFiZECu0qZVNsIYxBaNJ7ucIL.nlxVCT5tqh8KHG8X4tlwCFm5r6NTOZZ5qRFN/" # yamllint disable-line rule:line-length
|
password: "$6$rounds=50000$BpLnfgDsc2WD8F2q$Zis.ixdg9s/UOJYrs56b5QEZFiZECu0qZVNsIYxBaNJ7ucIL.nlxVCT5tqh8KHG8X4tlwCFm5r6NTOZZ5qRFN/" # yamllint disable-line rule:line-length
|
||||||
email: authelia@authelia.com
|
email: authelia@authelia.com
|
||||||
groups:
|
groups:
|
||||||
|
|
|
@ -15,11 +15,11 @@ services:
|
||||||
- net
|
- net
|
||||||
labels:
|
labels:
|
||||||
- 'traefik.enable=true'
|
- 'traefik.enable=true'
|
||||||
- 'traefik.http.routers.authelia.rule=Host(`auth.example.com`)'
|
- 'traefik.http.routers.authelia.rule=Host(`authelia.example.com`)'
|
||||||
- 'traefik.http.routers.authelia.entrypoints=https'
|
- 'traefik.http.routers.authelia.entrypoints=https'
|
||||||
- 'traefik.http.routers.authelia.tls=true'
|
- 'traefik.http.routers.authelia.tls=true'
|
||||||
- 'traefik.http.routers.authelia.tls.certresolver=letsencrypt'
|
- 'traefik.http.routers.authelia.tls.certresolver=letsencrypt'
|
||||||
- 'traefik.http.middlewares.authelia.forwardauth.address=http://authelia:9091/api/verify?rd=https://auth.example.com' # yamllint disable-line rule:line-length
|
- 'traefik.http.middlewares.authelia.forwardauth.address=http://authelia:9091/api/verify?rd=https://authelia.example.com' # yamllint disable-line rule:line-length
|
||||||
- 'traefik.http.middlewares.authelia.forwardauth.trustForwardHeader=true'
|
- 'traefik.http.middlewares.authelia.forwardauth.trustForwardHeader=true'
|
||||||
- 'traefik.http.middlewares.authelia.forwardauth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email' # yamllint disable-line rule:line-length
|
- 'traefik.http.middlewares.authelia.forwardauth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email' # yamllint disable-line rule:line-length
|
||||||
expose:
|
expose:
|
||||||
|
@ -47,7 +47,7 @@ services:
|
||||||
image: traefik:2.4
|
image: traefik:2.4
|
||||||
container_name: traefik
|
container_name: traefik
|
||||||
volumes:
|
volumes:
|
||||||
- ./traefik/acme.json:/acme.json
|
- ./traefik:/etc/traefik
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
networks:
|
networks:
|
||||||
- net
|
- net
|
||||||
|
@ -73,7 +73,7 @@ services:
|
||||||
- '--entrypoints.https=true'
|
- '--entrypoints.https=true'
|
||||||
- '--entrypoints.https.address=:443'
|
- '--entrypoints.https.address=:443'
|
||||||
- '--certificatesResolvers.letsencrypt.acme.email=your-email@your-domain.com'
|
- '--certificatesResolvers.letsencrypt.acme.email=your-email@your-domain.com'
|
||||||
- '--certificatesResolvers.letsencrypt.acme.storage=acme.json'
|
- '--certificatesResolvers.letsencrypt.acme.storage=/etc/traefik/acme.json'
|
||||||
- '--certificatesResolvers.letsencrypt.acme.httpChallenge.entryPoint=http'
|
- '--certificatesResolvers.letsencrypt.acme.httpChallenge.entryPoint=http'
|
||||||
- '--log=true'
|
- '--log=true'
|
||||||
- '--log.level=DEBUG'
|
- '--log.level=DEBUG'
|
||||||
|
|
|
@ -32,18 +32,18 @@ if [[ ! -x "$(command -v docker-compose)" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Pulling Authelia docker image for setup"
|
|
||||||
docker pull authelia/authelia > /dev/null
|
|
||||||
|
|
||||||
if [[ $(id -u) != 0 ]]; then
|
if [[ $(id -u) != 0 ]]; then
|
||||||
echo "The script requires root access to perform some functions such as modifying your /etc/hosts file"
|
echo "The script requires root access to perform some functions such as modifying your /etc/hosts file"
|
||||||
read -rp "Would you like to elevate access with sudo? [y/N] " confirmsudo
|
read -rp "Would you like to elevate access with sudo? [y/N] " confirmsudo
|
||||||
if ! [[ "$confirmsudo" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
if ! [[ "$confirmsudo" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
||||||
echo "Sudo elevation denied, exiting"
|
echo "Sudo elevation denied, exiting"
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Pulling Authelia docker image for setup"
|
||||||
|
sudo docker pull authelia/authelia > /dev/null
|
||||||
|
|
||||||
echo "Resetting docker-compose.yml, configuration.yml and users_database.yml"
|
echo "Resetting docker-compose.yml, configuration.yml and users_database.yml"
|
||||||
sudo git checkout -- docker-compose.yml authelia/configuration.yml authelia/users_database.yml
|
sudo git checkout -- docker-compose.yml authelia/configuration.yml authelia/users_database.yml
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ if [[ $MODIFIED == "false" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Generating SSL certificate for *.$DOMAIN"
|
echo "Generating SSL certificate for *.$DOMAIN"
|
||||||
docker run -a stdout -v $PWD/traefik/certs:/tmp/certs authelia/authelia authelia certificates generate --host *.$DOMAIN --dir /tmp/certs/ > /dev/null
|
sudo docker run -a stdout -v $PWD/traefik/certs:/tmp/certs authelia/authelia authelia certificates generate --host *.$DOMAIN --dir /tmp/certs/ > /dev/null
|
||||||
|
|
||||||
if [[ $DOMAIN != "example.com" ]]; then
|
if [[ $DOMAIN != "example.com" ]]; then
|
||||||
if [[ $(uname) == "Darwin" ]]; then
|
if [[ $(uname) == "Darwin" ]]; then
|
||||||
|
@ -99,7 +99,7 @@ fi
|
||||||
password
|
password
|
||||||
|
|
||||||
if [[ $PASSWORD != "" ]]; then
|
if [[ $PASSWORD != "" ]]; then
|
||||||
PASSWORD=$(docker run authelia/authelia authelia hash-password $PASSWORD | sed 's/Password hash: //g')
|
PASSWORD=$(sudo docker run authelia/authelia authelia hash-password $PASSWORD | sed 's/Password hash: //g')
|
||||||
if [[ $(uname) == "Darwin" ]]; then
|
if [[ $(uname) == "Darwin" ]]; then
|
||||||
sudo sed -i '' "s/<PASSWORD>/$(echo $PASSWORD | sed -e 's/[\/&]/\\&/g')/g" authelia/users_database.yml
|
sudo sed -i '' "s/<PASSWORD>/$(echo $PASSWORD | sed -e 's/[\/&]/\\&/g')/g" authelia/users_database.yml
|
||||||
else
|
else
|
||||||
|
@ -110,7 +110,11 @@ else
|
||||||
password
|
password
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker-compose up -d
|
sudo docker-compose up -d
|
||||||
|
|
||||||
|
if [[ $? != 0 ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Setup completed successfully.
|
Setup completed successfully.
|
||||||
|
|
Loading…
Reference in New Issue