Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
aisbf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
aisbf
Commits
156c2199
Commit
156c2199
authored
Apr 20, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add tor status endpoint
parent
90c7d971
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
main.py
main.py
+31
-0
No files found.
main.py
View file @
156c2199
...
...
@@ -13644,5 +13644,36 @@ Message:
return
JSONResponse
({
'success'
:
False
,
'error'
:
str
(
e
)},
status_code
=
500
)
@
app
.
get
(
"/dashboard/tor/status"
)
async
def
dashboard_tor_status
(
request
:
Request
):
"""Get Tor hidden service status"""
auth_check
=
require_dashboard_auth
(
request
)
if
auth_check
:
return
auth_check
# Only admin can access Tor status
if
request
.
session
.
get
(
'role'
)
!=
'admin'
:
return
JSONResponse
({
'success'
:
False
,
'error'
:
'Admin access required'
},
status_code
=
403
)
try
:
from
aisbf.config
import
get_config
config
=
get_config
()
tor_enabled
=
config
and
hasattr
(
config
,
'tor'
)
and
config
.
tor
and
config
.
tor
.
enabled
tor_running
=
tor_service
is
not
None
and
tor_service
.
is_connected
()
if
tor_service
else
False
response
=
{
'enabled'
:
tor_enabled
,
'running'
:
tor_running
,
'onion_address'
:
tor_service
.
onion_address
if
tor_service
and
tor_service
.
onion_address
else
None
}
return
JSONResponse
(
response
)
except
Exception
as
e
:
logger
.
error
(
f
"Tor status error: {e}"
)
return
JSONResponse
({
'success'
:
False
,
'error'
:
str
(
e
)},
status_code
=
500
)
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment