Skip to content
GitLab
Explore
Sign in
Commits on Source (4)
Remove useless imports
· d049a5a7
Marco De Donno
authored
Sep 20, 2019
d049a5a7
Set the port as environment variable
· 4b80dc37
Marco De Donno
authored
Sep 20, 2019
4b80dc37
Use more clear number of pbkdf2 iterations in the config file
· 1245c9cf
Marco De Donno
authored
Sep 20, 2019
1245c9cf
Change the length of the salt for pbkdf2
· d9bc526d
Marco De Donno
authored
Sep 20, 2019
d9bc526d
Hide whitespace changes
Inline
Side-by-side
config.py
View file @
d9bc526d
...
@@ -13,15 +13,15 @@ SECRET_KEY = os.environ.get( "SECRET_KEY", utils.rand.random_data( 20 ) )
...
@@ -13,15 +13,15 @@ SECRET_KEY = os.environ.get( "SECRET_KEY", utils.rand.random_data( 20 ) )
MAX_CONTENT_LENGTH
=
500
*
1024
*
1024
MAX_CONTENT_LENGTH
=
500
*
1024
*
1024
EMAIL_NB_ITERATIONS
=
50000
EMAIL_NB_ITERATIONS
=
50
*
1
000
PASSWORD_NB_ITERATIONS
=
50000
PASSWORD_NB_ITERATIONS
=
50
*
1
000
DEK_NB_ITERATIONS
=
500000
DEK_NB_ITERATIONS
=
500
*
1
000
CF_NB_ITERATIONS
=
100000
CF_NB_ITERATIONS
=
100
*
1
000
EMAIL_SALT_LENGTH
=
65
EMAIL_SALT_LENGTH
=
20
PASSWORD_SALT_LENGTH
=
10
0
PASSWORD_SALT_LENGTH
=
2
0
DEK_SALT_LENGTH
=
10
0
DEK_SALT_LENGTH
=
2
0
DEK_CHECK_SALT_LENGTH
=
1
0
DEK_CHECK_SALT_LENGTH
=
2
0
SESSION_TYPE
=
"
redis
"
SESSION_TYPE
=
"
redis
"
SESSION_PERMANENT
=
False
SESSION_PERMANENT
=
False
...
...
dev.py
View file @
d9bc526d
...
@@ -10,9 +10,10 @@ debug = os.environ.get( "DEBUG", False ) in [ "True", "true", "1" ]
...
@@ -10,9 +10,10 @@ debug = os.environ.get( "DEBUG", False ) in [ "True", "true", "1" ]
KEY_FILE
=
"
./key.pem
"
KEY_FILE
=
"
./key.pem
"
CERT_FILE
=
"
./cert.pem
"
CERT_FILE
=
"
./cert.pem
"
port
=
os
.
environ
.
get
(
"
PORT
"
,
5000
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
if
os
.
path
.
isfile
(
CERT_FILE
)
and
os
.
path
.
isfile
(
KEY_FILE
):
if
os
.
path
.
isfile
(
CERT_FILE
)
and
os
.
path
.
isfile
(
KEY_FILE
):
app
.
run
(
debug
=
debug
,
host
=
"
0.0.0.0
"
,
threaded
=
True
,
ssl_context
=
(
CERT_FILE
,
KEY_FILE
)
)
app
.
run
(
debug
=
debug
,
host
=
"
0.0.0.0
"
,
port
=
port
,
threaded
=
True
,
ssl_context
=
(
CERT_FILE
,
KEY_FILE
)
)
else
:
else
:
app
.
run
(
debug
=
debug
,
host
=
"
0.0.0.0
"
,
threaded
=
True
)
app
.
run
(
debug
=
debug
,
host
=
"
0.0.0.0
"
,
port
=
port
,
threaded
=
True
)
module.py
View file @
d9bc526d
...
@@ -17,7 +17,7 @@ import json
...
@@ -17,7 +17,7 @@ import json
import
os
import
os
import
smtplib
import
smtplib
from
PIL
import
Image
,
ImageDraw
,
ImageFont
from
PIL
import
Image
from
flask
import
Flask
from
flask
import
Flask
from
flask
import
jsonify
from
flask
import
jsonify
from
flask
import
render_template
,
send_from_directory
from
flask
import
render_template
,
send_from_directory
...
...
runner.py
View file @
d9bc526d
...
@@ -14,9 +14,11 @@ ICNML_SSL = ICNML_SSL in [ "t", "T", True, "1" ]
...
@@ -14,9 +14,11 @@ ICNML_SSL = ICNML_SSL in [ "t", "T", True, "1" ]
KEY_FILE
=
"
/tmp/key.pem
"
KEY_FILE
=
"
/tmp/key.pem
"
CERT_FILE
=
"
/tmp/cert.pem
"
CERT_FILE
=
"
/tmp/cert.pem
"
port
=
os
.
environ
.
get
(
"
PORT
"
,
5000
)
if
ICNML_SSL
and
os
.
path
.
isfile
(
KEY_FILE
)
and
os
.
path
.
isfile
(
CERT_FILE
):
if
ICNML_SSL
and
os
.
path
.
isfile
(
KEY_FILE
)
and
os
.
path
.
isfile
(
CERT_FILE
):
http_server
=
WSGIServer
(
(
"
0.0.0.0
"
,
5000
),
app
,
keyfile
=
KEY_FILE
,
certfile
=
CERT_FILE
,
log
=
logging
.
getLogger
()
)
http_server
=
WSGIServer
(
(
"
0.0.0.0
"
,
port
),
app
,
keyfile
=
KEY_FILE
,
certfile
=
CERT_FILE
,
log
=
logging
.
getLogger
()
)
else
:
else
:
http_server
=
WSGIServer
(
(
"
0.0.0.0
"
,
5000
),
app
,
log
=
logging
.
getLogger
()
)
http_server
=
WSGIServer
(
(
"
0.0.0.0
"
,
port
),
app
,
log
=
logging
.
getLogger
()
)
http_server
.
serve_forever
()
http_server
.
serve_forever
()