Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the traffic limit isn't respected when set to zero before the first connection #1515

Open
whlack opened this issue Jan 23, 2024 · 5 comments
Labels
bug Something isn't working server usage/data controls issues related to controlling and limiting data

Comments

@whlack
Copy link

whlack commented Jan 23, 2024

When we create an access key, and set traffic limit to 0B before first connection, we can connect and use this key as long as we want. But if we set traffic limit to 0B after first connection, all works fine.

@daniellacosse daniellacosse added the bug Something isn't working label Jan 29, 2024
@daniellacosse daniellacosse changed the title Traffic limitation bug the traffic limit isn't respect when set to zero before the first connection Jan 29, 2024
@daniellacosse daniellacosse changed the title the traffic limit isn't respect when set to zero before the first connection the traffic limit isn't respected when set to zero before the first connection Jan 29, 2024
@daniellacosse daniellacosse added the usage/data controls issues related to controlling and limiting data label Jan 29, 2024
@murka
Copy link
Contributor

murka commented Feb 19, 2024

@whlack, thanks for the issue.

However, I'm experiencing difficulty in replicating the scenario you've described. Could you please provide a more detailed account or enhance the step-by-step instructions for reproducing the problem? Your assistance will help us address the issue more effectively.

@whlack
Copy link
Author

whlack commented Feb 19, 2024

  1. Create outline client key, and set traffic limit to 0KB
  2. Connect to this outline key
  • Expected behavior: You couldn't connect to the key, because you have no free traffic.
  • Real behavior: You can connect to the key and use it without any restrictions
  1. After first connection to the key, reset traffic limit, and set it again to 0KB
  • All works fine

@jyyi1 jyyi1 transferred this issue from Jigsaw-Code/outline-server Feb 26, 2024
@jyyi1 jyyi1 transferred this issue from Jigsaw-Code/outline-apps Feb 26, 2024
@jyyi1 jyyi1 added the server label Feb 26, 2024
@fourclever
Copy link

I've been having the same problem for a very long time, starting around version 1.8.0. But I do not reset the limit; access using keys with a zero limit is terminated automatically when traffic accumulates in the range of 300 - 350 MB, provided that the client reconnects at this moment. Up to 300 MB reconnections are not blocked.

@VMMHZK
Copy link

VMMHZK commented Mar 29, 2024

I'm facing the same problem. Version 1.8.1. When I create a new key with a data limit, it works as if there is no limit.
The limit only works, when I try to set it one more time, after the user has disconnected from the server.

I tried to install it manually in the Outline manager, and via the API. The result is the same.

Has anyone come up with a workaround?

@cornzzy
Copy link
Contributor

cornzzy commented Jun 7, 2024

I sent a merge request which targets this issue, hopefully it will be available in the next update.

But if you want it now, there is a quick surgical way to fix it. it also fixes @fourclever issue which is an hour delay:

  1. docker exec -it shadowbox vi app/main.js
  2. As you're in vi editor, press / then type .isOverDataLimit=s and press enter
  3. After you find isOverDataLimit=s>p press i for insert mode, and put an equal in front of >
  4. Press escape, then write :wq to save and quit
  5. Restart the container
    Note that it will be overridden by updates.

vi can be bit confusing, here is a gif:
isoverdatalimit

sbruens added a commit that referenced this issue Jul 24, 2024
* Fix isOverDataLimit logic to stop allowing 0 traffic byte

issue #1515 

This if statement is just wrong and doesn't block access when traffic limit is set to 0 byte. This one character fixes it.

Now if we create a new access key, set the limit to 0 before first usage, the client no longer will be able to connect.

* Rename `isOverDataLimit` to `reachedDataLimit`.

* Add a test case to prevent regression.

* Rename old variable.

* Update comment now that variable has changed meaning slightly.

Co-authored-by: Vinicius Fortuna <fortuna@users.noreply.github.com>

---------

Co-authored-by: sbruens <sbruens@users.noreply.github.com>
Co-authored-by: Vinicius Fortuna <fortuna@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server usage/data controls issues related to controlling and limiting data
Projects
None yet
Development

No branches or pull requests

7 participants