Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Discourse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Roles
Discourse
Commits
a9c14d7a
Commit
a9c14d7a
authored
7 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Optional HTTP Basic auth for discourse
parent
c2d36d0e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tasks/apache.yml
+13
-0
13 additions, 0 deletions
tasks/apache.yml
tasks/install.yml
+4
-4
4 additions, 4 deletions
tasks/install.yml
templates/vhost.conf
+10
-3
10 additions, 3 deletions
templates/vhost.conf
with
27 additions
and
7 deletions
tasks/apache.yml
+
13
−
0
View file @
a9c14d7a
...
...
@@ -15,3 +15,16 @@
command
:
a2ensite discourse creates=/etc/apache2/sites-enabled/discourse{{ apache_conf_ext }}
notify
:
-
"
Apache
|
Restart
Apache"
-
block
:
-
name
:
"
Setup
AuthType
Basic"
htpasswd
:
path
:
'
/var/discourse/containers/passwords'
name
:
'
{{
discourse_apache_auth.user
}}'
password
:
'
{{
discourse_apache_auth.password
}}'
owner
:
'
root'
group
:
'
root'
mode
:
'
664'
when
:
discourse_apache_auth is defined
This diff is collapsed.
Click to expand it.
tasks/install.yml
+
4
−
4
View file @
a9c14d7a
---
# file: roles/discourse/tasks/install.yml
-
name
:
"
Configure
Apache"
include_tasks
:
apache.yml
tags
:
'
always'
-
name
:
"
Clone
Repository"
git
:
accept_hostkey
:
yes
...
...
@@ -26,3 +22,7 @@
shell
:
'
/var/discourse/launcher
rebuild
app'
when
:
discourse_repository.changed
-
name
:
"
Configure
Apache"
include_tasks
:
apache.yml
tags
:
'
always'
This diff is collapsed.
Click to expand it.
templates/vhost.conf
+
10
−
3
View file @
a9c14d7a
...
...
@@ -40,9 +40,16 @@
AllowEncodedSlashes
NoDecode
<
Location
/>
Require
all
granted
ProxyPassReverse
http
://
127
.
0
.
0
.
1
:
8181
ProxyPassReverse
http
://{{
discourse_domain
}}/
{%
if
discourse_apache_auth
is
defined
%}
AuthType
{{
discourse_apache_auth
.
type
}}
AuthName
"{{ discourse_apache_auth.name }}"
AuthUserFile
/
var
/
discourse
/
containers
/
passwords
Require
{{
discourse_apache_auth
.
user
}} {{
discourse_apache_auth
.
password
}}
{%
else
%}
Require
all
granted
{%
endif
%}
ProxyPassReverse
http
://
127
.
0
.
0
.
1
:
8181
ProxyPassReverse
http
://{{
discourse_domain
}}/
</
Location
>
RewriteEngine
on
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment