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
Mike 2021-08-02 14:29:45 +10:00 committed by GitHub
parent 71fe953a4e
commit 192219578a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 12 deletions

View File

@ -9,7 +9,7 @@
users:
authelia:
displayname: "Authelia User"
# Password is Authelia
# Password is authelia
password: "$6$rounds=50000$BpLnfgDsc2WD8F2q$Zis.ixdg9s/UOJYrs56b5QEZFiZECu0qZVNsIYxBaNJ7ucIL.nlxVCT5tqh8KHG8X4tlwCFm5r6NTOZZ5qRFN/" # yamllint disable-line rule:line-length
email: authelia@authelia.com
groups:

View File

@ -15,11 +15,11 @@ services:
- net
labels:
- '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.tls=true'
- '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.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email' # yamllint disable-line rule:line-length
expose:
@ -47,7 +47,7 @@ services:
image: traefik:2.4
container_name: traefik
volumes:
- ./traefik/acme.json:/acme.json
- ./traefik:/etc/traefik
- /var/run/docker.sock:/var/run/docker.sock
networks:
- net
@ -73,7 +73,7 @@ services:
- '--entrypoints.https=true'
- '--entrypoints.https.address=:443'
- '--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'
- '--log=true'
- '--log.level=DEBUG'

View File

@ -32,18 +32,18 @@ if [[ ! -x "$(command -v docker-compose)" ]]; then
exit 1
fi
echo "Pulling Authelia docker image for setup"
docker pull authelia/authelia > /dev/null
if [[ $(id -u) != 0 ]]; then
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
if ! [[ "$confirmsudo" =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo "Sudo elevation denied, exiting"
exit
exit 1
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"
sudo git checkout -- docker-compose.yml authelia/configuration.yml authelia/users_database.yml
@ -60,7 +60,7 @@ if [[ $MODIFIED == "false" ]]; then
fi
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 [[ $(uname) == "Darwin" ]]; then
@ -99,7 +99,7 @@ fi
password
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
sudo sed -i '' "s/<PASSWORD>/$(echo $PASSWORD | sed -e 's/[\/&]/\\&/g')/g" authelia/users_database.yml
else
@ -110,7 +110,11 @@ else
password
fi
docker-compose up -d
sudo docker-compose up -d
if [[ $? != 0 ]]; then
exit 1
fi
cat << EOF
Setup completed successfully.