remove the commit display feature as it is more hassle than benefit
This commit is contained in:
parent
3ba86697b7
commit
7a0b197dc6
|
@ -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:
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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<T: Into<String>, O: From<String>>(name: T) -> Result<O, String> {
|
||||
|
@ -60,8 +57,7 @@ pub fn loadenv() -> Result<Env, Box<dyn std::error::Error>> {
|
|||
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()
|
||||
}
|
||||
}
|
|
@ -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<Extract = impl Reply, Error = R
|
|||
pages::get_routes(state.clone())
|
||||
.or(forms::get_routes(state.clone()))
|
||||
.or(api::get_routes(state))
|
||||
.or(static_dir!("static"))
|
||||
.or(warp::fs::dir(staticpath.to_string()))
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
bleK! File {{ env.shortcommit() }}
|
||||
Made with Rust
|
||||
</td>
|
||||
<td>
|
||||
Released under GPLv3
|
||||
|
|
Loading…
Reference in New Issue