Merge "Handle SSL proxying and other fixes"
This commit is contained in:
commit
e0a596bf15
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
.dockerignore
|
||||
Dockerfile
|
@ -34,7 +34,7 @@ RUN apt-get update \
|
||||
&& apt-get install -y dumb-init apache2 $(cat /run.txt) \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /run.txt \
|
||||
&& a2enmod rewrite proxy proxy_http
|
||||
&& a2enmod rewrite proxy proxy_http ssl
|
||||
COPY ./vhost.conf /etc/apache2/sites-available/000-default.conf
|
||||
COPY --from=builder /usr/local /usr/local
|
||||
|
||||
|
@ -9,4 +9,5 @@
|
||||
RewriteMap preview "prg://usr/local/bin/zuul-preview"
|
||||
RewriteRule "^/notfound" "-" [F]
|
||||
RewriteRule "^/?(.*)$" "${preview:%{ENV:ZUUL_API_URL} %{HTTP_HOST}|http://localhost/notfound}/$1" [P]
|
||||
SSLProxyEngine on
|
||||
</VirtualHost>
|
||||
|
@ -165,7 +165,7 @@ int main(int, char**)
|
||||
auto body = response.extract_json().get();
|
||||
auto artifacts = body["artifacts"].as_array();
|
||||
|
||||
string artifact_url = "Artifact_not_found";
|
||||
string artifact_url = "NULL";
|
||||
for (uint i = 0; i < artifacts.size(); i++) {
|
||||
if (artifacts[i].has_field("metadata") &&
|
||||
artifacts[i]["metadata"].has_field("type") &&
|
||||
@ -175,6 +175,11 @@ int main(int, char**)
|
||||
}
|
||||
}
|
||||
|
||||
// The apache config is guaranteed to add a / to this, so avoid
|
||||
// double slashes on the end.
|
||||
if (artifact_url.back() == '/') {
|
||||
artifact_url.pop_back();
|
||||
}
|
||||
cout << artifact_url << endl;
|
||||
|
||||
cache.put(hostname, artifact_url);
|
||||
|
Loading…
Reference in New Issue
Block a user