1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-26 04:32:51 +01:00
Commit Graph

15 Commits

Author SHA1 Message Date
Mike Fährmann
a8b60b2bd9
change default cache directory for unix systems
Use either $XDG_CACHE_HOME or ~/.cache (if the former isn't set)
and store potentially sensitive cookies and tokens in a user's
home directory and not in the world-readable /tmp.
2019-07-31 22:56:14 +02:00
Mike Fährmann
4b6edfbfd2
restrict permissions without importing 'pathlib'
and only on non-Windows systems.

1. On Windows the 'mode' argument for os.open() has no (visible) effect
   on access permissions for new files.
2. The default location for 'cache.file' on Windows is in
   %USERPROFILE%\AppData\Local\Temp which can only be accessed by the
   owner himself (or an admin).
2019-07-31 21:48:09 +02:00
Leonardo Taccari
afce1ee1eb
Avoid possible sensitive information disclosure via cache.file
Previously cache.file could be created world readable leading to
possible sensitive information disclosure on multi-user systems.
Restrict permissions only to the owner by creating an empty file.

Please note that cache.file created before this commit may need a
`chmod 600' or similar!
2019-07-31 15:05:26 +02:00
Mike Fährmann
bc26fc2439
implement '--clear-cache'
Effectively clears all cached values from the cache database by
executing "DELETE FROM data" without any further user input.
2019-04-25 21:31:01 +02:00
Mike Fährmann
34ea0d6a10
rewrite cache module
less complexity, better performance,
but some duplicate code here and there
2019-03-14 15:55:48 +01:00
Mike Fährmann
2221cf97ff
implement 'update()' for caches 2018-10-12 22:18:29 +02:00
Mike Fährmann
ea8ca4cfa4
add 'util.expand_path()' 2017-10-26 00:04:28 +02:00
Mike Fährmann
e3212dd98f
fix some smaller stuff
- remove support for old windows config paths
- catch exception if cache-database can't be opened
- fix username/password settings for unit tests
- rename variable 'max_tries' to 'retries'
2017-03-27 14:30:32 +02:00
Mike Fährmann
4f123b8513
code adjustments according to pep8 2017-01-30 19:40:15 +01:00
Mike Fährmann
989820d719
workaround for python 3.6s behaviour with BEGIN EXCLUSIVE in sqlite 2017-01-11 00:34:32 +01:00
Mike Fährmann
1e0cf8ddcc
implement a method to manually invalidate cached values 2016-11-22 17:57:41 +01:00
Mike Fährmann
e12862520d
expand path for cache database 2016-09-23 08:23:04 +02:00
Mike Fährmann
b0c333b799
rewrite cache module 2016-04-20 08:40:41 +02:00
Mike Fährmann
738c65d54f
add 'keyarg' argument to cache-decorator 2016-03-06 16:05:59 +01:00
Mike Fährmann
b8c6937d39
first draft for a cache-module 2016-03-05 17:49:18 +01:00