move configurables to config
This commit is contained in:
parent
c4e8bc61b6
commit
8304f4c645
5 changed files with 5 additions and 7 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,5 +1,5 @@
|
|||
target
|
||||
**/*.rs.bk
|
||||
*.ron
|
||||
**/*.ron
|
||||
.vscode/
|
||||
!endstat_conf.example.ron
|
||||
!**/endstat_conf.example.ron
|
||||
|
|
|
@ -19,9 +19,7 @@ RUN apt update && apt upgrade -y && apt install -y libssl1.1 ca-certificates
|
|||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/target/release/endstat /app
|
||||
COPY ./endstat_conf.example.ron /app/endstat_conf.ron
|
||||
COPY templates templates
|
||||
|
||||
COPY ./config /app/config
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["/app/endstat"]
|
||||
|
|
|
@ -34,7 +34,7 @@ pub type State = Arc<RwLock<QueryResults>>;
|
|||
fn main() {
|
||||
System::run(move || {
|
||||
let conf_file_loc =
|
||||
var("ENDSTAT_CONF").unwrap_or_else(|_| String::from("./endstat_conf.ron"));
|
||||
var("ENDSTAT_CONF").unwrap_or_else(|_| String::from("./config/endstat_conf.ron"));
|
||||
let config = from_str::<Config>(
|
||||
&read_to_string(&conf_file_loc).expect(&format!("finding {}", conf_file_loc)),
|
||||
)
|
||||
|
@ -54,7 +54,7 @@ fn main() {
|
|||
let clone_state = Arc::clone(&state);
|
||||
|
||||
HttpServer::new(move || {
|
||||
let tera = compile_templates!("./templates/**/*");
|
||||
let tera = compile_templates!("./config/templates/**/*");
|
||||
let state = Arc::clone(&state);
|
||||
|
||||
App::new()
|
||||
|
|
Loading…
Reference in a new issue