summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorblsaws <bryan.sullivan@att.com>2016-05-18 17:55:21 -0700
committerblsaws <bryan.sullivan@att.com>2016-05-18 17:55:21 -0700
commitf60b652464b150d4e7837fceb522dafbf7c2b91e (patch)
tree2c558d907c78e5d19a80f81f9b93867f6dea2c7d /components
parenta770106f9511b4d57b0a30f2f587345b276da903 (diff)
Add port to congress proxy server; disable proxy logging (error)
JIRA: COPPER-4 Change-Id: I09ca53bdf9a90884bf40be33ade6e2e579d2781c Signed-off-by: blsaws <bryan.sullivan@att.com>
Diffstat (limited to 'components')
-rw-r--r--components/congress/test-webapp/apache-config.conf20
-rw-r--r--components/congress/test-webapp/setup/install_congress_testserver_1.sh8
-rw-r--r--components/congress/test-webapp/www/copper.js2
-rw-r--r--components/congress/test-webapp/www/proxy/index.php4
4 files changed, 27 insertions, 7 deletions
diff --git a/components/congress/test-webapp/apache-config.conf b/components/congress/test-webapp/apache-config.conf
index f89e608..b84f70c 100644
--- a/components/congress/test-webapp/apache-config.conf
+++ b/components/congress/test-webapp/apache-config.conf
@@ -1,3 +1,23 @@
+# Copyright 2015-2016 AT&T Intellectual Property, Inc
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# What this is: Apache config file used by the docker build process,
+# for testing the OpenStack Congress service, as installed under the
+# OPNFV platform.
+# Status: this is a work in progress, under test.
+#
+
<VirtualHost *:80>
ServerAdmin me@mydomain.com
DocumentRoot /var/www/site
diff --git a/components/congress/test-webapp/setup/install_congress_testserver_1.sh b/components/congress/test-webapp/setup/install_congress_testserver_1.sh
index 0c8d24a..b572b60 100644
--- a/components/congress/test-webapp/setup/install_congress_testserver_1.sh
+++ b/components/congress/test-webapp/setup/install_congress_testserver_1.sh
@@ -93,13 +93,13 @@ enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
- sudo yum install -y docker-engine
sudo service docker start
echo "Setup webapp files"
if [ ! -d /tmp/copper ]; then mkdir /tmp/copper; fi
if [ ! -d /tmp/copper/log ]; then mkdir /tmp/copper/log; fi
- cp ~/congress/*.sh /tmp/copper
+ sudo scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no stack@192.0.2.1:/home/stack/congress/*.sh /tmp/copper
+ source /tmp/copper/env.sh
cp -r ~/git/copper/components/congress/test-webapp/* /tmp/copper/
echo "Point proxy.php to the Congress server"
source /tmp/copper/env.sh
@@ -113,10 +113,10 @@ EOF
echo "Start Centos container"
sudo docker pull centos
- export CID=$(sudo docker run -d -t -P --name copper-cli -v /tmp/copper:/opt/copper centos /bin/bash)
echo "Attach to the Centos container"
echo "Once logged in, enter the command 'source /opt/copper/setup/install_congress_testserver_2.sh'"
- sudo docker attach $CID
+ sudo docker run -i -t -P --name copper-cli -v /tmp/copper:/opt/copper centos /bin/bash)
+# sudo docker attach $CID
# sudo docker run -it -P --name copper -v /tmp/copper:/opt/copper centos /opt/copper/setup/install_congress_testserver_2.sh
# sudo docker ps -a
fi
diff --git a/components/congress/test-webapp/www/copper.js b/components/congress/test-webapp/www/copper.js
index bd44f05..a9656c1 100644
--- a/components/congress/test-webapp/www/copper.js
+++ b/components/congress/test-webapp/www/copper.js
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-var origin = "http://localhost/proxy/?~url=";
+var origin = "http://localhost:2257/proxy/?~url=";
var dataSources = [];
var datasource_tables = [];
var datasource_rows = [];
diff --git a/components/congress/test-webapp/www/proxy/index.php b/components/congress/test-webapp/www/proxy/index.php
index f459549..b8e954d 100644
--- a/components/congress/test-webapp/www/proxy/index.php
+++ b/components/congress/test-webapp/www/proxy/index.php
@@ -44,14 +44,14 @@ $req_time=time();
$info = curl_getinfo($curlop);
$result = file_put_contents("/tmp/copper/log/".date('ymd').".log", "proxy.php, ".$req_time.", ".$url.", ".$type.", ".$body."\n",FILE_APPEND);
-if ($result === false) $response = "PHP error in index.php";
+//if ($result === false) $response = "PHP error in index.php";
$responseCode=curl_getinfo($curlop,CURLINFO_HTTP_CODE);
$header_size = curl_getinfo($response, CURLINFO_HEADER_SIZE);
$header = substr($response, 0, $header_size);
$type = curl_getinfo($curlop,CURLINFO_CONTENT_TYPE);
$body = substr($response, $header_size);
$result = file_put_contents("/tmp/copper/log/".date('ymd').".log", "proxy.php, ".$req_time.", ".$responseCode.", ".$type.", ".$header.", ".$body."\n",FILE_APPEND);
-if ($result === false) $response = "PHP error in index.php";
+//if ($result === false) $response = "PHP error in index.php";
// header("Location: ".$url);
header("Content-Type: ".$type);