Git Product home page Git Product logo

dnslog's Issues

疑问

NS域名

NS1_DOMAIN = 'ns1.a.com'
NS2_DOMAIN = 'ns2.b.com'

应该是
NS1_DOMAIN = 'ns1.a.com'
NS2_DOMAIN = 'ns2.a.com'

吧?

域名解析的问题

1.按照说明修改完setting.py
2.在云解析上修改了ns记录

可是无法使用
导致走了很多弯路,让我误以为是本地dns服务出了问题

修复分页问题时遇到的

1.logview中缺少对webpage的支持
在模版中view.html文件

        {% ifequal logtype 'web'%}

        <div class="bs" data-example-id="hoverable-table">

            <table class="table table-hover">

              <thead>

                <tr>

                  <th>#</th>

                  <th>path</th>

                  <th>ip</th>

                  <th>ua</th>

                  <th>date</th>

                </tr>

              </thead>

              <tbody>

                {% for weblog in weblogs %}

                <tr>

                <th scope="row">{{weblog.id}}</th>

                <td>{{ weblog.path }}</td>

                <td>{{ weblog.remote_addr }}</td>

                <td>{{ weblog.http_user_agent }}</td>

                <td>{{ weblog.log_time|date:'Y-m-d H:i:s' }}</td>

                </tr>

                {% endfor %}

              </tbody>

            </table>

            <nav class="center-block">

              <ul class="pagination">

                <li><a class="btn btn-default" href="/?del=web" role="button">clear</a></li>

                {% ifnotequal webpage 1%}

                <li>

                  <a href="/?logtype=web&dnspage={{dnspage | add:-1}}" aria-label="Previous">

                    <span aria-hidden="true">&laquo;</span>

                  </a>

                </li>

                {% endifnotequal%}

                {% for range in pagerange %}

                <li><a href="/?logtype=web&dnspage={{range}}">{{range}}</a></li>

                {% endfor %}

                {% ifnotequal webpage numpages%}

                <li>

                  <a href="/?logtype=web&dnspage={{dnspage|add:1}}" aria-label="Next">

                    <span aria-hidden="true">&raquo;</span>

                  </a>

                </li>

                {% endifnotequal%}

              </ul>

            </nav>

        </div>

        {% endifequal%}


部分带有webpage参数的请求,均为dnspage
后端无法获取到正确的webpage

没看到静态资源

我看演示站点里的css样式文件我在源码里都没找着。。。static里面只有一个main.css

当不使用nginx时应修改remote_addr

dnslog/logview/views.py
19行
remote_addr = request.META.get('HTTP_X_REAL_IP')
当不使用ngingx时应修改为
remote_addr = request.META.get('REMOTE_ADDR')

No module named 'models'

Django Version: | 1.8.7
ModuleNotFoundError
No module named 'models'
/home/ubuntu/DNSLog/dnslog/logview/views.py in , line 9
/usr/bin/python
3.8.5
['/home/ubuntu/DNSLog/dnslog', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/local/lib/python3.8/dist-packages/cloud_init-20.1-py3.8.egg', '/usr/lib/python3/dist-packages']

启动后访问报错是怎么回事呢

支持https后weblog无法记录curl

由于目前用的是泛域名证书,只支持该域名及其二级域名,但是我们记录所用的域名是三级域名,curl https的时候会报证书错,那我尝试用http的进行请求,发现读不到页面。查看了项目里的setting.py才发现SECURE_SSL_REDIRECT = True,这个配置是使页面一直重定向到https的,所以http的拿不到页面,而https又由于三级域名不受证书保护的问题,无法直接访问到(需要忽略证书错误,或信任该站点)。所以当我修改了该配置为False之后,才能正常记录http的请求。如果要正常使用三级域名的话还得花钱买证书,算咯。。。

疑问

步骤1中的a.com A记录是解析到1.1.1.1还是1.1.1.1 是指外网IP?

按照步骤搞好了,ns解析也够了48小时,启动了django,还是ping不到b.com

尝试了把步骤1中的两者都换过了(1.1.1.和外网IP的A记录)还是ping不到b.com
。。。
求解

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.