Giter Site home page Giter Site logo

dstp's People

Contributors

amaimersion avatar aminvakil avatar fusion avatar gonrial avatar gsbabil avatar ycd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dstp's Issues

[FEATURE] Need of a timeout option ?

Hello!

I tried with a website down like jetable.org
But no answer/summary from the tool dstp 💥
Is there a timeout option ?

➜ dstp jetable.org
^C
~ took 8m 32s
➜ dig +short jetable.org
193.200.42.56
➜ ping jetable.org
PING jetable.org (193.200.42.56): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
^C
--- jetable.org ping statistics ---
4 packets transmitted, 0 packets received, 100.0% packet loss

[Documentation] Update README for installation with go command

Hello there 👋

I am currently trying the tool and I installed it with go install.

By copy/pasting the command from the CLI, I got the following error

go install: version is required when current directory is not in a module
	Try 'go install github.com/ycd/dstp/cmd/dstp@latest' to install the latest version

Using the following does not solve the installation:

go install github.com/ycd/dstp/cmd/dstp@latest

Do you have an idea how it could be installed with go ?

go install

Is it possible to install this tool with go install? Any reasons why you guys prefer go build + cp? Interesting tool!

system vs DNS resolution

One distinction that could be useful is to do both a resolution through the system, like by calling gethostbyname() in the glibc, and doing the DNS resolution manually by querying the root DNS servers or 8.8.8.8. Both can yield different results and help inform why a host might fail.

There are many reasons why a system resolver might yield a different result. A few that come to mind:

  • caching: the system resolver, or ISP resolver might be caching some old results
  • /etc/hosts file has an entry for that hostname
  • the /etc/resolv.conf has a search domain, that has an entry. If the original hostname doesn't exist, it would fall back on that one.

[FEATURE] Support Alternate Ports

Thanks for making such a useful tool! It would be swell if it could be used to test services running on alternate ports. Plex, for example, often uses port 32400:

# A standard service listening on 443 with a trusted cert.
❯ dstp https://standardService.myDomain.tld
Ping: 251.027µs
DNS: resolving VALID_IP
SystemDNS: resolving VALID_IP
TLS: certificate is valid for 79 more days
HTTPS: got 200 OK

# A Plex server running remotely on port 32400 with a trusted cert.
❯ dstp https://plex.myDomian.tld:32400
Ping: no response (this is expected from the location this server is running)
DNS: resolving VALID_IP
SystemDNS: resolving VALID_IP
TLS: dial tcp VALID_IP:443: connect: connection timed out
HTTPS: Get "https://plex.myDomain.tld": dial tcp VALID_IP:443: i/o timeout

I got the same result passing the URL with the -a flag. The expectation is that the tests would use the port provided in this argument where applicable.

[FEATURE] Add cron-job ability and announcers

Add cron-job ability so that the dstp can re-run the tests against the given site in the specified amount of time and add the logic for announcing results in slack, discord etc.

An example usage in my mind:

$ export SLACK_TOKEN="token"
$ export SLACK_CHANNEL_ID="1234567"

$ dstp --cron=300 --announce="slack" 8.8.8.8

Then this re-runs the tests in every 5 minutes(300 sec) and announces the results to given slack channel.

  • Add cron-job logic
  • Add announcer for Slack.
  • Add announcer for Discord.

ping: socket: permission denied on WSL

I got following error in WSL (Windows Subsystem for Linux) terminal (Ubuntu 20.04):

me@JNNH00004L:~$ dstp https://google.com
Ping: failed to run ping: socket: permission denied
DNS: failed to run ping: socket: permission denied
SystemDNS: resolving 216.58.201.78, 2a00:1450:4014:800::200e
TLS: certificate is valid for 56 more days
HTTPS: got 200 OK

Ping command is working OK:

me@JNNH00004L:~$ ping google.com
PING google.com (216.58.201.78) 56(84) bytes of data.
64 bytes from prg03s01-in-f78.1e100.net (216.58.201.78): icmp_seq=1 ttl=113 time=24.6 ms
64 bytes from prg03s01-in-f78.1e100.net (216.58.201.78): icmp_seq=2 ttl=113 time=20.9 ms

[BUG] Issue with parsing -a/--addr

Hello,

I've noticed that I am unable to run the tests with ./dstp -a 8.8.8.8 on macOS (haven't tested on Linux yet). I've isolated the issue with how the flags are parsed in

fs.StringVar(&opts.Addr, "a", "", "The URL or the IP address to run tests against")

I was able to isolate it by adding fmt.Println(values) in cmd/dstp/main.go and seeing that values was empty:

$ make; sudo ./dstp -a 8.8.8.8
go build -o dstp cmd/dstp/main.go
Password:
opts.Addr value: 8.8.8.8
values variable value: []
address cannot be empty

Usage: dstp [OPTIONS] [ARGS]
Options:
        -a, --addr   <string>  The URL or the IP address to run tests against      [REQUIRED]
        -o, --out    <string>  The type of the output, either json or plaintext    [Default: plaintext]
        -c           <bool>    Run all the tests concurrently.                     [Default: false]
        -h, --help             Show this message and exit.

In order to run it, I have to update

if opts.Addr == "" && len(values) >= 1 {
to remove the values size condition:

$ tail config/config.go
	if opts.Addr != "" { // && len(values) >= 1 {
                // opts.Addr = values[0]
        } else {
                fmt.Println(opts.Addr)
                return nil, fmt.Errorf("address cannot be empty")
        }

        return opts, nil
}
$ make; sudo ./dstp -a 8.8.8.8
go build -o dstp cmd/dstp/main.go
Password:
opts.Addr value: 8.8.8.8
values variable value: []
Ping: 329.766ms
DNS: resolving 8.8.8.8
TLS: certificate is valid for 60 more days
HTTPS: got 200 OK

Another issue I've noticed is that on macOS, you need to set pinger.SetPrivileged(true) on

pinger, err := createPinger(addr.String())
and
pinger, err := createPinger(addr.String())
and run dstp with sudo. I suppose that it's the same issue as on Linux.

go version:

$ go version
go version go1.17.2 darwin/amd64

OS:

$ uname -a
Darwin 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:42 PDT 2021; root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64

Failure in go test

go test does not get passed on https://github.com/ycd/dstp/releases/tag/v0.4.0:
https://github.com/aminvakil/aur/runs/5522345117?check_suite_focus=true#step:11:95

go: downloading github.com/kr/pretty v0.2.1
go: downloading github.com/google/go-cmp v0.5.6
go: downloading github.com/yuin/goldmark v1.4.0
go: downloading github.com/kr/text v0.1.0
package github.com/rhysd/actionlint/playground
	imports syscall/js: build constraints exclude all Go files in /usr/lib/go/src/syscall/js

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.