mirror of
https://github.com/cbeuw/Cloak.git
synced 2026-04-26 04:55:58 +03:00
[GH-ISSUE #127] Howto reset a restricted user #107
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Cloak#107
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aboka2k on GitHub (Aug 27, 2020).
Original GitHub issue: https://github.com/cbeuw/Cloak/issues/127
hi, hv search but can't find a way to reset a restricted user. for eg. i allocate 1GB each month for them, do i need to reset it, or it will reset itself every 30 days? but what if i want to start the count from 1st starting next month? so i need to find a way to reset the their value
i try download the .db file to my Windows pc, and use MS Access & DB Browser for SQLite but both also cant open the file. Please advice.
Thank you,
@HirbodBehnam commented on GitHub (Aug 28, 2020):
Hello
The database is created using an engine called bbolt. You can try this database browser in order to explore the database and edit values. I think this is also possible via Cloak Panel. (Delete and add a new entry)
You can automate this task (to for example reset users at the beginning of the month) but it might be not easy. You have to use something like
cronto start a script that:Good luck!
@aboka2k commented on GitHub (Aug 28, 2020):
hi @HirbodBehnam thanks a lot for the reply, hopefully another 'issue' solve :) i follow your advice and try to install bbolt on my ubuntu 20.04 LTS vps, but it will always give 'error':
I run this code 'go get github.com/br0xen/boltbrowser' and download the git file and put together inside the
/go/bin/ folder/go/bin# ls`root@v2ray:
boltbrowser go.mod main.go README.md screen.go
bolt_model.go go.sum mainloop.go screen_about.go stringify.go
cursor.go LICENSE mainloop_windows.go screen_browser.go style.go
root@v2ray:~/go/bin# boltbrowser --help
boltbrowser: command not found
`
same 'error' if i supply the filename with the command - 'boltbrowser /etc/cloak/userinfo.db'. i also try to run/compile using 'go run' 'go build' for some of the 'go' file but no luck :/
any idea how to fix this? in the meantime, i install the Windows version and it is working. but working inside Ubuntu is the first choice as no need to download/upload etc.
What type of 'value' is the field using now? For eg., now the ExpiryTime shows '1684913254' how do i find out/convert its value to x number of days? need to know howto convert back/forth so i can edit them in future.
Thank you,
@HirbodBehnam commented on GitHub (Aug 28, 2020):
Sometimes GO does not add
~/go/binin the PATH. You can manually add it later. At first you should run it like./boltbrowser --helpor if you are in another directory you can try~/go/bin/boltbrowser --help.Also
ExpiryTimevalue is in unix epoch format. You can use something like this site to convert linux epoch in human readable format and vise versa.@aboka2k commented on GitHub (Aug 28, 2020):
@HirbodBehnam thanks alot as you have help solve another piece of the puzzle 👍
p/s - pls take a look at this if possible, https://github.com/cbeuw/Cloak/issues/126 , its the last piece of puzzle for this Cloak project. cheers~!
@aboka2k commented on GitHub (Aug 28, 2020):
p/ss - im sorry, what is the correct way to stop ck-server(etc) so we could edit the database? as it won't let me open - 'File /etc/cloak/userinfo.db is locked. Make sure it's not used by another app and try again'
is this the correct way to do it - find ck-server PID then kill it, edit the database and then reboot the server?
thank you,
@HirbodBehnam commented on GitHub (Aug 28, 2020):
Hello
As I said before I don't know about CDN mode and I have not tested it. (and I think I never will because I'm from Iran)
For editing the database you need to at first stop the cloak using
systemctl stop cloak-serverto stop cloak. Then edit the database and then usesystemctl start cloak-serverto start the cloak again.@LindaFerum commented on GitHub (Jun 27, 2024):
In case anyone is looking for ways to manipulate userinfo.db using command line (which I am currently struggling with) this issue (which I self-closed) should provide you with enough to get started
https://github.com/cbeuw/Cloak/issues/268
A CLI tool to inspect bold DB https://developer.hashicorp.com/vault/tutorials/monitoring/inspect-data-boltdb
A tool which apparently can manipulate them (which I am currently trying to sort out into a cron-able bash wrapper) https://github.com/spacewander/boltcli