Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QuadFile
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Volkor Barbarian Warrior
QuadFile
Commits
e2e9c7c8
Unverified
Commit
e2e9c7c8
authored
3 years ago
by
Volkor Barbarian Warrior
Browse files
Options
Downloads
Patches
Plain Diff
Allow files with no ext. (Fixes
#8
)
parent
24db1586
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ansible/templates/conf.py.tpl
+2
-1
2 additions, 1 deletion
ansible/templates/conf.py.tpl
conf.py.sample
+1
-0
1 addition, 0 deletions
conf.py.sample
run.py
+4
-1
4 additions, 1 deletion
run.py
with
7 additions
and
2 deletions
ansible/templates/conf.py.tpl
+
2
−
1
View file @
e2e9c7c8
...
...
@@ -34,6 +34,7 @@ config["ALLOW_ALL_FILES"] = False
config["ALLOWED_EXTENSIONS"] = set(['txt', 'pdf', 'bmp', 'png', 'jpg', 'jpeg', 'gif', 'webm', 'log', 'bin', 'webp', 'heif', 'mov', 'mkv', 'mp4', 'mp3', 'ogg', 'flac' ])
# Will use blacklist if this is enabled. You must disable ALLOW_ALL_FILES for this to take effect
## Note: Will always allow files with no extensions, as they /should/ be rendered as text.
config["BLACKLIST"] = True
config["BANNED_EXTENSIONS"] = set(['exe', 'msi', 'html', 'js', 'php'])
...
...
@@ -46,7 +47,7 @@ config["CLEAN_INTERVAL"] = 300
## MINDAYS is the minimum lifetime of the file. (The smaller the file, the closer to MAXDAYS it is.)
## Default, seemingly sane defaults are really small files expire after a ~year, thicc files delete after ~5 days.
config["USE_0x0_DELETION"] = False
config["MAX_FILESIZE"] =
512
* 1024 * 1024
config["MAX_FILESIZE"] =
1024
* 1024 * 1024
config["MINDAYS"] = 5
config["MAXDAYS"] = 365
...
...
This diff is collapsed.
Click to expand it.
conf.py.sample
+
1
−
0
View file @
e2e9c7c8
...
...
@@ -34,6 +34,7 @@ config["ALLOW_ALL_FILES"] = False
config["ALLOWED_EXTENSIONS"] = set(['txt', 'pdf', 'bmp', 'png', 'jpg', 'jpeg', 'gif', 'webm', 'log', 'bin', 'webp', 'heif', 'mov', 'mkv', 'mp4', 'mp3', 'ogg', 'flac' ])
# Will use blacklist if this is enabled. You must disable ALLOW_ALL_FILES for this to take effect
## Note: Will always allow files with no extensions, as they /should/ be rendered as text.
config["BLACKLIST"] = True
config["BANNED_EXTENSIONS"] = set(['exe', 'msi', 'html', 'js', 'php'])
...
...
This diff is collapsed.
Click to expand it.
run.py
+
4
−
1
View file @
e2e9c7c8
...
...
@@ -93,7 +93,10 @@ def allowed_file(filename):
return
True
else
:
if
config
[
"
BLACKLIST
"
]:
return
'
.
'
in
filename
and
filename
.
rsplit
(
'
.
'
,
1
)[
1
]
not
in
config
[
"
BANNED_EXTENSIONS
"
]
if
'
.
'
not
in
filename
:
return
True
else
:
return
'
.
'
in
filename
and
filename
.
rsplit
(
'
.
'
,
1
)[
1
]
not
in
config
[
"
BANNED_EXTENSIONS
"
]
else
:
return
'
.
'
in
filename
and
filename
.
rsplit
(
'
.
'
,
1
)[
1
]
in
config
[
"
ALLOWED_EXTENSIONS
"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment