Compare commits

..

No commits in common. "94ae341bf6d3ac08e821d2c8232f478d8e2f5a5b" and "e7a0891bbbd8325a3dc9e696eac8b43b736ce275" have entirely different histories.

9 changed files with 6 additions and 38 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
target target
secret.key /secret.key

View File

@ -12,10 +12,9 @@ If you do not meet the prerequisities, you are very unlikely to properly run thi
1. Clone the repo and cd to its directory 1. Clone the repo and cd to its directory
2. Generate a 1024 bytes long key: `head -c 1024 /dev/random > secret.key` 2. Generate a 1024 bytes long key: `head -c 1024 /dev/random > secret.key`
3. Copy it to the directories using `key-copy.sh` 3. Put your server URL in `client/src/main.rs` on 4th line.
4. Put your server URL in `client/src/main.rs` on 4th line. 4. Install the client binary on your PC or laptop and set up a cron job to execute it once a minute.
5. Install the client binary on your PC or laptop and set up a cron job to execute it once a minute. 5. Copy the `secret.key` to your server and `docker-compose up -d` it. Then pass it via the reverse proxy to whereever you want.
6. Copy the `secret.key` to your server and `docker-compose up -d` it. Then pass it via the reverse proxy to whereever you want.
## Embeding the gif ## Embeding the gif

1
client/src/secret.key Symbolic link
View File

@ -0,0 +1 @@
../../secret.key

View File

@ -1,5 +0,0 @@
#!/bin/sh
rm -fr server/src/secret.key client/src/secret.key
cp secret.key server/src/secret.key
cp secret.key client/src/secret.key

View File

@ -1,2 +0,0 @@
Dockerfile
docker-compose.yml

View File

@ -1,15 +0,0 @@
FROM rust:1.75-alpine3.18 as build
RUN apk add --no-cache musl-dev upx
WORKDIR /opt/build
COPY . .
RUN cargo install --path .
RUN strip /usr/local/cargo/bin/blek-online-server && upx /usr/local/cargo/bin/blek-online-server
FROM alpine:3.18
COPY --from=build /usr/local/cargo/bin/blek-online-server /usr/bin/blek-online-server
CMD [ "/usr/bin/blek-online-server" ]

View File

@ -1,10 +0,0 @@
version: '3.8'
services:
server:
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 8000:80 # expose to "8000"

View File

@ -93,7 +93,6 @@ fn gif(state: Arc<Mutex<State>>) -> impl Filter<Extract = impl Reply, Error = Re
async fn main() { async fn main() {
let state = Arc::new(Mutex::new(State::default())); let state = Arc::new(Mutex::new(State::default()));
println!("Listening on 0.0.0.0:80");
warp::serve( warp::serve(
beat(state.clone()) beat(state.clone())
.or(gif(state)) .or(gif(state))

1
server/src/secret.key Symbolic link
View File

@ -0,0 +1 @@
../../secret.key