flant / ovpn-admin

Simple web UI to manage OpenVPN users.
Apache License 2.0
1.39k stars 261 forks source link

Bug - user list only show 14 users #114

Closed eatrisno closed 2 years ago

eatrisno commented 2 years ago

is there any solution related with this issue ?

thanks

pashcovich commented 2 years ago

which version of the openvpn server and ovpn-admin do you use? And what does your setup look like?

Fhtgn commented 2 years ago

I think it's because mgmtRead reads only 32768 bytes i fixed this problem in the following way

func (oAdmin *OvpnAdmin) mgmtRead(conn net.Conn) string {
    recvData := make([]byte, 32768)
    var out string
    var n int                                                                                                                                                                                                                         -
    var err error
    for {
       n, err = conn.Read(recvData)
       if n <= 0 || err != nil {
          break
       } else {
          out += string(recvData[:n])
          if strings.Contains(out, "type 'help' for more info") || strings.Contains(out, "END") {
             break
          }
       }
    }
    return out
pashcovich commented 2 years ago

Oh, really. we need to check it

@vitaliy-sn fyi

eatrisno commented 2 years ago

is it better to increase the size or loop the list?

Fhtgn commented 2 years ago

@eatrisno In my opinion, iteration is better. with it you will not reach the limit if the list of users grows even more

eatrisno commented 2 years ago

noted, it is working btw I tried to increase the size and loop, both worked fine