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

Nextgen: D-rewrite of OpenBNET #2

Open
wants to merge 175 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
175 commits
Select commit Hold shift + click to select a range
be81143
Added proof of concept graph generation
deavmi Sep 16, 2022
a8ce923
Added proof of concept graph generation
deavmi Sep 16, 2022
186b99b
Minor cleanup
rany2 Sep 16, 2022
e90a60a
Initialise seaborn once
deavmi Sep 16, 2022
b837ae7
Merge branch 'nextgen' of https://github.com/bonobonet/OpenBNET into …
deavmi Sep 16, 2022
3281063
Cleaned up
deavmi Sep 16, 2022
d9288ca
Added updated dependencies
deavmi Sep 16, 2022
69b97ab
Added missing dependency for Debian
deavmi Sep 16, 2022
88cdd4e
Fix rendering of logo
deavmi Sep 16, 2022
4301303
minor fix, will add logging later
rany2 Sep 16, 2022
5367251
Merge branch 'nextgen' of ssh://github.com/bonobonet/OpenBNET into ne…
rany2 Sep 16, 2022
4c11144
Remove generated graphs
rany2 Sep 16, 2022
e7864c0
poc logging and plotting
rany2 Sep 17, 2022
97ed366
fix
rany2 Sep 17, 2022
1f228e1
remove unused imports
rany2 Sep 17, 2022
5d86c53
open in append mode
rany2 Sep 17, 2022
f23d1b1
show legend
rany2 Sep 17, 2022
6ae995b
maybe that works
rany2 Sep 17, 2022
bb84235
try again
rany2 Sep 17, 2022
8a6fc7a
Fixed navbar
deavmi Sep 17, 2022
b464b6e
Fixed navbar Home link
deavmi Sep 17, 2022
ff27751
bruh
rany2 Sep 17, 2022
78da823
Merge branch 'nextgen' of ssh://github.com/bonobonet/OpenBNET into ne…
rany2 Sep 17, 2022
61ee7db
meh
rany2 Sep 17, 2022
d35a4c7
bruh
rany2 Sep 17, 2022
4f913ed
divide and conquer
rany2 Sep 17, 2022
164e35b
autoupdater thread
rany2 Sep 17, 2022
3306a8e
Fixed
deavmi Sep 17, 2022
35cef90
test
deavmi Sep 17, 2022
25c9d17
bruh
deavmi Sep 17, 2022
12ce624
bruh?
deavmi Sep 17, 2022
9a58d10
Test this
deavmi Sep 17, 2022
8199e98
Print out what the json_data is on fetch error
deavmi Sep 17, 2022
41b9308
raise exc on failure
rany2 Sep 17, 2022
ea00101
Merge branch 'nextgen' of ssh://github.com/bonobonet/OpenBNET into ne…
rany2 Sep 17, 2022
b3c7517
fixup
rany2 Sep 17, 2022
a6b0de4
bruh
rany2 Sep 17, 2022
72c947a
fix for when the graph just got updated
rany2 Sep 17, 2022
697bcf9
oh
rany2 Sep 17, 2022
585e2da
no need for legend anymore
rany2 Sep 17, 2022
a2debde
Added x-axis and y-axis labels
deavmi Sep 17, 2022
4718887
Merge branch 'nextgen' of https://github.com/bonobonet/OpenBNET into …
deavmi Sep 17, 2022
d3efb2c
how about now
rany2 Sep 17, 2022
48b6111
Merge branch 'nextgen' of ssh://github.com/bonobonet/OpenBNET into ne…
rany2 Sep 17, 2022
3d17766
rename and prevent thread from crashing
rany2 Sep 17, 2022
9d6383b
on god
rany2 Sep 17, 2022
160db0c
Start work on OpenBNET Next-gen
deavmi Mar 20, 2023
96dd801
- Added vibe as a dependency
deavmi Mar 20, 2023
23fc936
- Setup router and start listening
deavmi Mar 20, 2023
45298ec
- USe `vibe-d` version `0.9.6-beta.1` (as it is available on my Raspb…
deavmi Mar 20, 2023
c364688
- Revert back to `vibe-d` version `0.9.5`
deavmi Mar 20, 2023
d6d19b1
- Test
deavmi Mar 20, 2023
293a34d
- Test
deavmi Mar 20, 2023
19abe56
- Test
deavmi Mar 20, 2023
f208c24
- Revert back to using `vibe-d`
deavmi Mar 20, 2023
16e94ea
- Updated `.gitignore`
deavmi Mar 20, 2023
cd6142e
- Removed `handy-httpd` dependency
deavmi Mar 20, 2023
ec48da9
- Added a `Makefile` for building for raspberry pis
deavmi Mar 20, 2023
44a977b
- (Actually) use `handy-httpd` instead of `vibe-d`
deavmi Mar 20, 2023
207af7f
- Fixed compilation issues
deavmi Mar 20, 2023
6d22202
- Updated build command for when building for Raspberry Pis
deavmi Mar 20, 2023
abd7140
- Added some parsing
deavmi Mar 20, 2023
695f320
- Added proper `.gitignore` for D
deavmi Mar 20, 2023
b8645c9
- Moved testing inputs to `testInputs.d` module
deavmi Mar 20, 2023
04fc46b
- Extract `topic_set_at` from JSON
deavmi Mar 20, 2023
62434bd
- Extract channel modes
deavmi Mar 20, 2023
e8d6565
- Refactored into new module
deavmi Mar 20, 2023
6f3e148
- Added some initial server parsing
deavmi Mar 20, 2023
7ecf288
- Changed back to `vibe-d`
deavmi Mar 20, 2023
1e93858
- Removed `handy-httpd` dependency
deavmi Mar 20, 2023
5866d65
- Makefile fixed for Pi builds
deavmi Mar 20, 2023
ef07960
- Re-enabled vibe-d code
deavmi Mar 20, 2023
c270a60
Dub
deavmi Mar 20, 2023
ddf094f
- Added a `/channels` route handler that renders the `channels.dt` di…
deavmi Mar 20, 2023
6a88b2c
- Fixed Makefile for Pi builds
deavmi Mar 20, 2023
88120aa
- Added arguments to template render call
deavmi Mar 20, 2023
f8afb7c
Channel
deavmi Mar 21, 2023
44d20d7
- Setup routesd for serving static files being the OpenBNET banner an…
deavmi Mar 21, 2023
f18b7ab
- Use table CSS
deavmi Mar 21, 2023
0692a90
- Use table CSS
deavmi Mar 21, 2023
2f0d42d
Channels page
deavmi Mar 21, 2023
e10dc48
- Added dummy `Network` object to error page handler
deavmi Mar 21, 2023
07152c4
- Added dummy method for fetching a `ChannelInfo` object
deavmi Mar 21, 2023
451a7a7
- When generating the clickable link for visiting a channel's informa…
deavmi Mar 21, 2023
02dcce4
- Extract query not params
deavmi Mar 21, 2023
2c92e9c
Stuff
deavmi Mar 21, 2023
a8984b4
- Added `gogga` for logging
deavmi Mar 21, 2023
d6c3aad
- Added comment
deavmi Mar 21, 2023
4c428d7
- Added skeleton for `/channelinfo?name=<channelName>`
deavmi Mar 21, 2023
cfe7cf2
- Display members on `/channelinfo?name=<channelName>` page
deavmi Mar 21, 2023
26ef461
- Parse the JSON from `server.list` JSON RPC call
deavmi Mar 21, 2023
9239c60
- Only extract `ulined`, `uplink` and `synced` if such keys exist
deavmi Mar 21, 2023
5694125
Server
deavmi Mar 23, 2023
b11b8ed
Server
deavmi Mar 23, 2023
019cf75
App
deavmi Mar 23, 2023
122b1db
- Moved common `<head> ... </head>` code into `header.dt`
deavmi Mar 23, 2023
1b4bd51
- Removed `<hr>` from `banner.dt`
deavmi Mar 23, 2023
387b197
- Fixed indentation in `home.dt`
deavmi Mar 23, 2023
551818d
- Serve the BNET logo as the favicon
deavmi Mar 23, 2023
bfd81b2
- Use `types` package rather
deavmi Mar 23, 2023
92f0ae8
Home page
deavmi Mar 23, 2023
d81f4dc
- Fixed up error page
deavmi Mar 23, 2023
278007a
- Fixed up indentation in home page
deavmi Mar 23, 2023
84864b1
- Added link to `/servers` in navbar on homepage
deavmi Mar 23, 2023
251b705
- Use `header.dt` include directive
deavmi Mar 23, 2023
37b390e
- Fixed `{{ description }} `
deavmi Mar 23, 2023
bf26d20
- Removed `Makefile`
deavmi Mar 23, 2023
5b266a3
- Restructured modules
deavmi Mar 23, 2023
3449804
- Implemented RPC call for `stats.get`
deavmi Mar 23, 2023
21e3694
- Documented `fetchStats()`
deavmi Mar 23, 2023
da951db
- Added RPC call for fetching channel lists (`channels.list`)
deavmi Mar 23, 2023
9944cdb
App
deavmi Apr 2, 2023
84ed078
App
deavmi Apr 2, 2023
ff2dd86
App
deavmi Apr 2, 2023
28c073f
App
deavmi Apr 2, 2023
c326ecf
App
deavmi Apr 2, 2023
45c34ca
App
deavmi Apr 2, 2023
c1bac3d
- Pretty print
deavmi Apr 2, 2023
f6c1d97
- Moved position of debug print
deavmi Apr 2, 2023
374ea13
d
deavmi Apr 2, 2023
1a235ad
- Try setting content type
deavmi Apr 2, 2023
781b729
j
deavmi Apr 2, 2023
8af02cc
- Fixed wrong RPC call for `fetchChannels()`
deavmi Apr 2, 2023
5e1db39
- Fixed compilation issue
deavmi Apr 2, 2023
6aef489
fuck
deavmi Apr 2, 2023
8cb5901
- Holy moly
deavmi Apr 2, 2023
31093f3
- Tst kak
deavmi Apr 2, 2023
30b846e
- Fixed up the RPC method names for various methods
deavmi Apr 2, 2023
e5c1788
- Do rany thing
deavmi Apr 2, 2023
7084ec5
- Fix that me thinks
deavmi Apr 2, 2023
fd16a47
- Generate URL escape codes for channel names
deavmi Apr 2, 2023
0653c37
- Fix call to `strip(..., ...)`
deavmi Apr 2, 2023
0b18f39
- Fixed call to `count(..., ...)`
deavmi Apr 2, 2023
3b92789
- Fixup `/servers`
deavmi Apr 2, 2023
2332914
- Test
deavmi Apr 2, 2023
c975820
- Try to fix `fetchStats()`
deavmi Apr 2, 2023
afc9503
- Debug `fromJSON(JSONValue)` for `Server`
deavmi Apr 2, 2023
b2eda2e
Server
deavmi Apr 2, 2023
5c3f588
Stats
deavmi Apr 2, 2023
c024c96
Stats
deavmi Apr 2, 2023
6e26884
Stats
deavmi Apr 2, 2023
95fcd16
App
deavmi Apr 2, 2023
52b7833
App
deavmi Apr 2, 2023
01c0cb9
- Fixed creation date column for `/channels`
deavmi Apr 2, 2023
1052a41
d
deavmi Apr 3, 2023
52e4416
- Make channel name appear on `/channelinfo`
deavmi Apr 3, 2023
0fe2894
- Actually show channel name on `/channelinfo`
deavmi Apr 3, 2023
e5a4640
- Update `/channelinfo` sub-title
deavmi Apr 3, 2023
d96cfbf
- Added `User` type
deavmi Apr 3, 2023
523c209
- Added route handler registration for `/user` to `userInfoHandler()`
deavmi Apr 3, 2023
bd0729b
- Make user's in `/channelinfo` clickable
deavmi Apr 3, 2023
3c7dab1
- Fixed typo (`getID()` instead of `getId()`)
deavmi Apr 3, 2023
d72d0de
- Make debug print of JSON in `fetchUserInfo(string)` pretty
deavmi Apr 3, 2023
8672f4a
- Update comment
deavmi Apr 3, 2023
1a410c2
- Extract `"client"` from it
deavmi Apr 3, 2023
51f9488
- Test logger
deavmi Apr 3, 2023
4304020
- Extract realname
deavmi Apr 3, 2023
79f8c4f
- Display `nick@vhost` under the `realname` title
deavmi Apr 3, 2023
77b3fc4
- Extract server's name, modes and reputation score and display these…
deavmi Apr 3, 2023
bc35ab7
- Added `<br>`s
deavmi Apr 3, 2023
1c4c1bd
- Fixed typo in `user.dt` view
deavmi Apr 3, 2023
345dc9c
- DIsplay hostname on `/user`
deavmi Apr 4, 2023
75104f6
- Display the cloaked hostname on `/user`
deavmi Apr 4, 2023
3248c4e
- Make `realname` `h1`
deavmi Apr 4, 2023
d5db8a8
- Test new style
deavmi Apr 5, 2023
99f8f5a
Delete d
deavmi Apr 6, 2023
eefd4ad
Delete obnet.py
deavmi Apr 6, 2023
09f1d18
Delete openbnet
deavmi Apr 6, 2023
b991040
Update README.md
deavmi Apr 6, 2023
361a7f9
Updated screenshots
deavmi Apr 6, 2023
c49c14b
deleted binary
deavmi Apr 6, 2023
ab9d9ef
Merge branch 'nextgen' of github.com:bonobonet/OpenBNET into nextgen
deavmi Apr 6, 2023
9620133
Added screenshot of user info page
deavmi Apr 6, 2023
485beb3
Update README.md
deavmi Apr 6, 2023
29fb2fc
Dub
deavmi Apr 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.dub
docs.json
__dummy.html
libsnooze.so
libsnooze.dylib
libsnooze.dll
libsnooze.a
libsnooze.lib
openbnet-test-*
*.exe
*.pdb
*.o
*.obj
*.lst
dub.selections.json
liblibsnooze.a
39 changes: 9 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# OpenBNET

Lightweight web interface and API endpoint for the `third/wwwstats` unrealircd module.
Lightweight web interface and API endpoint for the [`JSON RPC`](https://www.unrealircd.org/docs/JSON-RPC) unrealircd module.

</center>

Expand Down Expand Up @@ -40,57 +40,36 @@ Available at `/api`:

You will need the following and can install them easily:

1. `python3`
2. `flask`
3. `pip`
1. `dmd`
2. `dub`

```
apt install python3 python3-pip
pip3 install flask
```
Visit the [D programming language website](https://dlang.org) for more information on how to install it.

You will need to configure the `third/wwwstats` module as well, information on doing so can be found [here](http://deavmi.assigned.network/projects/bonobonet/openbnet/).
You will need to configure the `JSON RPC` module as well, information on doing so can be found [here](https://deavmi.assigned.network/projects/bonobonet/network/config/monitoring/).

## Usage

Firstly grab all the files in this repository, then:

```
chmod +x obnet.py
dub build
```

The next thing to do will be to set the following environment variables:

* `OPENBNET_BIND_ADDR`
* The addresses to listen on (for the web server)
* `OPENBNET_BIND_PORT`
* The port to listen on (for the web server)
* `UNREAL_SOCKET_PATH`
* This is the path to the unrealircd `third/wwwstats` UNIX domain socket
* `RPC_ENDPOINT`
* The HTTP address to the JSON RPC endpoint

You can then run it like such:

```
OPENBNET_BIND_ADDR="::" OPENBNET_BIND_PORT=8081 UNREAL_SOCKET_PATH=/tmp/openbnet.sock ./obnet.py
RPC_ENDPOINT=https://127.0.0.1:8181 ./obnet
```

### Systemd-unit

There is an example systemd unit file included in the repository as `openbnet.service`

## Custom branding

You can adjust the branding in `obnet.py` by taking a look at the following:

```python
# Network information
NET_INFO = {
"networkName": "OpenBonobo",
"description": "Network statistics for the BonoboNET network",
"networkLogo": "open_bnet_banner.png",
}
```

## License

This project uses the [AGPL version 3](https://www.gnu.org/licenses/agpl-3.0.en.html) license.
Expand Down
Binary file added assets/b_hash_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions dub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"authors": [
"Tristan B. Velloza Kildaire",
"Rany"
],
"copyright": "Copyright © 2023, Tristan B. Velloza Kildaire",
"dependencies": {
"gogga": "~>2.1.18",
"vibe-d": "~>0.9.5"
},
"description": "A looking glass into unrealircd",
"license": "AGPL-3",
"name": "openbnet",
"stringImportPaths": [
"source/views"
]
}
177 changes: 0 additions & 177 deletions obnet.py

This file was deleted.

Binary file modified screenshots/chan_list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/chan_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/servers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/user_info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading