Compare commits
No commits in common. "9c2bec33e177ce0fd0f35dcb8e4fc6ecba5e060f" and "ada4d1d1812620c3a3d33ea6b029e6da653f5c3b" have entirely different histories.
9c2bec33e1
...
ada4d1d181
3
.gitattributes
vendored
@ -1,3 +0,0 @@
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.gif filter=lfs diff=lfs merge=lfs -text
|
||||
*.ico filter=lfs diff=lfs merge=lfs -text
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bRAC"
|
||||
version = "0.1.5+2.0"
|
||||
version = "0.1.4+2.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
@ -17,9 +17,9 @@ chrono = "0.4.40"
|
||||
serde_default = "0.2.0"
|
||||
socks = "0.3.4"
|
||||
libnotify = { version = "1.0.3", optional = true }
|
||||
gdk-pixbuf = { version = "0.3.0", optional = true } # DO NOT UPDATE
|
||||
gdk-pixbuf = { version = "0.3.0", optional = true }
|
||||
winapi = { version = "0.3.9", optional = true, features = ["wincon", "winuser"] }
|
||||
tungstenite = "0.27.0"
|
||||
tungstenite = "0.26.2"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
49
Makefile
@ -1,15 +1,36 @@
|
||||
.PHONY: clean install uninstall
|
||||
.PHONY: clean build windows build
|
||||
|
||||
install: target/release/bRAC
|
||||
cp $< ~/.local/bin/bRAC
|
||||
chmod +x ~/.local/bin/bRAC
|
||||
mkdir ~/.local/share/bRAC -p
|
||||
cp misc/bRAC.png ~/.local/share/bRAC/icon.png
|
||||
cp misc/bRAC.desktop ~/.local/share/applications/ru.themixray.bRAC.desktop
|
||||
uninstall:
|
||||
rm -rf ~/.config/bRAC ~/.local/share/bRAC
|
||||
rm -f ~/.local/share/applications/ru.themixray.bRAC.desktop
|
||||
target/release/bRAC:
|
||||
cargo build -r
|
||||
clean:
|
||||
cargo clean
|
||||
build: build/windows-x86_64 build/linux-x86_64
|
||||
windows: build/windows-x86_64
|
||||
linux: build/linux-x86_64
|
||||
|
||||
build/windows-x86_64:
|
||||
mkdir -p build
|
||||
mkdir -p $@
|
||||
cargo build -r -F winapi --target x86_64-pc-windows-gnu
|
||||
curl -s https://api.github.com/repos/wingtk/gvsbuild/releases/latest \
|
||||
| grep -o ".*browser_download_url.*GTK4_Gvsbuild.*_x64.zip.*" \
|
||||
| cut -d : -f 2,3 \
|
||||
| tr -d \" \
|
||||
| wget -O $@/gtk4.zip -qi -
|
||||
unzip $@/gtk4.zip -d $@
|
||||
rm $@/gtk4.zip
|
||||
mv $@/bin/* $@/
|
||||
cp target/x86_64-pc-windows-gnu/release/bRAC.exe $@
|
||||
rm -r $@/bin
|
||||
cp install.bat $@
|
||||
cp uninstall.bat $@
|
||||
|
||||
build/linux-x86_64:
|
||||
mkdir -p build
|
||||
mkdir -p $@
|
||||
cargo build -r --target x86_64-unknown-linux-gnu
|
||||
# patchbin target/x86_64-unknown-linux-gnu/release/bRAC
|
||||
cp target/x86_64-unknown-linux-gnu/release/bRAC $@
|
||||
cp ru.themixray.bRAC.png $@
|
||||
cp ru.themixray.bRAC.desktop $@
|
||||
cp install.sh $@
|
||||
cp uninstall.sh $@
|
||||
|
||||
clean:
|
||||
rm -r build
|
21
README.md
@ -1,4 +1,4 @@
|
||||
# 
|
||||
# 
|
||||
<!--
|
||||
[<img src="https://github.com/user-attachments/assets/f2be5caa-6246-4a6a-9bee-2b53086f9afb" height="30">]()
|
||||
[<img src="https://github.com/user-attachments/assets/4d35191d-1dbc-4391-a761-6ae7f76ba7af" height="30">]()
|
||||
@ -9,9 +9,8 @@ better RAC client
|
||||
|
||||
## features
|
||||
|
||||
- gtk4 modern GUI
|
||||
- gtk4 GUI
|
||||
- RACv1.99.x and RACv2.0 compatible
|
||||
- WRAC compatible (can be enabled in the settings)
|
||||
- chat commands (type /help)
|
||||
- no ip and date visible for anyone
|
||||
- uses TOR proxy server by default (meex.lol:11234)
|
||||
@ -21,24 +20,10 @@ better RAC client
|
||||
- RACS compatible (--enable-ssl or in --configure enable SSL)
|
||||
- chunked reading messages
|
||||
|
||||

|
||||

|
||||
|
||||
## how to run
|
||||
|
||||
### install (recommended)
|
||||
|
||||
**for linux:**
|
||||
|
||||
1. Install requirements: `gtk4-dev gtk4 make rust git openssl-dev openssl`
|
||||
|
||||
2. Clone repository and run `make install`
|
||||
|
||||
3. Now you are able to start bRAC with desktop icon
|
||||
|
||||
**for windows:**
|
||||
|
||||
NO SOLUTION
|
||||
|
||||
### download binary
|
||||
|
||||
go to [releases](https://github.com/MeexReay/bRAC/releases/latest) and download file you need. its simple.
|
||||
|
2
build.rs
@ -9,7 +9,7 @@ use {
|
||||
fn main() -> io::Result<()> {
|
||||
if env::var_os("CARGO_CFG_WINDOWS").is_some() {
|
||||
WindowsResource::new()
|
||||
.set_icon("misc/icon.ico")
|
||||
.set_icon("icon.ico")
|
||||
.compile()?;
|
||||
}
|
||||
Ok(())
|
||||
|
0
misc/system-install.sh → install.sh
Normal file → Executable file
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6bfc6d5cc1aea7ce03204cbe50bbaa1e8a1e1e71ba39b38d801354bcd19b3ef1
|
||||
size 30985
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1cac648a6d620f4b655291c5afe1cb2a311eee5e04adcce8502e5a51cfe7ad09
|
||||
size 67646
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:727c3caaec8dd3744aaaa11a85dae20138f3440a3125a14396fc556df99f4e51
|
||||
size 62730
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdc05097ef32682f52da42028169b180d711742163dc9d142522c8bfffb93510
|
||||
size 20425
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cp bRAC ~/.local/bin/bRAC
|
||||
chmod +x ~/.local/bin/bRAC
|
||||
mkdir ~/.local/share/bRAC -p
|
||||
cp misc/bRAC.png ~/.local/share/bRAC/icon.png
|
||||
cp misc/bRAC.desktop ~/.local/share/applications/ru.themixray.bRAC.desktop
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm -rf ~/.config/bRAC ~/.local/share/bRAC ~/.local/share/applications/ru.themixray.bRAC.desktop
|
@ -3,8 +3,8 @@ Name=bRAC
|
||||
Version=0.1.4
|
||||
Type=Application
|
||||
Comment=better RAC client
|
||||
Icon=~/.local/share/bRAC/icon.png
|
||||
Exec=~/.local/bin/bRAC
|
||||
Icon=ru.themixray.bRAC.png
|
||||
Exec=bRAC
|
||||
Categories=Network;
|
||||
StartupNotify=true
|
||||
DBusActivatable=true
|
BIN
ru.themixray.bRAC.png
Normal file
After Width: | Height: | Size: 30 KiB |
@ -26,10 +26,8 @@ use gtk::{
|
||||
Justification, Label, ListBox, Orientation, Overlay, Picture, ScrolledWindow, Settings, Window
|
||||
};
|
||||
|
||||
use crate::proto::parse_rac_url;
|
||||
|
||||
use super::{config::{default_max_messages, default_update_time, get_config_path, save_config, Config},
|
||||
ctx::Context, on_send_message, parse_message, print_message, recv_tick, sanitize_message, SERVER_LIST};
|
||||
ctx::Context, on_send_message, parse_message, print_message, recv_tick, sanitize_message};
|
||||
|
||||
struct UiModel {
|
||||
chat_box: GtkBox,
|
||||
@ -410,7 +408,7 @@ fn build_ui(ctx: Arc<Context>, app: &Application) -> UiModel {
|
||||
|
||||
let server_list = ListBox::new();
|
||||
|
||||
for url in SERVER_LIST.iter() {
|
||||
for url in ["rac://meex.lol", "rac://meex.lol:11234", "rac://91.192.22.20"] {
|
||||
let url = url.to_string();
|
||||
|
||||
let label = Label::builder()
|
||||
@ -424,11 +422,7 @@ fn build_ui(ctx: Arc<Context>, app: &Application) -> UiModel {
|
||||
#[weak] ctx,
|
||||
move |_, _, _, _| {
|
||||
let mut config = ctx.config.read().unwrap().clone();
|
||||
if let Some((_, ssl, wrac)) = parse_rac_url(&url) {
|
||||
config.host = url.clone();
|
||||
config.wrac_enabled = wrac;
|
||||
config.ssl_enabled = ssl;
|
||||
}
|
||||
config.host = url.clone();
|
||||
ctx.set_config(&config);
|
||||
save_config(get_config_path(), &config);
|
||||
}
|
||||
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 20 KiB |
@ -15,14 +15,6 @@ use ctx::Context;
|
||||
pub use gui::run_main_loop;
|
||||
|
||||
|
||||
const HELP_MESSAGE: &str = "Help message:
|
||||
/help - show help message
|
||||
/register password - register user
|
||||
/login password - login user
|
||||
/clear n - send empty message n times
|
||||
/spam n text - send message with text n times
|
||||
/ping - check server ping";
|
||||
|
||||
lazy_static! {
|
||||
static ref ANSI_REGEX: Regex = Regex::new(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])").unwrap();
|
||||
static ref CONTROL_CHARS_REGEX: Regex = Regex::new(r"[\x00-\x1F\x7F]").unwrap();
|
||||
@ -36,12 +28,6 @@ lazy_static! {
|
||||
(Regex::new(r"\u{00B0}\u{0298}<(.*?)> (.*)").unwrap(), "magenta".to_string()), // Mefidroniy
|
||||
(Regex::new(r"<(.*?)> (.*)").unwrap(), "cyan".to_string()), // clRAC
|
||||
];
|
||||
|
||||
pub static ref SERVER_LIST: Vec<String> = vec![
|
||||
"rac://meex.lol".to_string(),
|
||||
"rac://meex.lol:11234".to_string(),
|
||||
"rac://91.192.22.20".to_string()
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -49,6 +35,15 @@ pub mod gui;
|
||||
pub mod config;
|
||||
pub mod ctx;
|
||||
|
||||
|
||||
const HELP_MESSAGE: &str = "Help message:
|
||||
/help - show help message
|
||||
/register password - register user
|
||||
/login password - login user
|
||||
/clear n - send empty message n times
|
||||
/spam n text - send message with text n times
|
||||
/ping - check server ping";
|
||||
|
||||
pub fn sanitize_text(input: &str) -> String {
|
||||
let without_ansi = ANSI_REGEX.replace_all(input, "");
|
||||
let cleaned_text = CONTROL_CHARS_REGEX.replace_all(&without_ansi, "");
|
||||
|
@ -10,5 +10,5 @@ getent passwd | while IFS=: read -r name password uid gid gecos home shell; do
|
||||
done
|
||||
|
||||
rm -f /bin/bRAC
|
||||
rm -f /usr/share/pixmaps/ru.themixray.bRAC.png
|
||||
rm -f /usr/share/applications/ru.themixray.bRAC.desktop
|
||||
rm -f ru.themixray.bRAC.png /usr/share/pixmaps
|
||||
rm -f ru.themixray.bRAC.desktop /usr/share/applications
|