Compare commits

...

10 Commits

Author SHA1 Message Date
a102d0d260 write about rac url 2025-06-18 07:40:57 +03:00
MeexReay
4ee854d8af
fix features 2025-06-18 05:48:14 +03:00
MeexReay
5cbc2351ed
NO USING TOR PROXY BY DEFAULT AHHHH 2025-06-18 05:43:47 +03:00
d2ad18ba89 notify-rust 2025-06-18 03:06:28 +03:00
78e0caa641 fix compiling docs x2 2025-06-18 02:15:13 +03:00
0123589ec7 fix compiling docs 2025-06-18 02:09:51 +03:00
05f0ec22a8 fix gvsbuild link 2025-06-18 01:41:52 +03:00
MeexReay
0b625c33b6
add comma between features in the compiling docs 2025-06-18 01:15:38 +03:00
7406f2cd96 Merge branch 'main' of https://github.com/MeexReay/bRAC 2025-06-18 01:14:14 +03:00
e582677bce set wracs server as default 2025-06-18 01:13:49 +03:00
7 changed files with 838 additions and 41 deletions

771
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,7 @@ chrono = "0.4.40"
serde_default = "0.2.0"
socks = "0.3.4"
libnotify = { version = "1.0.3", optional = true }
notify-rust = { version = "4.11.7", optional = true }
gdk-pixbuf = { version = "0.3.0", optional = true } # DO NOT UPDATE
winapi = { version = "0.3.9", optional = true, features = ["wincon", "winuser"] }
tungstenite = "0.27.0"
@ -24,6 +25,7 @@ tungstenite = "0.27.0"
[features]
default = []
libnotify = ["dep:libnotify", "dep:gdk-pixbuf"]
notify-rust = ["dep:notify-rust"]
winapi = ["dep:winapi"]
[build-dependencies]

View File

@ -13,13 +13,12 @@ better RAC client
- RACv1.99.x and RACv2.0 compatible
- WRAC compatible ([docs](docs/wrac.md))
- chat commands (type /help)
- no ip and date visible for anyone
- uses TOR proxy server by default (meex.lol:11234)
- coloring usernames by their clients (CRAB, clRAC, Mefidroniy, etc)
- many command-line options (--help)
- rich configuration (--config-path to get file path and --configure to edit)
- RACS compatible (--enable-ssl or in --configure enable SSL)
- chunked reading messages
- no ip and date visible for anyone (almost)
- coloring usernames by their clients (CRAB, clRAC, Mefidroniy, etc.)
- many command-line options (see --help)
- rich configuration (--config-path to get file path)
- RACS/WRACS compatible (ex: wracs://meex.lol)
- reading messages chunked (less traffic usage)
![screenshot](misc/image.png)
@ -90,6 +89,7 @@ messages starting with a slash are sent to chat only if the `--disable-commands`
- [User agents](docs/user_agents.md)
- [Authenticated mode](docs/auth_mode.md)
- [WRAC protocol (v2.0)](docs/wrac.md)
- [About RAC URL](docs/url.md)
- [FAQ](docs/faq.md)
## see also

View File

@ -4,17 +4,16 @@
1. Install [rustup](https://rustup.rs/)
2. Install [MSVC](https://visualstudio.microsoft.com/visual-cpp-build-tools/) and run `rustup default stable-msvc`
3. Extract [GTK4 from gvsbuild](https://github.com/wingtk/gvsbuild/releases/tag/latest) to `C:\gtk`
3. Extract [GTK4 from gvsbuild](https://github.com/wingtk/gvsbuild/releases/latest) to `C:\gtk`
4. Update environment variables:
- Go to Start
- Search for 'Advanced system settings'
- Go to Start, search for 'Advanced system settings' (or click on Properties of My Computer in the Explorer, then you'll find 'Advanced system settings')
- Click 'Environment Variables...'
- Add `C:\gtk\lib\pkgconfig` to the PKG_CONFIG_PATH variable
- Add `C:\gtk\bin` to the PATH variable
- Add `C:\gtk\lib` to the Lib variable
- Save and exit
- Add `C:\gtk\lib\pkgconfig` to the PKG_CONFIG_PATH variable (or create one if doesnt exist)
- Add `C:\gtk\bin` to the PATH variable (or create one if doesnt exist)
- Add `C:\gtk\lib` to the Lib variable (or create one if doesnt exist)
- Apply and close the window (maybe restart PC)
5. Open the repository directory in console (download it from github or with `git clone https://github.com/MeexReay/bRAC.git`)
6. Run `cargo build -r -F libnotify winapi`
6. Run `cargo build -r -F winapi,notify-rust`
7. Done! Your finished binary is in the `target/release` folder.
## Linux / MacOS
@ -26,22 +25,36 @@
# Troubleshooting
## Windows / MacOS
## Windows
### Doesnt compile / doesnt work
### Black frame around the window
Write a new issue here and dont google anything!!1
Black frame appears on connecting to the server or when bRAC just freezes. Be patient.
## MacOS
### Notifications dont work
There are two solutions:
- Switch to `libnotify`:
Add the feature `libnotify` to cargo: `cargo build -r -F libnotify`
- Switch to `notify-rust`:
Add the feature `notify-rust` to cargo: `cargo build -r -F notify-rust`
## Linux
### Notifications dont work
There are Two solutions:
There are two solutions:
- Switch to `libnotify`:
Just add the new feature to cargo: `cargo build -r -F libnotify` \
Libnotify sucks in many situations, but its cross-compiling and always work
Libnotify sucks in many situations, but it always work
- Make a desktop file:
@ -49,4 +62,4 @@ Enter the repository folder and run: `./misc/create-desktop.sh` \
You'll get a desktop file contents, just edit paths here and write it to a new file in the `~/.local/share/applications` or `/usr/share/applications`\
All of these, with adding icons and other, makes this command: `make install` (using `gnumake` package) \
But make sure, that you have `.local/bin` in the `PATH` variable, otherwise it won't work. \
Now, if you'll run with the desktop file, GNotifications will work perfectly.
Now, if you'll run with the desktop file, GNotifications will work perfectly.

16
docs/url.md Normal file
View File

@ -0,0 +1,16 @@
# How does RAC URL work?
RAC URL is used in sRAC and bRAC as the default way of specifying host, running a RAC or WRAC server.
Format of RAC URL:
```
<protocol>://<address>[:<port>]
```
Protocol can be one of these:
| | **SSL** | **No SSL** |
| :--: | :--: | :--: |
| **WebSocket** | wracs:// | wrac:// |
| **No Websocket** | racs:// | rac:// |

View File

@ -22,7 +22,7 @@ pub fn default_konata_size() -> usize {
100
}
pub fn default_host() -> String {
"meex.lol:11234".to_string()
"wracs://meex.lol".to_string()
}
pub fn default_message_format() -> String {
MESSAGE_FORMAT.to_string()

View File

@ -41,7 +41,7 @@ struct UiModel {
window: ApplicationWindow,
#[cfg(feature = "libnotify")]
notifications: Arc<RwLock<Vec<libnotify::Notification>>>,
#[cfg(not(feature = "libnotify"))]
#[cfg(all(not(feature = "libnotify"), not(feature = "notify-rust")))]
notifications: Arc<RwLock<Vec<String>>>,
}
@ -777,7 +777,7 @@ fn build_ui(ctx: Arc<Context>, app: &Application) -> UiModel {
window: window.clone(),
#[cfg(feature = "libnotify")]
notifications: Arc::new(RwLock::new(Vec::<libnotify::Notification>::new())),
#[cfg(not(feature = "libnotify"))]
#[cfg(all(not(feature = "libnotify"), not(feature = "notify-rust")))]
notifications: Arc::new(RwLock::new(Vec::<String>::new())),
}
}
@ -805,6 +805,7 @@ fn setup(_: &Application, ctx: Arc<Context>, ui: UiModel) {
}
});
#[cfg(not(feature = "notify-rust"))]
GLOBAL.with(|global| {
if let Some(ui) = &*global.borrow() {
#[cfg(feature = "libnotify")]
@ -868,6 +869,20 @@ fn load_css(is_dark_theme: bool) {
);
}
#[cfg(feature = "notify-rust")]
fn send_notification(_: Arc<Context>, _: &UiModel, title: &str, message: &str) {
use notify_rust::{Notification, Timeout};
Notification::new()
.summary(title)
.body(message)
.auto_icon()
.appname("bRAC")
.timeout(Timeout::Default) // this however is
.show()
.expect("notify-rust send error");
}
#[cfg(feature = "libnotify")]
fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str) {
use libnotify::Notification;
@ -885,7 +900,7 @@ fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str)
ui.notifications.write().unwrap().push(notification);
}
#[cfg(not(feature = "libnotify"))]
#[cfg(all(not(feature = "libnotify"), not(feature = "notify-rust")))]
fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str) {
use std::{
hash::{DefaultHasher, Hasher},
@ -915,7 +930,13 @@ fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str)
}
fn on_add_message(ctx: Arc<Context>, ui: &UiModel, message: String, notify: bool) {
let Some(message) = sanitize_message(message) else {
let formatting_enabled = ctx.config(|c| c.formatting_enabled);
let Some(message) = (if formatting_enabled {
sanitize_message(message)
} else {
Some(message)
}) else {
return;
};
@ -933,7 +954,9 @@ fn on_add_message(ctx: Arc<Context>, ui: &UiModel, message: String, notify: bool
let mut label = String::new();
if let Some((date, ip, content, nick)) = parse_message(message.clone()) {
if let (true, Some((date, ip, content, nick))) =
(formatting_enabled, parse_message(message.clone()))
{
if let Some(ip) = ip {
if ctx.config(|o| o.show_other_ip) {
label.push_str(&format!(