1 Star 0 Fork 2

GavinW. / lapis-chan

forked from mirrors_leafo / lapis-chan 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Lapis-chan

Lapis-chan is an text/image board written in Lua using the Lapis web framework.

Features

To view a complete list of features, check out the Feature Set spreadsheet.

Dependencies

Install From Source

  • giflib 5.1.1
  • OpenResty custom nginx distro

Install From Package Manager

  • libmagicwand-dev
  • Lua 5.1+ or LuaJIT 2.0+
  • Luarocks
  • PostgreSQL or MySQL (untested)

Install From LuaRocks

  • bcrypt
  • giflib
  • Lapis 1.4+
  • luafilesystem
  • luaposix
  • magick
  • md5

Install

giflib

Lapis-chan specifically requires v5.1.1.

$ wget http://downloads.sourceforge.net/project/giflib/giflib-5.1.1.tar.bz2
$ tar jxf giflib-5.1.1.tar.bz2
$ cd giflib-5.1.1
$ ./configure
$ make
$ sudo make install

OpenResty

$ tar xvf ngx_openresty-VERSION.tar.gz
$ cd ngx_openresty-VERSION/
$ ./configure
$ make
$ sudo make install

Other Stuff

$ sudo apt-get install libmagickwand-dev
$ sudo apt-get install luajit
$ sudo apt-get install luarocks
$ sudo apt-get install postgresql
$ sudo apt-get install mysql-server

$ luarocks install bcrypt
$ luarocks install lapis
$ luarocks install luafilesystem
$ luarocks install luaposix
$ luarocks install magick
$ luarocks install md5
$ luarocks install --server=http://luarocks.org/dev giflib

Installing

Installing Lapis-chan is a multi-step process. Before you can run the installation script, you must first configure your server. Below are the prerequisite steps:

Create a New Database

Lapis-chan prefers to live inside its own database, so it is highly recommended to create an empty database for Lapis-chan to install to. Lapis-chan has been tested on PostgreSQL but Lapis Models should also be compatible with MySQL.

$ psql
> CREATE DATABASE 'lapischan';

Configure config.lua

Make sure the following options within the config file are set correctly:

  1. subdomains - Probably best to leave this as false unless know what you are doing with ngx configurations
  2. site_name - Set this to whatever you want your website to be called
  3. port - Most commonly set to 80 unless you are hosting multiple websites on the same server
  4. Make sure your db engine is set properly to postgres or mysql
  5. host - Most commonly localhost or 127.0.0.1
  6. user - The database username
  7. password - The database password
  8. database - The database name (we just created it!)

Configure nginx.conf

In this file, you need to set the lua_package_path and lua_package_cpath to find both LuaRocks and OpenResty. LuaRocks has a simple command, OpenResty does not so you need to know where you installed it to.

$ luarocks path

Migrate the Database

Now that we have Lapis configured, you must execute the migration to fill the database with empty tables. It is recommended to perform this step every time you upgrade Lapis-chan as it will automagically update your database without damaging any data.

$ lapis migrate

Create Cryptographic Secrets

In the secrets directory, open up both the token.lua and salt.lua files.

Secret Token

The secret token should be a random string of characters between 40 and 60 characters in length. Change CHANGE_ME to your secret token. Keep this token extremely safe, it is the backbone of security on Lapis-chan! Don't lose it, either!

Secret Salt

The secret salt should be a random string of characters exactly two characters in length. The salt can be comprised of letters, numbers, a period (".") or a slash ("\"). Change CHANGE_ME to your secret salt. This salt is not necessarily meant to be secure, but don't hand it out willy-nilly either. This is only used for generating insecure tripcodes.

Start Lapis

Now we're ready to finish the installation!

$ lapis server production
# The MIT/X11 License (MIT) Lapis-chan is copyright (c) 2016 Landon Manning <lmanning17@gmail.com>. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gavinw2020/lapis-chan.git
git@gitee.com:gavinw2020/lapis-chan.git
gavinw2020
lapis-chan
lapis-chan
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891