mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-25 00:00:52 -04: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
|
- 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
|
- 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
|
## Installation
|
||||||
|
|
||||||
### Pre-built Binary
|
### Pre-built Binary
|
||||||
@@ -48,7 +50,7 @@ The official docker images are available on [Dockerhub](https://hub.docker.com/r
|
|||||||
### CLI
|
### CLI
|
||||||
|
|
||||||
```
|
```
|
||||||
Mango - Manga Server and Web Reader. Version 0.6.0
|
Mango - Manga Server and Web Reader. Version 0.6.1
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: mango
|
name: mango
|
||||||
version: 0.6.0
|
version: 0.6.1
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- Alex Ling <hkalexling@gmail.com>
|
- Alex Ling <hkalexling@gmail.com>
|
||||||
|
|||||||
@@ -63,7 +63,10 @@ class AuthHandler < Kemal::Handler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def handle_auth(env)
|
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
|
unless validate_token env
|
||||||
env.session.string "callback", env.request.path
|
env.session.string "callback", env.request.path
|
||||||
|
|||||||
@@ -16,10 +16,8 @@ class FS
|
|||||||
end
|
end
|
||||||
|
|
||||||
class StaticHandler < Kemal::Handler
|
class StaticHandler < Kemal::Handler
|
||||||
@dirs = ["/css", "/js", "/img", "/favicon.ico"]
|
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
if request_path_startswith env, @dirs
|
if requesting_static_file env
|
||||||
file = FS.get? env.request.path
|
file = FS.get? env.request.path
|
||||||
return call_next env if file.nil?
|
return call_next env if file.nil?
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ require "./mangadex/*"
|
|||||||
require "option_parser"
|
require "option_parser"
|
||||||
require "clim"
|
require "clim"
|
||||||
|
|
||||||
MANGO_VERSION = "0.6.0"
|
MANGO_VERSION = "0.6.1"
|
||||||
|
|
||||||
macro common_option
|
macro common_option
|
||||||
option "-c PATH", "--config=PATH", type: String,
|
option "-c PATH", "--config=PATH", type: String,
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ require "big"
|
|||||||
|
|
||||||
IMGS_PER_PAGE = 5
|
IMGS_PER_PAGE = 5
|
||||||
UPLOAD_URL_PREFIX = "/uploads"
|
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)
|
macro layout(name)
|
||||||
base_url = Config.current.base_url
|
base_url = Config.current.base_url
|
||||||
|
|||||||
Reference in New Issue
Block a user