mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 06:34:25 -04:00
add django-signal-webhooks
This commit is contained in:
parent
3805a1730d
commit
c7fc9c004f
5 changed files with 36 additions and 3 deletions
|
@ -18,6 +18,7 @@ from ..config import (
|
||||||
CUSTOM_TEMPLATES_DIR,
|
CUSTOM_TEMPLATES_DIR,
|
||||||
SQL_INDEX_FILENAME,
|
SQL_INDEX_FILENAME,
|
||||||
OUTPUT_DIR,
|
OUTPUT_DIR,
|
||||||
|
ARCHIVE_DIR,
|
||||||
LOGS_DIR,
|
LOGS_DIR,
|
||||||
TIMEZONE,
|
TIMEZONE,
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@ INSTALLED_APPS = [
|
||||||
'core',
|
'core',
|
||||||
'api',
|
'api',
|
||||||
|
|
||||||
|
'signal_webhooks',
|
||||||
'django_extensions',
|
'django_extensions',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -253,6 +255,23 @@ CACHES = {
|
||||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||||
|
|
||||||
|
|
||||||
|
STORAGES = {
|
||||||
|
"archive": {
|
||||||
|
"BACKEND": "django.core.files.storage.FileSystemStorage",
|
||||||
|
"OPTIONS": {
|
||||||
|
"base_url": "/archive/",
|
||||||
|
"location": ARCHIVE_DIR,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
# "personas": {
|
||||||
|
# "BACKEND": "django.core.files.storage.FileSystemStorage",
|
||||||
|
# "OPTIONS": {
|
||||||
|
# "base_url": "/personas/",
|
||||||
|
# "location": PERSONAS_DIR,
|
||||||
|
# },
|
||||||
|
# },
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
### Security Settings
|
### Security Settings
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -379,3 +398,15 @@ LOGGING = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Add default webhook configuration to the User model
|
||||||
|
SIGNAL_WEBHOOKS = {
|
||||||
|
"HOOKS": {
|
||||||
|
"django.contrib.auth.models.User": ...,
|
||||||
|
"core.models.Snapshot": "...",
|
||||||
|
"core.models.ArchiveResult": "...",
|
||||||
|
"core.models.Tag": "...",
|
||||||
|
"api.models.APIToken": "...",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ WARNING: THIS FILE IS ALL LEGACY CODE TO BE REMOVED.
|
||||||
|
|
||||||
DO NOT ADD ANY NEW FEATURES TO THIS FILE, NEW CODE GOES HERE: core/models.py
|
DO NOT ADD ANY NEW FEATURES TO THIS FILE, NEW CODE GOES HERE: core/models.py
|
||||||
|
|
||||||
|
These are the old types we used to use before ArchiveBox v0.4 (before we switched to Django).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__package__ = 'archivebox.index'
|
__package__ = 'archivebox.index'
|
||||||
|
|
|
@ -230,7 +230,7 @@ def version(quiet: bool=False,
|
||||||
p = platform.uname()
|
p = platform.uname()
|
||||||
print(
|
print(
|
||||||
'ArchiveBox v{}'.format(get_version(CONFIG)),
|
'ArchiveBox v{}'.format(get_version(CONFIG)),
|
||||||
*((f'COMMIT_HASH={COMMIT_HASH[:7]}',) if COMMIT_HASH else ()),
|
f'COMMIT_HASH={COMMIT_HASH[:7] if COMMIT_HASH else 'unknown'}',
|
||||||
f'BUILD_TIME={BUILD_TIME}',
|
f'BUILD_TIME={BUILD_TIME}',
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
|
@ -1356,7 +1356,7 @@ def manage(args: Optional[List[str]]=None, out_dir: Path=OUTPUT_DIR) -> None:
|
||||||
if (args and "createsuperuser" in args) and (IN_DOCKER and not IS_TTY):
|
if (args and "createsuperuser" in args) and (IN_DOCKER and not IS_TTY):
|
||||||
stderr('[!] Warning: you need to pass -it to use interactive commands in docker', color='lightyellow')
|
stderr('[!] Warning: you need to pass -it to use interactive commands in docker', color='lightyellow')
|
||||||
stderr(' docker run -it archivebox manage {}'.format(' '.join(args or ['...'])), color='lightyellow')
|
stderr(' docker run -it archivebox manage {}'.format(' '.join(args or ['...'])), color='lightyellow')
|
||||||
stderr()
|
stderr('')
|
||||||
|
|
||||||
execute_from_command_line([f'{ARCHIVEBOX_BINARY} manage', *(args or ['help'])])
|
execute_from_command_line([f'{ARCHIVEBOX_BINARY} manage', *(args or ['help'])])
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ if __name__ == '__main__':
|
||||||
# versions of ./manage.py commands whenever possible. When that's not possible
|
# versions of ./manage.py commands whenever possible. When that's not possible
|
||||||
# (e.g. makemigrations), you can comment out this check temporarily
|
# (e.g. makemigrations), you can comment out this check temporarily
|
||||||
|
|
||||||
if not ('makemigrations' in sys.argv or 'migrate' in sys.argv):
|
if not ('makemigrations' in sys.argv or 'migrate' in sys.argv or 'startapp' in sys.argv):
|
||||||
print("[X] Don't run ./manage.py directly (unless you are a developer running makemigrations):")
|
print("[X] Don't run ./manage.py directly (unless you are a developer running makemigrations):")
|
||||||
print()
|
print()
|
||||||
print(' Hint: Use these archivebox CLI commands instead of the ./manage.py equivalents:')
|
print(' Hint: Use these archivebox CLI commands instead of the ./manage.py equivalents:')
|
||||||
|
|
|
@ -35,6 +35,7 @@ dependencies = [
|
||||||
# - gallery-dl
|
# - gallery-dl
|
||||||
# - scihubdl
|
# - scihubdl
|
||||||
# - See Github issues for more...
|
# - See Github issues for more...
|
||||||
|
"django-signal-webhooks>=0.3.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
homepage = "https://github.com/ArchiveBox/ArchiveBox"
|
homepage = "https://github.com/ArchiveBox/ArchiveBox"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue