diff --git a/CHANGELOG.md b/CHANGELOG.md index 86e4c09..194e61c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.0] - 2024-12-10 + +### Added + +- pod container creation by @kulak + +### Changed + +- fail to start will log error on stderr in this case when book dir was not found. + ## [1.2.0] - 2024-06-18 ### Added diff --git a/main.go b/main.go index 453e9cb..369d0b0 100644 --- a/main.go +++ b/main.go @@ -23,6 +23,7 @@ import ( "io" "log" "net/http" + "os" "path/filepath" "github.com/dubyte/dir2opds/internal/service" @@ -46,19 +47,19 @@ func main() { log.SetOutput(io.Discard) } - fmt.Println(startValues()) - var err error - // Use the absoluteCanonical path of the dir parm as the trustedRoot. // helpfull avoid http trasversal. https://github.com/dubyte/dir2opds/issues/17 - *dirRoot, err = absoluteCanonicalPath(*dirRoot) + absolutePath, err := absoluteCanonicalPath(*dirRoot) if err != nil { - log.Fatal(err) + fmt.Fprintf(os.Stderr, "%s\n", err) + os.Exit(1) } - log.Printf("%q will be used as your trusted root", *dirRoot) + log.Printf("%q will be used as your trusted root", absolutePath) + + fmt.Println(startValues()) - s := service.OPDS{TrustedRoot: *dirRoot, HideCalibreFiles: *calibre, HideDotFiles: *hideDotFiles, NoCache: *noCache} + s := service.OPDS{TrustedRoot: absolutePath, HideCalibreFiles: *calibre, HideDotFiles: *hideDotFiles, NoCache: *noCache} http.HandleFunc("/", errorHandler(s.Handler))