diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 36f54d8..8dd1cd4 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -8,7 +8,6 @@ services: bfile: volumes: - './filed:/opt/code' - - './.git:/opt/code/.git:ro' # for fetching the latest commit version - '/opt/code/target' - './volatile/files:/opt/user_uploads' caddy: diff --git a/filed/Dockerfile.dev b/filed/Dockerfile.dev index 7dd3561..995c30c 100644 --- a/filed/Dockerfile.dev +++ b/filed/Dockerfile.dev @@ -4,8 +4,6 @@ FROM rust as builder WORKDIR /opt/code COPY . . -RUN apt install -y git - # No build is done during this step # since the directory will be mounted anyways # to the dev's machine. diff --git a/filed/src/env.rs b/filed/src/env.rs index 31d2fd2..9512891 100644 --- a/filed/src/env.rs +++ b/filed/src/env.rs @@ -7,8 +7,6 @@ use std::{env::var, net::SocketAddr, path::Path, fs}; use compile_time_run::run_command_str; -const LAST_COMMIT: &'static str = run_command_str!("git", "--no-pager", "log", "--pretty=format:%H", "-1"); - #[derive(Debug, Clone)] pub struct Redis { pub pass: String, @@ -24,8 +22,7 @@ pub struct Env { pub redis: Redis, pub filedir: String, pub instanceurl: String, - pub uploadspath: String, - pub last_commit: &'static str + pub uploadspath: String } fn get_var, O: From>(name: T) -> Result { @@ -60,8 +57,7 @@ pub fn loadenv() -> Result> { spath }, instanceurl: get_var("INSTANCE_URL")?, - uploadspath: get_var("UPLOADS_PATH")?, - last_commit: LAST_COMMIT + uploadspath: get_var("UPLOADS_PATH")? } ) } @@ -70,8 +66,4 @@ impl Env { pub fn usercontent_dir(self: &Self) -> Box<&Path> { Box::new(Path::new(&self.filedir)) } - pub fn shortcommit(self: &Self) -> String { - let commit = self.last_commit.to_string().clone(); - commit.chars().take(6).collect() - } } \ No newline at end of file diff --git a/filed/src/web/mod.rs b/filed/src/web/mod.rs index ef45ce9..f4eaeb8 100644 --- a/filed/src/web/mod.rs +++ b/filed/src/web/mod.rs @@ -4,6 +4,7 @@ use std::env::current_dir; +use static_dir::static_dir; use warp::{Filter, reply::Reply, reject::Rejection}; use crate::{env::Env, files::lookup::FileManager}; @@ -23,6 +24,7 @@ pub fn routes(state: SharedState) -> impl Filter - bleK! File {{ env.shortcommit() }} + Made with Rust Released under GPLv3