-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
850 additions
and
189 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# v6.1.1.3 build_20190617 | ||
|
||
- 加入打包脚本与安装脚本 | ||
|
||
# v6.1.1.2 | ||
|
||
- API 访问控制支持白名单和黑名单 | ||
|
||
# v6.1.1.1 | ||
|
||
- 加入 routeros hostpot wifi 认证支持 | ||
|
||
# v6.1.1.0 | ||
|
||
- 加入radsec 协议支持 | ||
|
||
# v6.1.0.1 | ||
|
||
- 增加无线认证模块,支持帐号,固定密码, 短信,微信连WiFi四种认证模式 | ||
- 增加无线认证的配置模块 | ||
- 增加批量创建用户功能 | ||
- 增加用户模拟拨号测试功能 | ||
- 控制面板扩展,增加认证结果统计,认证耗时统计,在线趋势统计 | ||
- 优化UI界面 | ||
- 修复上一版本的BUG | ||
|
||
|
||
# v6.0.1.1 | ||
|
||
- 数据库结构调整 | ||
- 大量界面调整,添加标签模式 | ||
- 修复以前版本中的错误 | ||
- 内存日志模块优化 | ||
|
||
|
||
# v6.0.0.1 20190326 | ||
|
||
- 基于Java语言重新开发。提供了一个高性能的 RADIUS 处理引擎,同时提供了一个简洁易用的 WEB管理界面,可以轻松上手。 | ||
- [基本功能清单见](https://github.com/talkincode/ToughRADIUS/wiki/features) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
currdir=$PWD | ||
version="v6.1.1.3" | ||
releasedir=${currdir}/release/toughradius-${version} | ||
releasefile=toughradius-${version}.zip | ||
|
||
|
||
build_version() | ||
{ | ||
echo "release version ${version}" | ||
test -d ${releasedir} || mkdir ${releasedir} | ||
rm -fr ${releasedir}/* | ||
test -f ${releasefile} && rm -f ${releasefile} | ||
|
||
cp -r ${currdir}/src/main/resources/portal ${releasedir} | ||
cp ${currdir}/scripts/application-prod.properties ${releasedir}/application-prod.properties | ||
cp ${currdir}/scripts/createdb.sql ${releasedir}/createdb.sql | ||
cp ${currdir}/scripts/database.sql ${releasedir}/database.sql | ||
cp ${currdir}/scripts/init.sql ${releasedir}/init.sql | ||
cp ${currdir}/scripts/installer.sh ${releasedir}/installer.sh | ||
cp ${currdir}/scripts/toughradius.service ${releasedir}/toughradius.service | ||
cp ${currdir}/scripts/linux-installer.md ${releasedir}/linux-installer.md | ||
cp ${currdir}/README.md ${releasedir}/README.md | ||
dos2unix ${releasedir}/*.properties | ||
dos2unix ${releasedir}/*.sql | ||
dos2unix ${releasedir}/*.sh | ||
dos2unix ${releasedir}/*.service | ||
cp ${currdir}/scripts/startup.bat ${releasedir}/startup.bat | ||
cp ${currdir}/target/toughradius-latest.jar ${releasedir}/toughradius-latest.jar | ||
cd ${currdir}/release && zip -r ${releasefile} toughradius-${version} | ||
echo "release file ${releasefile}" | ||
} | ||
|
||
|
||
case "$1" in | ||
|
||
build) | ||
build_version | ||
;; | ||
|
||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
use toughradius; | ||
|
||
create table if not exists tr_bras | ||
( | ||
id bigint auto_increment primary key, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
install_package() | ||
{ | ||
\cp application-prod.properties /opt/application-prod.properties | ||
\cp toughradius-latest.jar /opt/toughradius-latest.jar | ||
\cp toughradius.service /usr/lib/systemd/system/toughradius.service | ||
\cp -r portal /opt/ | ||
systemctl enable toughradius | ||
echo "install done, please exec systenctl start toughradius after initdb" | ||
} | ||
|
||
setup_mysql() | ||
{ | ||
echo "create database toughradius" | ||
mysql -uroot -p -e "create database toughradius DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" | ||
echo "GRANT db user" | ||
mysql -uroot -p -e "GRANT ALL ON toughradius.* TO raduser@'127.0.0.1' IDENTIFIED BY 'radpwd' WITH GRANT OPTION;FLUSH PRIVILEGES;" -v | ||
echo "create tables" | ||
mysql -uroot -p < database.sql | ||
echo "insert test data" | ||
mysql -uroot -p < init.sql | ||
} | ||
|
||
case "$1" in | ||
|
||
initdb) | ||
setup_mysql | ||
;; | ||
|
||
install) | ||
install_package | ||
;; | ||
|
||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## 系统环境依赖 | ||
|
||
- 操作系统:Linux(推荐CentOS7) | ||
- java 版本: 1.8 | ||
- 数据库服务器:MySQL/MariaDB | ||
|
||
## 上传安装包到服务器 | ||
|
||
通过sftp或ftp上传安装包到服务器目录并解压, 通过终端 cd 进入解压目录, 比如 | ||
|
||
> /opt/toughradius-v6.1.1.3 | ||
## 数据库初始化 | ||
|
||
> 数据库的安装配置请自行完成,首先确保你的数据库服务器已经运行 | ||
执行安装目录下的 installer.sh 脚本进行初始化数据库 | ||
|
||
> sh installer.sh initdb | ||
## 安装服务程序 | ||
|
||
> sh installer.sh install | ||
## 修改配置 | ||
|
||
注意修改 /opt/application-prod.properties 配置文件中的数据库部分 | ||
|
||
如果希望使用自定义的模板,请取消该行注释 | ||
|
||
> `#org.toughradius.portal.templateDir=file:/opt/portal/` | ||
/opt/portal/ 是自定义模板目录, 可以参照安装包里的模板进行修改 | ||
|
||
## 运行服务 | ||
|
||
> systemctl start toughradius |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
java -jar -Xms256m -Xmx1024G toughradius-latest.jar --spring.profiles.active=prod | ||
java -jar -Xms256m -Xmx1024M toughradius-latest.jar --spring.profiles.active=prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.toughradius.common; | ||
import org.toughradius.common.coder.Encypt; | ||
|
||
import javax.servlet.http.Cookie; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
public class CookieUtils { | ||
|
||
public static String getCookie(HttpServletRequest request,String cookieName){ | ||
Cookie[] cookies = request.getCookies(); | ||
String ename = Encypt.encrypt(cookieName); | ||
if(cookies != null){ | ||
for(Cookie cookie : cookies){ | ||
if(cookie.getName().equals(ename)){ | ||
return Encypt.decrypt(cookie.getValue()); | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
|
||
|
||
public static void writeCookie(HttpServletResponse response, String cookieName,String value){ | ||
Cookie cookie = new Cookie(Encypt.encrypt(cookieName),Encypt.encrypt(value)); | ||
cookie.setPath("/"); | ||
cookie.setMaxAge(86400*30); | ||
response.addCookie(cookie); | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.