Compare commits

...

4 Commits

Author SHA1 Message Date
Alex Ling
9255de710f Link to Wiki in README 2020-06-09 15:12:23 +00:00
Alex Ling
39b251774f Bump version to v0.6.1 [skip ci] 2020-06-09 15:08:15 +00:00
Alex Ling
156e511d4a Fix failed build (omitted parentheses) 2020-06-09 14:54:23 +00:00
Alex Ling
5cd6f3eacb Fix incorrect login redirect (#64) 2020-06-09 14:46:45 +00:00
6 changed files with 15 additions and 7 deletions

View File

@@ -16,6 +16,8 @@ Mango is a self-hosted manga server and reader. Its features include
- The web reader is responsive and works well on mobile, so there is no need for a mobile app
- All the static files are embedded in the binary, so the deployment process is easy and painless
Please check the [Wiki](https://github.com/hkalexling/Mango/wiki) for more information.
## Installation
### Pre-built Binary
@@ -48,7 +50,7 @@ The official docker images are available on [Dockerhub](https://hub.docker.com/r
### CLI
```
Mango - Manga Server and Web Reader. Version 0.6.0
Mango - Manga Server and Web Reader. Version 0.6.1
Usage:

View File

@@ -1,5 +1,5 @@
name: mango
version: 0.6.0
version: 0.6.1
authors:
- Alex Ling <hkalexling@gmail.com>

View File

@@ -63,7 +63,10 @@ class AuthHandler < Kemal::Handler
end
def handle_auth(env)
return call_next(env) if request_path_startswith env, ["/login", "/logout"]
if request_path_startswith(env, ["/login", "/logout"]) ||
requesting_static_file env
return call_next(env)
end
unless validate_token env
env.session.string "callback", env.request.path

View File

@@ -16,10 +16,8 @@ class FS
end
class StaticHandler < Kemal::Handler
@dirs = ["/css", "/js", "/img", "/favicon.ico"]
def call(env)
if request_path_startswith env, @dirs
if requesting_static_file env
file = FS.get? env.request.path
return call_next env if file.nil?

View File

@@ -4,7 +4,7 @@ require "./mangadex/*"
require "option_parser"
require "clim"
MANGO_VERSION = "0.6.0"
MANGO_VERSION = "0.6.1"
macro common_option
option "-c PATH", "--config=PATH", type: String,

View File

@@ -2,6 +2,11 @@ require "big"
IMGS_PER_PAGE = 5
UPLOAD_URL_PREFIX = "/uploads"
STATIC_DIRS = ["/css", "/js", "/img", "/favicon.ico"]
def requesting_static_file(env)
request_path_startswith env, STATIC_DIRS
end
macro layout(name)
base_url = Config.current.base_url