LuaRocks website and module host
Clone or download
hishamhm Merge pull request #138 from luarocks/fix-global-stats-header
Fix active header tab for global stats
Latest commit f6a45f0 Oct 15, 2018
Permalink
Failed to load latest commit information.
applications manfiest can purge pagecache, add root purge button on admin Sep 2, 2018
cmd deploy manifest-5.3 to mirrors as well Oct 2, 2017
configs add zipserver dev config Sep 4, 2018
emails use name_for_display everywhere Jul 20, 2017
ext/luarocks don't print errer Jan 5, 2018
flows rename kind -> type Aug 8, 2017
helpers manfiest can purge pagecache, add root purge button on admin Sep 2, 2018
misc misc Mar 26, 2015
models manfiest can purge pagecache, add root purge button on admin Sep 2, 2018
nginx move http proxy to file Sep 1, 2018
secret_example add example secrets file Sep 27, 2016
spec fix csrf and session stubbing Apr 7, 2018
static update front page for LuaRocks 3.0.3 Sep 15, 2018
views Fix active header tab for global stats Oct 13, 2018
widgets use page header in more places Sep 1, 2018
.gitignore vendor javascirpt libraries Sep 30, 2016
.travis.yml stub out travis and docker spec Aug 26, 2016
BoxFile readme updates Jan 24, 2016
Dockerfile stub out travis and docker spec Aug 26, 2016
Makefile add zipserver dev config Sep 4, 2018
README.md Fix gittup links Mar 2, 2017
TODO.md misc updates Jun 5, 2014
Tupfile initial import Nov 30, 2012
Tuprules.tup initial import Nov 30, 2012
app.moon rename route modules_label -> label, add labels application Sep 27, 2016
ci.sh update moonscript and cloud storage Apr 8, 2018
config.moon remove stray config change Sep 27, 2016
lint_config.moon update lint to pass Sep 27, 2016
migrations.moon misc review changes #114 Aug 8, 2017
mime.types initial import Nov 30, 2012
models.moon move all the models into individual files Feb 27, 2014
nginx.conf add nginx cache to rock cache Sep 4, 2018
package.json vendor javascirpt libraries Sep 30, 2016
revision.moon add revision to footer Mar 27, 2015
schema.sql update schema Oct 28, 2016
serve_file.moon fix download incremements Dec 25, 2015
storage_bucket.moon alwasy use secret storage bucket if it's there Aug 26, 2016

README.md

LuaRocks.org

https://luarocks.org

Build Status

The official module repository of the LuaRocks package manager for Lua.

The entire site runs on OpenResty, an Nginx based platform with Lua support. The site itself is coded in MoonScript and uses Lapis as a web framework.

Files are stored on Google Cloud Storage. PostgreSQL is used as a database.

Tup is the build system.

How To Run Locally

Install the following dependencies:

Check out this repository.

Install the dependencies listed in https://github.com/luarocks/luarocks-site/blob/master/BoxFile with LuaRocks.

Run these commands to build.

tup init
tup

Create the schema:

make init_schema

Start the server:

lapis server

Now http://localhost:8080 should load.

If you edit any MoonScript or SCSS files you should call tup to rebuild the changes. You can run tup monitor -a to watch the filesystem to rebuild.

Running tests

This site uses Busted for its tests:

make test_db
busted

The make test_db command will copy the schema of the moonrocks local database into the test database, wiping out what whatever was there. You'll only need to run this command once and the beginning any any time the schema has changed.

Setting up Google Cloud Storage

In production all files are stored on Google Cloud Storage. With no configuration (default), files are stored on the file system using the storage bucket mock provided by the cloud_storage rock.

To configure cloud_storage to talk to a live bucket make a file secret/storage_bucket.moon, it must return a bucket instance. It might look something like:

-- secret/storage_bucket.moon
import OAuth from require "cloud_storage.oauth"
import CloudStorage from require "cloud_storage.google"

o = OAuth "NUMBER@developer.gserviceaccount.com", "PRIVATEKEY.pem"
CloudStorage(o, "PROJECT_ID")\bucket "BUCKET_NAME"

Setting up email

If you want to test sending emails you'll have to provide Mailgun credentials. A test account is free. Create a file secret/email.moon and make it look something like this: (it must return a table of options)

{ -- secret/email.moon
  key: "api:key-MY_KEY"
  domain: "mydomain.mailgun.org"
  sender: "MoonRocks <postmaster@mydomain.mailgun.org>"
}