alfredxing / brick

Open-source webfont service
http://brick.im
2.87k stars 96 forks source link

Running Brick on Intranet #118

Open Fastidious opened 9 years ago

Fastidious commented 9 years ago

How would I go to get Brick running on an Intranet? Is it something that is relatively easy to install?

alfredxing commented 9 years ago

Are you looking to host everything yourself? Or just link to the stylesheet? If the latter, it would require a request to the internet.

If you want to host everything yourself: you can clone this repo, then use Jekyll to build it. Then you can use either the brick.php or brick.go file for the requests.

Fastidious commented 9 years ago

@alfredxing no need to modify anything on brick.php or brick.go? It will work, just out of the box?

alfredxing commented 9 years ago

@Fastidious It should (after you build it with Jekyll, as mentioned above)! It runs okay on my OS X machine, and in prod it runs on Linux. Let me know if you run into any issues!

alfredxing commented 9 years ago

Oh, actually, the Go version works out of the box, the PHP one would obviously need some server config (I use nginx). Just rewrite everything to that script.

Fastidious commented 9 years ago

@alfredxing I see:

uri.WriteString("url(//brick.a.ssl.fastly.net/fonts/")

on the brick.go file (similar on the PHP file). Are you sure that will run fine on an Intranet (no Internet access at all)?

alfredxing commented 9 years ago

Oh, hm, sorry about that! I'm almost completely forgetting how Brick works on the backend. Changing that to the URL of the server hosting the fonts should work.

Just going back to server configuration as well: this is the nginx rewrite I'm using

location / {
    index  index.html;
    rewrite ^([^\.]*)$ /brick.php?q=1;
}

This also means that what I said earlier about the Go file "working out of the box" is incorrect as well: you'll need to run a server like nginx to serve all of the font files, and run the Go CSS server on a different port. You can then either live with having these 2 different ports, or if you want, reverse proxy to the Go server in your nginx config.

Again, my sincere apologies for the incorrect information!