Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chiefs
ChiefSend
Commits
b520edb1
Commit
b520edb1
authored
Jan 01, 2021
by
contabo-server
Browse files
fixed sercure filename in models
parent
e4d3ecbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/models.py
View file @
b520edb1
...
...
@@ -51,9 +51,9 @@ class Attachment(db.Model):
return
f
'<Attachment
{
self
.
id
}
,
{
self
.
filename
}
for Share
{
self
.
share_id
}
>'
def
__init__
(
self
,
share_id
,
file
):
self
.
share_id
=
share_id
from
werkzeug.utils
import
secure_filename
fn
=
secure_filename
(
filename
=
file
.
filename
)
self
.
share_id
=
share_id
self
.
filename
=
fn
# save file
from
werkzeug.utils
import
secure_filename
file
.
save
(
os
.
path
.
join
(
current_app
.
config
[
'MEDIA_LOCATION'
],
share_id
,
fn
))
app/routes.py
View file @
b520edb1
...
...
@@ -68,7 +68,7 @@ def public():
return
render_template
(
'Public.html'
,
shares
=
shares
)
@
app
.
route
(
'/'
)
@
app
.
route
(
'/'
,
methods
=
[
'GET'
,
'POST'
]
)
@
app
.
route
(
'/upload'
,
methods
=
[
'GET'
,
'POST'
])
def
upload
():
form
=
UploadForm
()
...
...
services/chiefsend-web.service
View file @
b520edb1
...
...
@@ -4,7 +4,7 @@ Description=Chiefsend Web Service gunicorn Worker
[Service]
Type
=
simple
WorkingDirectory
=
/home/chief/chiefsend
ExecStart
=
/home/chief/chiefsend/venv/bin/gunicorn -b :5000 --workers=3
--log-level=DEBUG
--access-logfile /home/chief/chiefsend/log.txt --error-logfile /home/chief/chiefsend/errlog.txt chiefsend:app
ExecStart
=
/home/chief/chiefsend/venv/bin/gunicorn -b :5000 --workers=3 --access-logfile /home/chief/chiefsend/log.txt --error-logfile /home/chief/chiefsend/errlog.txt chiefsend:app
--timeout 200
Restart
=
on-failure
[Install]
...
...
Write
Preview
Supports
Markdown
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