Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit 274a178

Browse files
committed
initial import of some stuff
0 parents  commit 274a178

File tree

7 files changed

+66
-0
lines changed

7 files changed

+66
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tmp/asset-proxy.pid
2+
server.js

AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Rick Olson: https://github.com/technoweenie
2+
Corey Donohoe: https://github.com/atmos

LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2010 Corey Donohoe, Rick Olson
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# asset-proxy
2+
3+
This is an image SSL proxy to prevent mixed content warnings on secure pages served from http://github.com.
4+
5+
We wanted to allow people to keep embedding image links in their comments and README files. This also handles inlining google charts images.
6+
7+
[More Info Here](https://github.com/blog/743-sidejack-prevention-phase-3-ssl-proxied-assets)
8+
9+
We share a key between this proxy and the GitHub main app. We encrypt the URL with [hmac](http://en.wikipedia.org/wiki/HMAC) so we're not an open proxy. These keys come from the shell environment and are unique per deployment environment. I'm not 100% sure this step is necessary.
10+
11+
When the GitHub app renders markdown it replaces all of the `src` attributes on any `img` tags with the an appropriate URL to hit the proxies.
12+
13+
## Testing Functionality
14+
15+
### Start the server
16+
% coffee server.coffee
17+
18+
### In another shell
19+
20+
% rake
21+
22+
### Debugging
23+
24+
To see the full URL resclient is hitting etc, try this.
25+
26+
% RESTCLIENT_LOG=stdout rake
27+
28+
### Deployment
29+
30+
You can see an example [god config](https://gist.github.com/675038) here.
31+
32+
To enable useful line numbers in stacktraces you probably want to
33+
compile the server.coffee file to native javascript when deploy
34+
35+
% coffee -c server.coffee
36+
% node server.js

Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace :test do
2+
task :check do |t|
3+
system("ruby test/proxy_test.rb")
4+
end
5+
end
6+
task :default => "test:check"

log/.gitignore

Whitespace-only changes.

tmp/.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)