Compare commits

..

4 Commits

Author SHA1 Message Date
b1ek 94ae341bf6
remove useless files 2024-01-07 12:35:06 +10:00
b1ek d782352363
docker stuff 2024-01-07 12:30:43 +10:00
b1ek eca32f0507
key copy script 2024-01-07 12:30:36 +10:00
b1ek e7230f0ec9
add a log message 2024-01-07 12:28:36 +10:00
9 changed files with 38 additions and 6 deletions

2
.gitignore vendored
View File

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

View File

@ -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
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.
4. 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.
3. Copy it to the directories using `key-copy.sh`
4. Put your server URL in `client/src/main.rs` on 4th line.
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

View File

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

5
key-copy.sh Executable file
View File

@ -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

2
server/.dockerignore Normal file
View File

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

15
server/Dockerfile Normal file
View File

@ -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" ]

10
server/docker-compose.yml Normal file
View File

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

View File

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

View File

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