Compare commits
4 Commits
e7a0891bbb
...
94ae341bf6
Author | SHA1 | Date |
---|---|---|
b1ek | 94ae341bf6 | |
b1ek | d782352363 | |
b1ek | eca32f0507 | |
b1ek | e7230f0ec9 |
|
@ -1,2 +1,2 @@
|
||||||
target
|
target
|
||||||
/secret.key
|
secret.key
|
||||||
|
|
|
@ -12,9 +12,10 @@ 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. Put your server URL in `client/src/main.rs` on 4th line.
|
3. Copy it to the directories using `key-copy.sh`
|
||||||
4. Install the client binary on your PC or laptop and set up a cron job to execute it once a minute.
|
4. Put your server URL in `client/src/main.rs` on 4th line.
|
||||||
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.
|
5. Install the client binary on your PC or laptop and set up a cron job to execute it once a minute.
|
||||||
|
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 +0,0 @@
|
||||||
../../secret.key
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/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
|
|
@ -0,0 +1,2 @@
|
||||||
|
Dockerfile
|
||||||
|
docker-compose.yml
|
|
@ -0,0 +1,15 @@
|
||||||
|
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" ]
|
|
@ -0,0 +1,10 @@
|
||||||
|
version: '3.8'
|
||||||
|
services:
|
||||||
|
server:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- 8000:80 # expose to "8000"
|
||||||
|
|
|
@ -93,6 +93,7 @@ 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 +0,0 @@
|
||||||
../../secret.key
|
|
Loading…
Reference in New Issue