Skip to content

Commit 8a5c691

Browse files
author
Andrew Dunn
committed
Initial cut of the github proxy with rewriting of the response content and headers to alter the URLs generated by github so that they go back through the proxy.
0 parents  commit 8a5c691

20 files changed

+1003
-0
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.gradle
2+
build
3+
target
4+
.classpath
5+
.project
6+
.springBeans
7+
.settings/
8+
9+
.Rproj.user
10+
.Rbuildignore
11+
.Rhistory
12+
.Rproj
13+
.vagrant
14+
bin

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# RCloud Gist Service
2+
3+
## Overview
4+
5+
The RCloud Gist Service is a Java based service for enabling gist access to various different backend storage systems.
6+
7+
## Building
8+
### Requirements
9+
* Java 1.8 or above.
10+
11+
### Building
12+
The project uses the gradle build system and contains the gradle wrapper script
13+
which will automatically obtain the specified version of gradle. Building the
14+
software for the first time maybe slow.
15+
16+
#### Build commands
17+
* Build the whole project: `gradlew build`
18+
* Cleaning the project: `gradlew clean`
19+
* Running build with reporting: `gradlew clean build generateProjectReports`
20+
21+
#### Versioning
22+
The project uses GitFlow, and the .
23+
24+
#### Contributing
25+
* This project follows GitFlow, all development should be done on feature branches with pull requests to merge into the development branches.
26+
27+
28+
#### IDE integration
29+
#### Eclipse
30+
There are two mechanisms to load the project into the Eclipse IDE:
31+
1. Use the Eclipse gradle plugin [BuildShip](https://github.com/eclipse/buildship), this is an Eclipse plugin that understands gradle projects. BuildShip does not include syntax highlighting editor, you will have to install Groovy Eclipse plugin.
32+
2. Use the gradle eclipse plugin (this is a plugin in the gradle build file that will generate the appropriate eclipse project). To generate the eclipse files run the following `gradlew eclipse`, you can then import the project in as an existing project. When you add a new dependency in you will need to run this again to regenerate the eclipse project files and then refresh the project in eclipse and it will pick up the new settings. If you want to just generate the eclipse files for a specific sub module then run the command `gradlew :store:eclipse` for the store sub project.
33+
34+
## Components
35+
36+
## LICENSE & Copyright

build.gradle

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
buildscript {
2+
repositories {
3+
maven { url 'https://plugins.gradle.org/m2/' }
4+
jcenter()
5+
mavenCentral()
6+
}
7+
dependencies {
8+
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.4.3.RELEASE'
9+
classpath 'io.spring.gradle:dependency-management-plugin:0.6.1.RELEASE'
10+
classpath 'com.netflix.nebula:gradle-ospackage-plugin:3.7.1'
11+
classpath 'com.netflix.nebula:gradle-info-plugin:3.5.0'
12+
classpath 'com.netflix.nebula:nebula-project-plugin:3.3.0'
13+
classpath 'gradle.plugin.com.github.jk1:gradle-license-report:0.3.5'
14+
classpath 'com.fizzpod:gradle-sweeney-plugin:2.1.1'
15+
classpath 'pl.allegro.tech.build:axion-release-plugin:1.4.1'
16+
}
17+
}
18+
19+
apply plugin: 'com.fizzpod.sweeney'
20+
apply plugin: "pl.allegro.tech.build.axion-release"
21+
22+
23+
sweeney {
24+
enforce 'jdk:[1.7,)'
25+
enforce 'gradle:[2.14,)'
26+
validate()
27+
}
28+
29+
scmVersion {
30+
tag {
31+
prefix = 'release-'
32+
}
33+
}
34+
35+
allprojects {
36+
repositories {
37+
jcenter()
38+
}
39+
group = 'com.mangosolutions.rcloud'
40+
project.version = scmVersion.version
41+
42+
}
43+
44+
subprojects {
45+
apply plugin: 'java'
46+
apply plugin: 'groovy'
47+
apply plugin: "io.spring.dependency-management"
48+
apply plugin: 'eclipse'
49+
apply plugin: 'nebula.info'
50+
apply plugin: 'nebula.integtest'
51+
apply plugin: 'maven'
52+
apply plugin: 'maven-publish'
53+
54+
55+
56+
sourceCompatibility = JavaVersion.VERSION_1_7
57+
targetCompatibility = JavaVersion.VERSION_1_7
58+
59+
dependencyManagement {
60+
imports {
61+
mavenBom 'org.springframework.cloud:spring-cloud-starter-parent:Camden.SR4'
62+
mavenBom 'org.springframework.boot:spring-boot-starter-parent:1.4.3.RELEASE'
63+
}
64+
}
65+
66+
//Exclude the log4j dependencies as will use logback
67+
configurations {
68+
all*.exclude group: 'log4j', module: 'log4j'
69+
all*.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
70+
all*.exclude module: "spring-boot-starter-tomcat"
71+
}
72+
73+
task sourcesJar(type: Jar, dependsOn: classes) {
74+
classifier = 'sources'
75+
from sourceSets.main.allSource
76+
}
77+
78+
tasks.withType(JavaExec) {
79+
if (Boolean.getBoolean('DEBUG')) {
80+
jvmArgs '-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000'
81+
}
82+
}
83+
84+
task javadocJar(type: Jar, dependsOn: javadoc) {
85+
classifier = 'javadoc'
86+
from javadoc.destinationDir
87+
}
88+
89+
artifacts {
90+
archives sourcesJar
91+
archives javadocJar
92+
}
93+
94+
project.tasks.findAll {
95+
it.name.startsWith("publish")
96+
}.each {
97+
it.dependsOn assemble
98+
}
99+
100+
101+
}
102+
103+
configure(subprojects.findAll {it.name =~ /.*service/}) {
104+
105+
apply plugin: 'org.springframework.boot'
106+
apply plugin: 'nebula.ospackage'
107+
108+
springBoot {
109+
executable = true
110+
buildInfo()
111+
}
112+
113+
ext.installPath='/opt/' + archivesBaseName
114+
ext.jarPath=installPath + '/' + archivesBaseName + '-' + scmVersion.version + '.jar'
115+
ext.initPath='/etc/init.d/' + archivesBaseName
116+
project.description = "TBD"
117+
ext.projectVendor = "TBD"
118+
ext.projectUrl = "TBD"
119+
ext.projectPackageGroup = "TBD"
120+
ext.buildId = new Date().format('yyyyMMddHHmmss')
121+
122+
dependencies {
123+
compile("org.springframework.boot:spring-boot-starter-undertow:1.4.3.RELEASE")
124+
}
125+
126+
processResources {
127+
filesMatching('config/application.yml') { expand (project.properties) }
128+
}
129+
130+
artifacts {
131+
archives buildRpm
132+
}
133+
134+
/*
135+
ospackage {
136+
packageName = archivesBaseName
137+
version = project.version.replaceAll("-", ".")
138+
release = 1
139+
arch = NOARCH
140+
os = LINUX
141+
user = "prov"
142+
group = "prov"
143+
144+
into installPath
145+
146+
from(jar.outputs.files) {
147+
fileMode 0500
148+
}
149+
150+
link(initPath, jarPath)
151+
152+
}
153+
*/
154+
155+
task distRpm(type: Rpm, dependsOn: bootRepackage) {
156+
157+
}
158+
assemble.dependsOn distRpm
159+
160+
161+
}

gradle/wrapper/gradle-wrapper.jar

51 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Tue Feb 23 17:35:35 GMT 2016
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip

gradlew

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
#!/usr/bin/env bash
2+
3+
##############################################################################
4+
##
5+
## Gradle start up script for UN*X
6+
##
7+
##############################################################################
8+
9+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10+
DEFAULT_JVM_OPTS=""
11+
12+
APP_NAME="Gradle"
13+
APP_BASE_NAME=`basename "$0"`
14+
15+
# Use the maximum available, or set MAX_FD != -1 to use that value.
16+
MAX_FD="maximum"
17+
18+
warn ( ) {
19+
echo "$*"
20+
}
21+
22+
die ( ) {
23+
echo
24+
echo "$*"
25+
echo
26+
exit 1
27+
}
28+
29+
# OS specific support (must be 'true' or 'false').
30+
cygwin=false
31+
msys=false
32+
darwin=false
33+
case "`uname`" in
34+
CYGWIN* )
35+
cygwin=true
36+
;;
37+
Darwin* )
38+
darwin=true
39+
;;
40+
MINGW* )
41+
msys=true
42+
;;
43+
esac
44+
45+
# For Cygwin, ensure paths are in UNIX format before anything is touched.
46+
if $cygwin ; then
47+
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48+
fi
49+
50+
# Attempt to set APP_HOME
51+
# Resolve links: $0 may be a link
52+
PRG="$0"
53+
# Need this for relative symlinks.
54+
while [ -h "$PRG" ] ; do
55+
ls=`ls -ld "$PRG"`
56+
link=`expr "$ls" : '.*-> \(.*\)$'`
57+
if expr "$link" : '/.*' > /dev/null; then
58+
PRG="$link"
59+
else
60+
PRG=`dirname "$PRG"`"/$link"
61+
fi
62+
done
63+
SAVED="`pwd`"
64+
cd "`dirname \"$PRG\"`/" >&-
65+
APP_HOME="`pwd -P`"
66+
cd "$SAVED" >&-
67+
68+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69+
70+
# Determine the Java command to use to start the JVM.
71+
if [ -n "$JAVA_HOME" ] ; then
72+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73+
# IBM's JDK on AIX uses strange locations for the executables
74+
JAVACMD="$JAVA_HOME/jre/sh/java"
75+
else
76+
JAVACMD="$JAVA_HOME/bin/java"
77+
fi
78+
if [ ! -x "$JAVACMD" ] ; then
79+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80+
81+
Please set the JAVA_HOME variable in your environment to match the
82+
location of your Java installation."
83+
fi
84+
else
85+
JAVACMD="java"
86+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87+
88+
Please set the JAVA_HOME variable in your environment to match the
89+
location of your Java installation."
90+
fi
91+
92+
# Increase the maximum file descriptors if we can.
93+
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94+
MAX_FD_LIMIT=`ulimit -H -n`
95+
if [ $? -eq 0 ] ; then
96+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97+
MAX_FD="$MAX_FD_LIMIT"
98+
fi
99+
ulimit -n $MAX_FD
100+
if [ $? -ne 0 ] ; then
101+
warn "Could not set maximum file descriptor limit: $MAX_FD"
102+
fi
103+
else
104+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105+
fi
106+
fi
107+
108+
# For Darwin, add options to specify how the application appears in the dock
109+
if $darwin; then
110+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111+
fi
112+
113+
# For Cygwin, switch paths to Windows format before running java
114+
if $cygwin ; then
115+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117+
118+
# We build the pattern for arguments to be converted via cygpath
119+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120+
SEP=""
121+
for dir in $ROOTDIRSRAW ; do
122+
ROOTDIRS="$ROOTDIRS$SEP$dir"
123+
SEP="|"
124+
done
125+
OURCYGPATTERN="(^($ROOTDIRS))"
126+
# Add a user-defined pattern to the cygpath arguments
127+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129+
fi
130+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
131+
i=0
132+
for arg in "$@" ; do
133+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135+
136+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138+
else
139+
eval `echo args$i`="\"$arg\""
140+
fi
141+
i=$((i+1))
142+
done
143+
case $i in
144+
(0) set -- ;;
145+
(1) set -- "$args0" ;;
146+
(2) set -- "$args0" "$args1" ;;
147+
(3) set -- "$args0" "$args1" "$args2" ;;
148+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154+
esac
155+
fi
156+
157+
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158+
function splitJvmOpts() {
159+
JVM_OPTS=("$@")
160+
}
161+
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162+
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163+
164+
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

0 commit comments

Comments
 (0)