LuaRocks website and module host
MoonScript CSS Lua CoffeeScript HTML Nginx Other
Latest commit b8ade0d Nov 8, 2016 @leafo leafo redirect to root doamin
Permalink
Failed to load latest commit information.
applications
cmd use get_modules from relation instead of all_modules Sep 27, 2015
emails
ext/luarocks
flows don't create follow notification if you follow your own module Aug 13, 2015
helpers
misc
models find_uncreated Oct 28, 2016
secret_example
spec
static update all links to keplerproject -> luarocks luarocks/luarocks#645 Nov 3, 2016
views
widgets
.gitignore
.travis.yml
BoxFile readme updates Jan 24, 2016
Dockerfile
Makefile
README.md update all links to keplerproject -> luarocks luarocks/luarocks#645 Nov 3, 2016
TODO.md misc updates Jun 5, 2014
Tupfile initial import Nov 30, 2012
Tuprules.tup
app.moon
ci.sh
config.moon
lint_config.moon
migrations.moon
mime.types
models.moon
nginx.conf
package.json vendor javascirpt libraries Sep 30, 2016
revision.moon
schema.sql
serve_file.moon
storage_bucket.moon

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/leafo/moonrocks-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>"
}