Skip to content

Commit

Permalink
Authelia with Let's Encrypt Using Docker Compose
Browse files Browse the repository at this point in the history
  • Loading branch information
heyvaldemar committed Oct 6, 2024
0 parents commit dd37816
Show file tree
Hide file tree
Showing 15 changed files with 728 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Traefik Variables
TRAEFIK_IMAGE_TAG=traefik:2.9
TRAEFIK_LOG_LEVEL=WARN
TRAEFIK_ACME_EMAIL=callvaldemar@gmail.com
TRAEFIK_HOSTNAME=traefik.authelia.heyvaldemar.net
# Basic Authentication for Traefik Dashboard
# Username: traefikadmin
# Passwords must be encoded using MD5, SHA1, or BCrypt https://hostingcanada.org/htpasswd-generator/
TRAEFIK_BASIC_AUTH=traefikadmin:$$2y$$10$$sMzJfirKC75x/hVpiINeZOiSm.Jkity9cn4KwNkRvO7hSQVFc5FLO

# Authelia Variables
AUTHELIA_POSTGRES_IMAGE_TAG=postgres:16
AUTHELIA_REDIS_IMAGE_TAG=bitnami/redis:7.4
AUTHELIA_IMAGE_TAG=authelia/authelia:4.38
AUTHELIA_DB_NAME=autheliadb
AUTHELIA_DB_USER=autheliadbuser
AUTHELIA_HOSTNAME=authelia.heyvaldemar.net
# Timezone inside container
# A list of these tz database names can be looked up at Wikipedia
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
AUTHELIA_TIMEZONE=America/New_York
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github: heyvaldemar
patreon: heyvaldemar
ko_fi: heyvaldemar
custom: ['paypal.com/paypalme/heyValdemarCOM', 'buymeacoffee.com/heyValdemar', 'ko-fi.com/heyValdemar']
50 changes: 50 additions & 0 deletions .github/workflows/00-deployment-verification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deployment Verification

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
deploy-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Create necessary Docker networks
run: |
docker network create authelia-network || true
docker network create traefik-network || true
- name: Start up services using Docker Compose
run: docker compose -f authelia-traefik-letsencrypt-docker-compose.yml up -d

- name: Modify /etc/hosts for internal routing
run: |
echo "127.0.0.1 authelia.heyvaldemar.net" | sudo tee -a /etc/hosts
echo "127.0.0.1 traefik.authelia.heyvaldemar.net" | sudo tee -a /etc/hosts
- name: Print Docker Compose services status
run: docker ps

- name: Wait for the application to be ready via Traefik
run: |
echo "Checking the routing and availability of application via Traefik..."
timeout 5m bash -c 'while ! curl -fsSLk "https://authelia.heyvaldemar.net"; do echo "Waiting for the application to be ready..."; sleep 10; done'
- name: Inspect Network Configuration
run: |
docker network inspect authelia-network
docker network inspect traefik-network
- name: Shutdown Docker Compose services
if: always()
run: docker compose -f authelia-traefik-letsencrypt-docker-compose.yml down
278 changes: 278 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
# Created by https://www.toptal.com/developers/gitignore/api/git,macos,xcode,jekyll,packer,ansible,vagrant,windows,notepadpp,terraform,powershell,terragrunt,sublimetext,ansibletower,visualstudiocode,linux
# Edit at https://www.toptal.com/developers/gitignore?templates=git,macos,xcode,jekyll,packer,ansible,vagrant,windows,notepadpp,terraform,powershell,terragrunt,sublimetext,ansibletower,visualstudiocode,linux

### Ansible ###
*.retry

### AnsibleTower ###
# Ansible runtime and backups
*.original
*.tmp
*.bkp
*.*~

# Tower runtime roles
roles/**
!roles/requirements.yml

# Exclude all binaries
*.bin
*.jar
*.tar
*.zip
*.gzip
*.tgz


### Git ###
# Created by git for backups. To disable backups in Git:
# $ git config --global mergetool.keepBackup false
*.orig

# Created by git when using merge tools for conflicts
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*_BACKUP_*.txt
*_BASE_*.txt
*_LOCAL_*.txt
*_REMOTE_*.txt

### Jekyll ###
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata
# Ignore folders generated by Bundler
.bundle/
vendor/

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### NotepadPP ###
# Notepad++ backups #
*.bak

### Packer ###
# Cache objects
packer_cache/

# Crash log
crash.log

# https://www.packer.io/guides/hcl/variables
# Exclude all .pkrvars.hcl files, which are likely to contain sensitive data,
# such as password, private keys, and other secrets. These should not be part of
# version control as they are data points which are potentially sensitive and
# subject to change depending on the environment.
#
*.pkrvars.hcl

# For built boxes
*.box

### Packer Patch ###
# ignore temporary output files
output-*/

### PowerShell ###
# Exclude packaged modules

# Exclude .NET assemblies from source
*.dll

### SublimeText ###
# Cache files for Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# Workspace files are user-specific
*.sublime-workspace

# Project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using Sublime Text
# *.sublime-project

# SFTP configuration file
sftp-config.json
sftp-config-alt*.json

# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache

# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings

### Terraform ###
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc

### Terragrunt ###
# terragrunt cache directories
**/.terragrunt-cache/*

# Terragrunt debug output file (when using `--terragrunt-debug` option)
# See: https://terragrunt.gruntwork.io/docs/reference/cli-options/#terragrunt-debug
terragrunt-debug.tfvars.json

### Vagrant ###
# General
.vagrant/

# Log files (if you are creating logs in debug mode, uncomment this)
# *.log

### Vagrant Patch ###

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

### Xcode ###
## User settings
xcuserdata/

## Xcode 8 and earlier
*.xcscmblueprint
*.xccheckout

### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcodeproj/project.xcworkspace/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno
**/xcshareddata/WorkspaceSettings.xcsettings

# End of https://www.toptal.com/developers/gitignore/api/git,macos,xcode,jekyll,packer,ansible,vagrant,windows,notepadpp,terraform,powershell,terragrunt,sublimetext,ansibletower,visualstudiocode,linux
Loading

0 comments on commit dd37816

Please sign in to comment.