• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

luarocks/luarocks-site: LuaRocks website and module host

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

luarocks/luarocks-site

开源软件地址(OpenSource Url):

https://github.com/luarocks/luarocks-site

开源编程语言(OpenSource Language):

MoonScript 68.9%

开源软件介绍(OpenSource Introduction):

LuaRocks.org

https://luarocks.org

spec

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 "[email protected]", "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. 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 <[email protected]>"
}



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap