mirror of
https://github.com/hkalexling/Mango.git
synced 2026-01-24 00:03:14 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9255de710f | ||
|
|
39b251774f | ||
|
|
156e511d4a | ||
|
|
5cd6f3eacb |
@@ -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:
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: mango
|
||||
version: 0.6.0
|
||||
version: 0.6.1
|
||||
|
||||
authors:
|
||||
- Alex Ling <hkalexling@gmail.com>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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?
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user