Skip to content

Commit a028495

Browse files
committed
Update
1 parent bb77393 commit a028495

File tree

7 files changed

+51
-22
lines changed

7 files changed

+51
-22
lines changed

client/Cargo.lock

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/Cargo.toml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
[package]
2-
name = "cli-chat-client"
2+
name = "tchat"
33
version = "0.1.0"
4+
authors = ["Ivan Davydov [email protected]"]
5+
license = "MIT"
6+
description = "Client for tchat-server."
7+
readme = "README.md"
8+
homepage = "https://github.com/IDSaves/terminal-chat"
9+
repository = "https://github.com/IDSaves/terminal-chat"
10+
keywords = ["cli", "chat-client"]
11+
categories = ["command-line-utilities"]
412
edition = "2021"
513

614
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

client/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Client for tchat-server
2+
3+
## How to use?
4+
0. Install CLI (```cargo install tchat```)
5+
1. Learn options (```tchat -h```)
6+
2. Connect to a server (```tchat -a <address>```, Example server: ```tchat -a 31.172.76.176:9005```)

server/Cargo.lock

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "cli-chat-server"
2+
name = "tchat-server"
33
version = "0.1.0"
44
edition = "2021"
55

server/Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM rust:1.65.0 as build
2+
ENV PKG_CONFIG_ALLOW_CROSS=1
3+
4+
WORKDIR /usr/src/tchat-server
5+
COPY . .
6+
7+
RUN cargo install --path .
8+
9+
FROM gcr.io/distroless/cc-debian10
10+
11+
COPY --from=build /usr/local/cargo/bin/tchat-server /usr/local/bin/tchat-server
12+
13+
CMD ["tchat-server", "--port", "8080"]

server/src/service.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ pub struct Service;
88

99
impl Service {
1010
pub fn run(state: State) -> Result<()> {
11-
let listener = TcpListener::bind(format!("127.0.0.1:{}", state.get().settings.port))?;
11+
let listener = TcpListener::bind(format!("0.0.0.0:{}", state.get().settings.port))?;
12+
13+
println!("Running!");
1214

1315
let messages_pool = Arc::new(Mutex::new(MessagesPool::new()));
1416

0 commit comments

Comments
 (0)