-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add file name field for better web experience #693
base: master
Are you sure you want to change the base?
Conversation
there is no such thing as good/bad PR, all of them are amazing, as all of us having different use cases could you give me a bit more details please, so that would just show the original filename on web? |
Yes, this can show the original filename on web using the database filename field. |
i might be wrong so correct me if needed, what i see is basically that if we rename |
oh i see, i will check it. |
yes i think if we rename the file just after extract, instead of using path_to_extract, theorically that should do the trick to get the original filename |
yes,however, if there are characters such as unicode in the file name, there may be problems in subsequent analysis. |
hm, wouldn't that give problems when we store that in db? we can use |
yes, there is no problems store in db.the purpose of this pr is to save the original file name in the database and display it on the web without being affected by sanitize_filename. |
But if the original filename contains certain characters and is un-sanitized, will this not cause the entire web page to fail? |
In fact, it should not be possible, because the django framework and python itself will help us clean up some abnormal strings, but I am not sure whether it can be bypassed. |
Considering that there may be some concerns about this function (actually static and pcap, etc. are all displayed origin filenames), I added enable in web.conf. |
I don't know if this is a good pr.
cd /opt/CAPEv2/utils/db_migration && alembic upgrade head
and restart capesystemctl restart cape