-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from pyvec/beta-http-auth
Enable HTTP Basic auth when HTTP_AUTH env. var is set
- Loading branch information
Showing
5 changed files
with
35 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
auth_basic "PyCon CZ Beta site"; | ||
auth_basic_user_file /etc/nginx/htpasswd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -n "${HTTP_AUTH}" ]; then | ||
echo "Enabling HTTP Auth, using htpasswd file from the HTTP_AUTH env. variable." | ||
ln -s /etc/nginx/pycon-config-available/10-http-auth.inc.conf /etc/nginx/pycon-config-enabled/10-http-auth.inc.conf | ||
echo "${HTTP_AUTH}" > /etc/nginx/htpasswd | ||
fi | ||
|
||
exec nginx -g "daemon off;" |