Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
0955c6d6
Commit
0955c6d6
authored
5 years ago
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Kobo
parent
cd9bb56d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
213 additions
and
31 deletions
+213
-31
kobo.py
cps/kobo.py
+191
-29
reverseproxy.py
cps/reverseproxy.py
+7
-0
server.py
cps/server.py
+1
-1
config_edit.html
cps/templates/config_edit.html
+12
-0
ub.py
cps/ub.py
+2
-1
No files found.
cps/kobo.py
View file @
0955c6d6
This diff is collapsed.
Click to expand it.
cps/reverseproxy.py
View file @
0955c6d6
...
...
@@ -60,10 +60,13 @@ class ReverseProxied(object):
def
__init__
(
self
,
application
):
self
.
app
=
application
self
.
proxied
=
False
def
__call__
(
self
,
environ
,
start_response
):
self
.
proxied
=
False
script_name
=
environ
.
get
(
'HTTP_X_SCRIPT_NAME'
,
''
)
if
script_name
:
self
.
proxied
=
True
environ
[
'SCRIPT_NAME'
]
=
script_name
path_info
=
environ
.
get
(
'PATH_INFO'
,
''
)
if
path_info
and
path_info
.
startswith
(
script_name
):
...
...
@@ -76,3 +79,7 @@ class ReverseProxied(object):
if
servr
:
environ
[
'HTTP_HOST'
]
=
servr
return
self
.
app
(
environ
,
start_response
)
@
property
def
is_proxied
(
self
):
return
self
.
proxied
This diff is collapsed.
Click to expand it.
cps/server.py
View file @
0955c6d6
...
...
@@ -24,7 +24,7 @@ import signal
import
socket
try
:
from
gevent.pywsgi
import
WSGIServer
from
gevent.py
l
wsgi
import
WSGIServer
from
gevent.pool
import
Pool
from
gevent
import
__version__
as
_version
VERSION
=
'Gevent '
+
_version
...
...
This diff is collapsed.
Click to expand it.
cps/templates/config_edit.html
View file @
0955c6d6
...
...
@@ -169,6 +169,18 @@
<input
type=
"checkbox"
id=
"config_remote_login"
name=
"config_remote_login"
{%
if
config
.
config_remote_login
%}
checked
{%
endif
%}
>
<label
for=
"config_remote_login"
>
{{_('Enable remote login ("magic link")')}}
</label>
</div>
{% if feature_support['kobo'] %}
<div
class=
"form-group"
>
<input
type=
"checkbox"
id=
"config_kobo_sync"
name=
"config_kobo_sync"
data-control=
"kobo-settings"
{%
if
config
.
config_kobo_sync
%}
checked
{%
endif
%}
>
<label
for=
"config_kobo_sync"
>
{{_('Enable Kobo sync')}}
</label>
</div>
<div
data-related=
"kobo-settings"
>
<div
class=
"form-group"
>
<input
type=
"checkbox"
id=
"config_kobo_proxy"
name=
"config_kobo_proxy"
{%
if
config
.
config_kobo_proxy
%}
checked
{%
endif
%}
>
<label
for=
"config_kobo_proxy"
>
{{_('Proxy unknown requests to Kobo Store')}}
</label>
</div>
</div>
{% endif %}
{% if feature_support['goodreads'] %}
<div
class=
"form-group"
>
<input
type=
"checkbox"
id=
"config_use_goodreads"
name=
"config_use_goodreads"
data-control=
"goodreads-settings"
{%
if
config
.
config_use_goodreads
%}
checked
{%
endif
%}
>
...
...
This diff is collapsed.
Click to expand it.
cps/ub.py
View file @
0955c6d6
...
...
@@ -464,7 +464,8 @@ def migrate_Database(session):
def
clean_database
(
session
):
# Remove expired remote login tokens
now
=
datetime
.
datetime
.
now
()
session
.
query
(
RemoteAuthToken
)
.
filter
(
now
>
RemoteAuthToken
.
expiration
)
.
delete
()
session
.
query
(
RemoteAuthToken
)
.
filter
(
now
>
RemoteAuthToken
.
expiration
)
.
\
filter
(
RemoteAuthToken
.
token_type
!=
1
)
.
delete
()
session
.
commit
()
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment