Coder Social home page Coder Social logo

restfulwhois's Introduction

This repository has been OBSOLETED, the NEW is here: http://github.com/cnnic/rdap

<title> UserGuide – Restful Whois </title>

RESTful Whois is written in JAVA and needs a database which MySQL is selected. You can find all the required system software here. All the source code and deployment files are posted. You can access the Browse Source or visit the github project.

Installation Steps

1. install jdk 1.6 ,or higer verison,downlad from: http://www.oracle.com/technetwork/java/javase/downloads/index.html 2. install git client: yum install git 3. create work dir, as: $WORK_DIR , eg: /home/guest/whois 4. download source from github
```
git config --global http.sslVerify false 
git clone http://github.com/cnnic/restfulwhois.git
```
  1. install maven

    cd  $WORK_DIR 
    cd restfulwhois/deployment 
    tar -zxvf apache-maven-3.1.tar.gz 
    export PATH=`pwd`/apache-maven-3.1/bin:$PATH 
    (export this PATH to .bash_profile is best) 
    chmod a+x apache-maven-3.1/bin/mvn
    
  2. build project

    cd  $WORK_DIR 
    cd restfulwhois/source/whois
    mvn package  (this may take some minutes. )
    ll target/whois.war (whois.war is the artifact)
    
  3. install mysql (use port 3306)

    install 5.5. download from http://dev.mysql.com/downloads/mysql/5.5.html and install.

  4. import data to mysql

    download mysql data: https://github.com/cnnic/restfulwhois/blob/master/deployment/whois.sql
    login mysql : 
    	mysql -h127.0.0.1 -uroot -p
    add user, execute commands:
    	GRANT ALL PRIVILEGES ON *.* TO 'whois'@'%' IDENTIFIED BY 'cnnic';
    	FLUSH  PRIVILEGES;
    import data, execute commands: 
    	source whois.sql;
    
  5. install solr (use port 9090)

    cd  $WORK_DIR
    cd restfulwhois/deployment
    tar -zxvf apache-tomcat-solr.tar.gz
    update configure file: vi apache-tomcat-solr/conf/Catalina/localhost/solr.xml :
    	In secode line ,'docBase' set to :"$WORK_DIR/restfulwhois/deployment/apache-tomcat-solr/solr/solr-4.5.0.war"
    	In third line ,'value' set to :"$WORK_DIR/restfulwhois/deployment/apache-tomcat-solr/solr"
    	note: both '$WORK_DIR'  must replaced by the existing real file path .
    update following 3 configure file, line 106 change 'D:/java/apache-tomcat-solr' to: '$WORK_DIR/restfulwhois/deployment/apache-tomcat-solr' , '$WORK_DIR'  must replaced by the existing real file path .
    	file:apache-tomcat-solr/solr/domain/conf/solrconfig.xml
    	file:apache-tomcat-solr/solr/domain/conf/solrconfig.xml
    	file:apache-tomcat-solr/solr/domain/conf/solrconfig.xml
    startup solr:  
    	./apache-tomcat-solr/bin/startup.sh 
    
  6. deploy whois webapp (use port 8080)

    cd  $WORK_DIR
    cd restfulwhois/deployment
    tar -zxvf apache-tomcat-whois.tar.gz
    cd  $WORK_DIR
    cd restfulwhois
    cp source/whois/target/whois.war deployment/apache-tomcat-whois/webapps/ROOT/
    cd deployment/apache-tomcat-whois/webapps/ROOT
    unzip whois.war
    if mysql or solr service port are changed, should configure property file (if not please ignore this step):
    	cd WEB-INF/classes
    	update confiuration file :
    		in file jdbc.properties: 'jdbc.url' change to mysql url, if mysql in install on localhost, no need to change;
    		in file whois.properties: 'solr.url' change to solr url, if solr install on localhost ,no need to change
    cd  $WORK_DIR
    cd restfulwhois/deployment/apache-tomcat-whois
    bin/startup.sh
    (done, whois webapp service url is : http://localhost:8080)
    
  7. deploy whois port43 proxy

    cd  $WORK_DIR
    cd restfulwhois/deployment/whois43Proxy
    update configraution file: vi startUp.sh :
    	update 'WHOISPROPERTIES_HOME' value to current path
    ./startUp.sh
    
  8. test for whois webapp

    1>.use robotframework:

    	install python and pip first,then install robotframework:
    		pip install robotframework
    		pip install --upgrade robotframework-httplibrary
    	cd  $WORK_DIR
    	cd restfulwhois/source/whois/test/robot
    	pybot .
    		and this command will generate test result : report.html/output.xml/log.html
    

    2>.use curl:

    	curl -H Accept:application/json rdap.restfulwhois.org/ip/1.0.0.0
    	curl -H Accept:application/xml rdap.restfulwhois.org/domain/qq.cn
    	curl -H Accept:application/html rdap.restfulwhois.org/entity/APNIC
    	curl rdap.restfulwhois.org/autnum/1223
    	curl rdap.restfulwhois.org/nameserver/ns2.ee28.cn
    
  9. test for port43 whois

    whois -h rdap.restfulwhois.org 1.0.0.0
    whois -h rdap.restfulwhois.org qq.cn
    whois -h rdap.restfulwhois.org entity APNIC
    whois -h rdap.restfulwhois.org as 1223
    whois -h rdap.restfulwhois.org ns ns2.ee28.cn
    
  10. configuration oauth if need oauth support:

    oauth consumer project dir is restfulwhois/source/consumer update configuration file : src/consumer.properties :

    	sample.serviceProvider.baseURL: http://localhost:8080/
    	sample.consumerKey: rdap db table oauth_users_app 's column 'app_key'
    	sample.consumerSecret" rdap db table oauth_users_app 's column 'app_secret'
    

restfulwhois's People

Contributors

cnnic avatar dengguangqing avatar dgq2011 avatar forumbyr avatar larrychen8276 avatar warmdawn avatar yun51 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

restfulwhois's Issues

query dao refactor

now is : query all types in one "QueryDao",
refactor to : create one dao per type, decoupling types

query : case insensitive

1 . domain query : input 'Z.cn' can query 'z.cn'
2. domain search : input Z*.cn can search z.cn za.cn ...

add uri filter

1、filter function:only accept url: /.well-known/rdap,other url response 400
2、other invalid url response 400。eg:in spring mvc, /.well-known/rdap/domain/a/b/c

bean create refactor?

now use "new", classes is more than before, and new is everywhere,so
use spring to manage bean?

dao refactor

  1. datasource change to use dbcp or c3p0, managed by spring
    2.use jdbcTemplate
    (need test all dao )

del registrar

del registrar, - use entity
del:
mysql table - registrar
servlet
service
dao

Regression test

test all cases before and after refactor :
1、update test script for this perpose
2、complete cases, test

oauth demo

1、基本oauth流程
2、按role授权
3、授权支持一定时间段

todo:
用户、角色 信息从tomcat改为db

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.