Skip to content

Commit

Permalink
Removed backward compatibility changes
Browse files Browse the repository at this point in the history
  • Loading branch information
svera committed Jun 4, 2024
1 parent 68c198e commit 6abb29a
Show file tree
Hide file tree
Showing 48 changed files with 101 additions and 151 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A personal documents server, Coreander indexes the documents (EPUBs and PDFs wit
* Fast search engine powered by [Bleve](https://github.com/blevesearch/bleve), with support for documents in multiple languages.
* Search by author, title and even document series ([Calibre's](https://calibre-ebook.com/) `series` meta supported)
* Improved search for documents with metadata in english, spanish, french, italian, german and portuguese, including genre and singular/plural forms of words in the results among others.
* Estimated reading time calculation.
* Estimated reading time calculation.
* High-performance web server powered by [Fiber](https://github.com/gofiber/fiber).
* Lightweight, responsive web interface based on [Bootstrap](https://getbootstrap.com/).
* Web interface available in english, spanish and french, more languages can be easily added.
Expand Down Expand Up @@ -56,7 +56,7 @@ Coreander requires a `LIB_PATH` environment variable to be set, which tells the
On first run, Coreander will index the documents in your library, creating a database with those entries located at `$home/coreander/index`. Depending on your system's performance and the size of your library this may take a while. Also, the database can grow fairly big, so make sure you have enough free space on disk.

Every time is run, the application check for new entries, reindexing the whole library. You can
avoid this behaviour by setting the environment variable `SKIP_INDEXING` to `true`.
avoid this behavior by setting the environment variable `SKIP_INDEXING` to `true`.

Even if the application is still indexing entries, you can access its web interface right away. Just open a web browser and go to `localhost:3000` (replace `localhost` with the hostname / IP address of the machine where the server is running if you want to access it from another system). It is possible to change the listening port just executing the application with the `PORT` environment variable (e. g. `PORT=4000 coreander`)

Expand Down Expand Up @@ -109,5 +109,4 @@ On first run, Coreander creates an admin user with the following credentials:
* `SESSION_TIMEOUT`: Specifies the maximum time a user session may last, in hours. Floating-point values are allowed. Defaults to 24 hours.
* `RECOVERY_TIMEOUT`: Specifies the maximum time a user recovery link may last, in hours. Floating-point values are allowed. Defaults to 2 hours.
* `UPLOAD_DOCUMENT_MAX_SIZE`: Maximum document size allowed to be uploaded to the library, in megabytes. Set this to 0 to unlimit upload size. Defaults to 20 megabytes.
* `HOSTNAME`: **Deprecated, use FQDN instead**.
* `FQDN`: Domain name of the server. If Coreander is listening to a non-standard HTTP / HTTPS port, include it using a colon (e. g. example.com:3000). Defaults to `localhost`.
2 changes: 0 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ package main
type Config struct {
// LibPath holds the absolute path to the folder containing the documents
LibPath string `env:"LIB_PATH" env-required:"true"`
// Deprecated. Use FQDN instead
Hostname string `env:"HOSTNAME" env-default:"localhost"`
// FQDN stores the domain name of the server. If the server is listening on a non-standard HTTP / HTTPS port, include it using a colon (e. g. :3000)
FQDN string `env:"FQDN" env-default:"localhost"`
// Port defines the port number in which the webserver listens for requests
Expand Down
2 changes: 1 addition & 1 deletion filewatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package main

import (
"github.com/svera/coreander/v3/internal/index"
"github.com/svera/coreander/v4/internal/index"
)

func fileWatcher(idx *index.BleveIndexer, libPath string) {
Expand Down
2 changes: 1 addition & 1 deletion filewatcher_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"log"

"github.com/rjeczalik/notify"
"github.com/svera/coreander/v3/internal/index"
"github.com/svera/coreander/v4/internal/index"
)

func fileWatcher(idx *index.BleveIndexer, libPath string) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/svera/coreander/v3
module github.com/svera/coreander/v4

go 1.21

Expand Down
2 changes: 1 addition & 1 deletion internal/index/bleve.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/blevesearch/bleve/v2/analysis/tokenizer/unicode"
"github.com/blevesearch/bleve/v2/mapping"
"github.com/spf13/afero"
"github.com/svera/coreander/v3/internal/metadata"
"github.com/svera/coreander/v4/internal/metadata"
)

// Version identifies the mapping used for indexing. Any changes in the mapping requires an increase
Expand Down
4 changes: 2 additions & 2 deletions internal/index/bleve_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/blevesearch/bleve/v2/search/query"
"github.com/gosimple/slug"
"github.com/spf13/afero"
"github.com/svera/coreander/v3/internal/metadata"
"github.com/svera/coreander/v3/internal/result"
"github.com/svera/coreander/v4/internal/metadata"
"github.com/svera/coreander/v4/internal/result"
)

func (b *BleveIndexer) IndexingProgress() (Progress, error) {
Expand Down
8 changes: 4 additions & 4 deletions internal/index/bleve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (

"github.com/blevesearch/bleve/v2"
"github.com/spf13/afero"
"github.com/svera/coreander/v3/internal/index"
"github.com/svera/coreander/v3/internal/metadata"
"github.com/svera/coreander/v3/internal/result"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/index"
"github.com/svera/coreander/v4/internal/metadata"
"github.com/svera/coreander/v4/internal/result"
"github.com/svera/coreander/v4/internal/webserver/model"
)

func TestIndexAndSearch(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/index/bleve_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/gosimple/slug"
"github.com/spf13/afero"
"github.com/svera/coreander/v3/internal/metadata"
"github.com/svera/coreander/v4/internal/metadata"
)

// AddFile adds a file to the index
Expand Down
2 changes: 1 addition & 1 deletion internal/index/document.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package index

import "github.com/svera/coreander/v3/internal/metadata"
import "github.com/svera/coreander/v4/internal/metadata"

type Document struct {
metadata.Metadata
Expand Down
6 changes: 3 additions & 3 deletions internal/webserver/authentication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/PuerkitoBio/goquery"
"github.com/gofiber/fiber/v2"
"github.com/spf13/afero"
"github.com/svera/coreander/v3/internal/webserver"
"github.com/svera/coreander/v3/internal/webserver/infrastructure"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver"
"github.com/svera/coreander/v4/internal/webserver/infrastructure"
"github.com/svera/coreander/v4/internal/webserver/model"
"gorm.io/gorm"
)

Expand Down
14 changes: 7 additions & 7 deletions internal/webserver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package webserver

import (
"github.com/spf13/afero"
"github.com/svera/coreander/v3/internal/index"
"github.com/svera/coreander/v3/internal/metadata"
"github.com/svera/coreander/v3/internal/webserver/controller/auth"
"github.com/svera/coreander/v3/internal/webserver/controller/document"
"github.com/svera/coreander/v3/internal/webserver/controller/highlight"
"github.com/svera/coreander/v3/internal/webserver/controller/user"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/index"
"github.com/svera/coreander/v4/internal/metadata"
"github.com/svera/coreander/v4/internal/webserver/controller/auth"
"github.com/svera/coreander/v4/internal/webserver/controller/document"
"github.com/svera/coreander/v4/internal/webserver/controller/highlight"
"github.com/svera/coreander/v4/internal/webserver/controller/user"
"github.com/svera/coreander/v4/internal/webserver/model"
"gorm.io/gorm"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/controller/auth/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package auth
import (
"time"

"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/model"
"golang.org/x/text/message"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/controller/auth/recover.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package auth

import (
"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver/infrastructure"
"github.com/svera/coreander/v4/internal/webserver/infrastructure"
)

func (a *Controller) Recover(c *fiber.Ctx) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/controller/auth/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/gofiber/fiber/v2"
"github.com/google/uuid"
"github.com/svera/coreander/v3/internal/webserver/infrastructure"
"github.com/svera/coreander/v4/internal/webserver/infrastructure"
)

func (a *Controller) Request(c *fiber.Ctx) error {
Expand Down
4 changes: 2 additions & 2 deletions internal/webserver/controller/auth/reset-password.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"time"

"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver/infrastructure"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/infrastructure"
"github.com/svera/coreander/v4/internal/webserver/model"
)

func (a *Controller) EditPassword(c *fiber.Ctx) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/controller/auth/signin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/gofiber/fiber/v2"
"github.com/golang-jwt/jwt/v4"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/model"
)

// Signs in a user and gives them a JWT.
Expand Down
6 changes: 3 additions & 3 deletions internal/webserver/controller/document/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package document

import (
"github.com/spf13/afero"
"github.com/svera/coreander/v3/internal/index"
"github.com/svera/coreander/v3/internal/metadata"
"github.com/svera/coreander/v3/internal/result"
"github.com/svera/coreander/v4/internal/index"
"github.com/svera/coreander/v4/internal/metadata"
"github.com/svera/coreander/v4/internal/result"
)

const relatedDocuments = 4
Expand Down
4 changes: 2 additions & 2 deletions internal/webserver/controller/document/detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"

"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver/infrastructure"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/infrastructure"
"github.com/svera/coreander/v4/internal/webserver/model"
)

func (d *Controller) Detail(c *fiber.Ctx) error {
Expand Down
10 changes: 5 additions & 5 deletions internal/webserver/controller/document/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"strconv"

"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/index"
"github.com/svera/coreander/v3/internal/result"
"github.com/svera/coreander/v3/internal/webserver/infrastructure"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v3/internal/webserver/view"
"github.com/svera/coreander/v4/internal/index"
"github.com/svera/coreander/v4/internal/result"
"github.com/svera/coreander/v4/internal/webserver/infrastructure"
"github.com/svera/coreander/v4/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/view"
)

func (d *Controller) Search(c *fiber.Ctx) error {
Expand Down
6 changes: 3 additions & 3 deletions internal/webserver/controller/highlight/controller.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package highlight

import (
"github.com/svera/coreander/v3/internal/index"
"github.com/svera/coreander/v3/internal/result"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/index"
"github.com/svera/coreander/v4/internal/result"
"github.com/svera/coreander/v4/internal/webserver/model"
)

type highlightsRepository interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/controller/highlight/highlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package highlight

import (
"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/model"
)

func (h *Controller) Highlight(c *fiber.Ctx) error {
Expand Down
10 changes: 5 additions & 5 deletions internal/webserver/controller/highlight/highlights.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"strconv"

"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/index"
"github.com/svera/coreander/v3/internal/result"
"github.com/svera/coreander/v3/internal/webserver/infrastructure"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v3/internal/webserver/view"
"github.com/svera/coreander/v4/internal/index"
"github.com/svera/coreander/v4/internal/result"
"github.com/svera/coreander/v4/internal/webserver/infrastructure"
"github.com/svera/coreander/v4/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/view"
)

func (h *Controller) Highlights(c *fiber.Ctx) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/controller/highlight/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package highlight

import (
"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/model"
)

func (h *Controller) Remove(c *fiber.Ctx) error {
Expand Down
4 changes: 2 additions & 2 deletions internal/webserver/controller/user/controller.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package user

import (
"github.com/svera/coreander/v3/internal/result"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/result"
"github.com/svera/coreander/v4/internal/webserver/model"
)

type usersRepository interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/controller/user/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/gofiber/fiber/v2"
"github.com/google/uuid"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/model"
)

// Create gathers information coming from the new user form and creates a new user
Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/controller/user/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package user

import (
"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/model"
)

// Delete removes a user from the database
Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/controller/user/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/model"
)

// Edit renders the edit user form
Expand Down
4 changes: 2 additions & 2 deletions internal/webserver/controller/user/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"strconv"

"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v3/internal/webserver/view"
"github.com/svera/coreander/v4/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/view"
)

// List list all users registered in the database
Expand Down
2 changes: 1 addition & 1 deletion internal/webserver/controller/user/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package user

import (
"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/model"
)

// New renders the new user form
Expand Down
4 changes: 2 additions & 2 deletions internal/webserver/controller/user/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"time"

"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver/controller/auth"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver/controller/auth"
"github.com/svera/coreander/v4/internal/webserver/model"
)

// Update gathers information from the edit user form and updates user data
Expand Down
4 changes: 2 additions & 2 deletions internal/webserver/document_detail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"

"github.com/spf13/afero"
"github.com/svera/coreander/v3/internal/webserver"
"github.com/svera/coreander/v3/internal/webserver/infrastructure"
"github.com/svera/coreander/v4/internal/webserver"
"github.com/svera/coreander/v4/internal/webserver/infrastructure"
)

func TestDocumentAndRead(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/webserver/highlights_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

"github.com/PuerkitoBio/goquery"
"github.com/gofiber/fiber/v2"
"github.com/svera/coreander/v3/internal/webserver"
"github.com/svera/coreander/v3/internal/webserver/infrastructure"
"github.com/svera/coreander/v3/internal/webserver/model"
"github.com/svera/coreander/v4/internal/webserver"
"github.com/svera/coreander/v4/internal/webserver/infrastructure"
"github.com/svera/coreander/v4/internal/webserver/model"
"gorm.io/gorm"
)

Expand Down
Loading

0 comments on commit 6abb29a

Please sign in to comment.