`

arachni-web-ui使用

    博客分类:
  • web
 
阅读更多
最近在玩儿arachni,想试试arachni-ui-web,于是就从github上download了arachni-ui-web代码。
发现是使用RoR,正好白天工作目前使用RoR ,目前也在学习RoR。
大概看了一下arachni-ui-web官方文档,但是没找到具体的使用方法。但是是使用RoR框架的,所以应该和白天工作的架构类似吧。

1. 配置文件
根据官方文档,arachni-ui-web支持两种数据库,Postgres和Sqlite3.我们就使用postgres吧。
根据官方文档,需要把database.yml.pgsql改成database.yml
cd config
mv database.yml.pgsql database.yml

2. 修改数据库编码
运行:RAILS_ENV=production rake db:create
报错:
PG::InvalidParameterValue: ERROR:  new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
这时需要修改config/database.yml文件,添加红色部分。
引用
development:
  template: template0
  host: localhost
  adapter: postgresql
  encoding: unicode
  database: arachni_development
  pool: 50
  username: arachni
  password: secret

test: &test
  template: template0
  host: localhost
  adapter: postgresql
  encoding: unicode
  database: arachni_test
  pool: 50
  username: arachni
  password: secret

production:
  template: template0
  host: localhost
  adapter: postgresql
  encoding: unicode
  database: arachni_production
  pool: 50
  username: arachni
  password: secret

cucumber:
  <<: *test

然后再次运行:
RAILS_ENV=production rake db:create
这时可在postgres数据库中看到生成arachni_production

然后
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake db:seed

即可生成必要设置
RAILS_ENV=production rails s即可启动arachni-ui-web

在浏览器中输入localhost:3000即可访问页面
管理员口令:
E-mail: admin@admin.admin
Password: administrator


普通用户:
E-mail: user@user.user
Password: regular_user

也可不使用production环境,发现development环境web渲染比production环境漂亮。
使用development环境时,rails/rake命令前面不需要RAILS_ENV=production这行   

参考资源:
https://github.com/Arachni/arachni-ui-web/wiki
http://stackoverflow.com/questions/5821238/rake-dbcreate-encoding-error-with-postgresql
http://www.douban.com/note/92737624/
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics