forked from oracle/docker-images
-
Notifications
You must be signed in to change notification settings - Fork 0
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 oracle#395 from mikarinneoracle/rolling-router-sti…
…cky-sessions-management-ui rolling-router-sticky-sessions ui added
- Loading branch information
Showing
16 changed files
with
702 additions
and
3 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
48 changes: 48 additions & 0 deletions
48
ContainerCloud/images/rolling-router-sticky-sessions/mime.types
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,48 @@ | ||
types { | ||
text/html html htm shtml; | ||
text/css css; | ||
text/xml xml rss; | ||
image/gif gif; | ||
image/jpeg jpeg jpg; | ||
application/x-javascript js; | ||
text/plain txt; | ||
text/x-component htc; | ||
text/mathml mml; | ||
image/png png; | ||
image/x-icon ico; | ||
image/x-jng jng; | ||
image/vnd.wap.wbmp wbmp; | ||
application/java-archive jar war ear; | ||
application/mac-binhex40 hqx; | ||
application/pdf pdf; | ||
application/x-cocoa cco; | ||
application/x-java-archive-diff jardiff; | ||
application/x-java-jnlp-file jnlp; | ||
application/x-makeself run; | ||
application/x-perl pl pm; | ||
application/x-pilot prc pdb; | ||
application/x-rar-compressed rar; | ||
application/x-redhat-package-manager rpm; | ||
application/x-sea sea; | ||
application/x-shockwave-flash swf; | ||
application/x-stuffit sit; | ||
application/x-tcl tcl tk; | ||
application/x-x509-ca-cert der pem crt; | ||
application/x-xpinstall xpi; | ||
application/zip zip; | ||
application/octet-stream deb; | ||
application/octet-stream bin exe dll; | ||
application/octet-stream dmg; | ||
application/octet-stream eot; | ||
application/octet-stream iso img; | ||
application/octet-stream msi msp msm; | ||
audio/mpeg mp3; | ||
audio/x-realaudio ra; | ||
video/mpeg mpeg mpg; | ||
video/quicktime mov; | ||
video/x-flv flv; | ||
video/x-msvideo avi; | ||
video/x-ms-wmv wmv; | ||
video/x-ms-asf asx asf; | ||
video/x-mng mng; | ||
} |
13 changes: 12 additions & 1 deletion
13
ContainerCloud/images/rolling-router-sticky-sessions/nginx-files/99-app
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 |
---|---|---|
@@ -1,6 +1,17 @@ | ||
|
||
server { | ||
listen 8080; | ||
root /etc/nginx/html; | ||
location ~ \.php$ { | ||
fastcgi_pass 127.0.0.1:9000; | ||
fastcgi_index index.php; | ||
include fastcgi.conf; | ||
} | ||
} | ||
|
||
server { | ||
listen 80; | ||
location / { | ||
proxy_pass http://rollingservices; | ||
proxy_pass http://rollingservices; | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
ContainerCloud/images/rolling-router-sticky-sessions/php-fpm.sh
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,7 @@ | ||
#!/bin/sh | ||
|
||
# start php-fpm service and don't run this again | ||
|
||
/usr/bin/php-fpm | ||
|
||
sv down php-fpm |
5 changes: 5 additions & 0 deletions
5
ContainerCloud/images/rolling-router-sticky-sessions/php-fpm2.sh
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,5 @@ | ||
#!/bin/sh | ||
|
||
# run the script below to start php-fpm service | ||
|
||
exec /tmp/php-fpm.sh |
97 changes: 97 additions & 0 deletions
97
ContainerCloud/images/rolling-router-sticky-sessions/ui/REST.php
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,97 @@ | ||
<?php | ||
|
||
if($_SERVER['REQUEST_METHOD'] == POST) | ||
{ | ||
$token = $_POST['bearer']; | ||
$host = $_POST['host']; | ||
$url = $_POST['url']; | ||
$method = $_POST['method']; | ||
$data = $_POST['data']; | ||
|
||
if(!$token || !$host || !$url || !$method) | ||
{ | ||
$token = $argv[1]; | ||
$host = $argv[2]; | ||
$url = $argv[3]; | ||
$method = $argv[4]; | ||
$data = $argv[5]; | ||
} | ||
|
||
if(!$token || !$host || !$url || !$method) | ||
{ | ||
http_response_code(400); | ||
echo "Please use POST parameters: bearer host url method [data]\n"; | ||
echo "Received:\n"; | ||
echo $_POST['bearer'] . "\n"; | ||
echo $_POST['host'] . "\n"; | ||
echo $_POST['url'] . "\n"; | ||
echo $_POST['method'] . "\n"; | ||
echo $_POST['data'] . "\n"; | ||
exit; | ||
} | ||
|
||
$auth = 'Bearer ' . $token; | ||
$curl = curl_init(); | ||
$headers = ['Authorization: ' . $auth ]; | ||
|
||
if($method == 'POST') | ||
{ | ||
curl_setopt_array($curl, array( | ||
CURLOPT_RETURNTRANSFER => 1, | ||
CURLOPT_URL => 'https://' . $host . $url, | ||
CURLOPT_HTTPHEADER => $headers, | ||
CURLOPT_SSL_VERIFYHOST => 0, | ||
CURLOPT_SSL_VERIFYPEER => 0, | ||
CURLOPT_FAILONERROR => 1, | ||
CURLOPT_POST => 1, | ||
CURLOPT_POSTFIELDS => $data | ||
)); | ||
} else if($method == 'PUT') { | ||
curl_setopt_array($curl, array( | ||
CURLOPT_RETURNTRANSFER => 1, | ||
CURLOPT_URL => 'https://' . $host . $url, | ||
CURLOPT_HTTPHEADER => $headers, | ||
CURLOPT_SSL_VERIFYHOST => 0, | ||
CURLOPT_SSL_VERIFYPEER => 0, | ||
CURLOPT_FAILONERROR => 1, | ||
CURLOPT_CUSTOMREQUEST => 'PUT', | ||
CURLOPT_POSTFIELDS => $data | ||
)); | ||
} else if($method == 'DELETE') { | ||
curl_setopt_array($curl, array( | ||
CURLOPT_RETURNTRANSFER => 1, | ||
CURLOPT_URL => 'https://' . $host . $url, | ||
CURLOPT_HTTPHEADER => $headers, | ||
CURLOPT_SSL_VERIFYHOST => 0, | ||
CURLOPT_SSL_VERIFYPEER => 0, | ||
CURLOPT_FAILONERROR => 1, | ||
CURLOPT_CUSTOMREQUEST => 'DELETE' | ||
)); | ||
} else { | ||
curl_setopt_array($curl, array( | ||
CURLOPT_RETURNTRANSFER => 1, | ||
CURLOPT_URL => 'https://' . $host . $url, | ||
CURLOPT_HTTPHEADER => $headers, | ||
CURLOPT_SSL_VERIFYHOST => 0, | ||
CURLOPT_SSL_VERIFYPEER => 0, | ||
CURLOPT_FAILONERROR => 1 | ||
)); | ||
} | ||
|
||
$resp = curl_exec($curl); | ||
if($errno = curl_errno($curl)) { | ||
$error_message = curl_strerror($errno); | ||
curl_close($curl); | ||
http_response_code(400); | ||
echo $error_message . "\n"; | ||
echo $_POST['bearer'] . "\n"; | ||
echo $_POST['host'] . "\n"; | ||
echo $_POST['url'] . "\n"; | ||
echo $_POST['method'] . "\n"; | ||
echo $_POST['data'] . "\n"; | ||
var_dump($headers); | ||
} else { | ||
curl_close($curl); | ||
echo $resp; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
ContainerCloud/images/rolling-router-sticky-sessions/ui/controllers/rollingRouter.js
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,20 @@ | ||
var app = angular | ||
.module('rollingRouter', [ | ||
'ngRoute', | ||
]) | ||
|
||
.config(function ($routeProvider) { | ||
$routeProvider | ||
.when('/', { | ||
templateUrl: '../views/setup.html', | ||
controller: 'rollingRouterController' | ||
}) | ||
.when('/manage', { | ||
templateUrl: '../views/manage.html', | ||
controller: 'rollingRouterController' | ||
}) | ||
.otherwise({ | ||
redirectTo: '/' | ||
}); | ||
|
||
}); |
Oops, something went wrong.