Skip to content

linuxfrorg/img-LinuxFr.org

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

External images on LinuxFr.org

Our users can use images from external domains on LinuxFr.org. This component is a reverse-proxy / cache for these images.

Th main benefits of using a proxy instead of linking directly the images are:

  • No flood: images can be hosted on small servers that are not able to handle all the traffic from LinuxFr.org, so we avoid to flood them
  • History: even if a server is taken down, we are able to keep serving images that are already used on our pages
  • Security: on the HTTPS pages, we won't include images from other domains that are available only in HTTP, so it prevents browsers from displaying warning about unsafe pages
  • Privacy: the users won't connect to the external domains, so their IP addresses won't be logged on these servers.

How to use it? (outside Docker)

Install Go and don't forget to set $GOPATH

$ go get -v -u github.com/linuxfrorg/img-LinuxFr.org
$ img-LinuxFr.org [-a addr] [-r redis] [-l log] [-d dir]

And, to display the help:

$ img-LinuxFr.org -h

How to use it? (with Docker)

Build and run Docker image:

$ docker build -t img-linuxfr.org .
$ docker run --publish 8000:8000 img-linuxfr.org
or
$ docker run --publish 8000:8000 --env REDIS=someredis:6379/1 img-linuxfr.org

Why don't you use camo?

Github has developed a similar service, camo, for their own usage. I used it as a source of inspiration but I prefered to redevelop a new service instead of using it for several reasons:

  • It lacks some feature and particulary caching!
  • It runs with a legacy version of node.js, which is not very friendly for our sysadmins.
  • I plan to extend it for other usages in the future, and I prefer coding in golang than in nodejs.
  • And it's a fun component to recode :p

See also

Copyright

The code is licensed as GNU AGPLv3. See the LICENSE file for the full license.

♡2012 by Bruno Michel. Copying is an act of love. Please copy and share.

About

A reverse-proxy cache for external images used on LinuxFr.org

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published