Home
Softono
ourls-resty

ourls-resty

Open source Lua
45
Stars
12
Forks
0
Issues
5
Watchers
9 years
Last Commit

About ourls-resty

# Ourls-Resty [Ourls][1] 是由 [takashiki][2] 实现的一个基于发号和 hashid 的短网址服务。 受这个项目的启发,将此项目移植到 [OpenResty][3] 。 移植了原项目的功能和特性,并加入了内存缓存支持。 ### 使用方法 #### 环境 - 安装 openresty [预编译包][9] (或 [手动编译教程][10]) - 安装 libidn : `yum install libidn` #### 安装 - 使用 opm 包管理安装本库: `opm install xiaooloong/ourls-resty` - 安装 lua 库依赖: `luarocks install net-url && luarocks install router` - 参考 [hashids.lua][4] 的说明安装 hashids #### 配置 - 进入工程目录 `/usr/local/openresty/site/lualib/ourl` - 复制 `config.sample.lua` 为 `config.lua` - 修改 `config.lua` 中的数据库配置、hashids 参数、可信代理服务器的 cidr - 恢复 `urls.sql` 至 `mysql` 或 `mariadb` 数据库 - 进入 `/usr/local/openresty/nginx/conf` 目录 - 根据自己的实际情况,配置静态文件,合并配置 #### 完成 - 启动 openresty (service openresty start) ### 使用到的其他项目 - [leihog/hashids.lua][4] - [APItools/router.lua][5] - [golgote/neturl][6] - [hamishforbes/lua-resty-ipu ...

Platforms

Web Self-hosted

Languages

Lua

Links

Ourls-Resty

Ourls 是由 takashiki 实现的一个基于发号和 hashid 的短网址服务。 受这个项目的启发,将此项目移植到 OpenResty

移植了原项目的功能和特性,并加入了内存缓存支持。

使用方法

环境

安装

  • 使用 opm 包管理安装本库: opm install xiaooloong/ourls-resty
  • 安装 lua 库依赖: luarocks install net-url && luarocks install router
  • 参考 hashids.lua 的说明安装 hashids

配置

  • 进入工程目录 /usr/local/openresty/site/lualib/ourl
  • 复制 config.sample.luaconfig.lua
  • 修改 config.lua 中的数据库配置、hashids 参数、可信代理服务器的 cidr
  • 恢复 urls.sqlmysqlmariadb 数据库
  • 进入 /usr/local/openresty/nginx/conf 目录
  • 根据自己的实际情况,配置静态文件,合并配置

完成

  • 启动 openresty (service openresty start)

使用到的其他项目