Compare commits
6 Commits
ada4d1d181
...
9c2bec33e1
Author | SHA1 | Date | |
---|---|---|---|
9c2bec33e1 | |||
ffd371ed27 | |||
5f451125d7 | |||
4c5098a5e9 | |||
97f59279a3 | |||
cdfd16f8c4 |
3
.gitattributes
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.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.4+2.0"
|
||||
version = "0.1.5+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 }
|
||||
gdk-pixbuf = { version = "0.3.0", optional = true } # DO NOT UPDATE
|
||||
winapi = { version = "0.3.9", optional = true, features = ["wincon", "winuser"] }
|
||||
tungstenite = "0.26.2"
|
||||
tungstenite = "0.27.0"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
47
Makefile
@ -1,36 +1,15 @@
|
||||
.PHONY: clean build windows build
|
||||
|
||||
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 $@
|
||||
.PHONY: clean install uninstall
|
||||
|
||||
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:
|
||||
rm -r build
|
||||
cargo clean
|
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,8 +9,9 @@ better RAC client
|
||||
|
||||
## features
|
||||
|
||||
- gtk4 GUI
|
||||
- gtk4 modern 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)
|
||||
@ -20,10 +21,24 @@ 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("icon.ico")
|
||||
.set_icon("misc/icon.ico")
|
||||
.compile()?;
|
||||
}
|
||||
Ok(())
|
||||
|
@ -3,8 +3,8 @@ Name=bRAC
|
||||
Version=0.1.4
|
||||
Type=Application
|
||||
Comment=better RAC client
|
||||
Icon=ru.themixray.bRAC.png
|
||||
Exec=bRAC
|
||||
Icon=~/.local/share/bRAC/icon.png
|
||||
Exec=~/.local/bin/bRAC
|
||||
Categories=Network;
|
||||
StartupNotify=true
|
||||
DBusActivatable=true
|
3
misc/bRAC.png
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6bfc6d5cc1aea7ce03204cbe50bbaa1e8a1e1e71ba39b38d801354bcd19b3ef1
|
||||
size 30985
|
3
misc/icon.ico
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1cac648a6d620f4b655291c5afe1cb2a311eee5e04adcce8502e5a51cfe7ad09
|
||||
size 67646
|
3
misc/image.png
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:727c3caaec8dd3744aaaa11a85dae20138f3440a3125a14396fc556df99f4e51
|
||||
size 62730
|
3
misc/logo.gif
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdc05097ef32682f52da42028169b180d711742163dc9d142522c8bfffb93510
|
||||
size 20425
|
0
install.sh → misc/system-install.sh
Executable file → Normal file
@ -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 ru.themixray.bRAC.png /usr/share/pixmaps
|
||||
rm -f ru.themixray.bRAC.desktop /usr/share/applications
|
||||
rm -f /usr/share/pixmaps/ru.themixray.bRAC.png
|
||||
rm -f /usr/share/applications/ru.themixray.bRAC.desktop
|
7
misc/user-install.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/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
|
3
misc/user-uninstall.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm -rf ~/.config/bRAC ~/.local/share/bRAC ~/.local/share/applications/ru.themixray.bRAC.desktop
|
Before Width: | Height: | Size: 30 KiB |
@ -26,8 +26,10 @@ 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};
|
||||
ctx::Context, on_send_message, parse_message, print_message, recv_tick, sanitize_message, SERVER_LIST};
|
||||
|
||||
struct UiModel {
|
||||
chat_box: GtkBox,
|
||||
@ -408,7 +410,7 @@ fn build_ui(ctx: Arc<Context>, app: &Application) -> UiModel {
|
||||
|
||||
let server_list = ListBox::new();
|
||||
|
||||
for url in ["rac://meex.lol", "rac://meex.lol:11234", "rac://91.192.22.20"] {
|
||||
for url in SERVER_LIST.iter() {
|
||||
let url = url.to_string();
|
||||
|
||||
let label = Label::builder()
|
||||
@ -422,7 +424,11 @@ fn build_ui(ctx: Arc<Context>, app: &Application) -> UiModel {
|
||||
#[weak] ctx,
|
||||
move |_, _, _, _| {
|
||||
let mut config = ctx.config.read().unwrap().clone();
|
||||
config.host = url.clone();
|
||||
if let Some((_, ssl, wrac)) = parse_rac_url(&url) {
|
||||
config.host = url.clone();
|
||||
config.wrac_enabled = wrac;
|
||||
config.ssl_enabled = ssl;
|
||||
}
|
||||
ctx.set_config(&config);
|
||||
save_config(get_config_path(), &config);
|
||||
}
|
||||
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 130 B |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 130 B |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 130 B |
@ -15,6 +15,14 @@ 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();
|
||||
@ -28,6 +36,12 @@ 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()
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -35,15 +49,6 @@ 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, "");
|
||||
|