Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"io"
"log"
"net/http"
"os"
"path/filepath"

"github.com/dubyte/dir2opds/internal/service"
Expand All @@ -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))

Expand Down
Loading