history4feed 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. history4feed-0.0.2/.env.example +27 -0
  2. history4feed-0.0.2/.env.markdown +64 -0
  3. history4feed-0.0.2/.github/workflows/create-release.yml +71 -0
  4. history4feed-0.0.2/.github/workflows/run_tests.yml +93 -0
  5. history4feed-0.0.2/.gitignore +175 -0
  6. history4feed-0.0.2/Dockerfile +7 -0
  7. history4feed-0.0.2/LICENSE +202 -0
  8. history4feed-0.0.2/PKG-INFO +118 -0
  9. history4feed-0.0.2/README.md +81 -0
  10. history4feed-0.0.2/docker-compose.yml +59 -0
  11. history4feed-0.0.2/docs/README.md +368 -0
  12. history4feed-0.0.2/docs/history4feed.png +0 -0
  13. history4feed-0.0.2/history4feed/__init__.py +0 -0
  14. history4feed-0.0.2/history4feed/app/__init__.py +0 -0
  15. history4feed-0.0.2/history4feed/app/admin.py +3 -0
  16. history4feed-0.0.2/history4feed/app/apps.py +7 -0
  17. history4feed-0.0.2/history4feed/app/autoschema.py +12 -0
  18. history4feed-0.0.2/history4feed/app/migrations/0001_initial.py +84 -0
  19. history4feed-0.0.2/history4feed/app/migrations/0002_feed_freshness_alter_feed_feed_type.py +23 -0
  20. history4feed-0.0.2/history4feed/app/migrations/0003_alter_feed_description.py +18 -0
  21. history4feed-0.0.2/history4feed/app/migrations/0004_alter_fulltextjob_status_alter_job_state.py +23 -0
  22. history4feed-0.0.2/history4feed/app/migrations/0005_feed_datetime_modified.py +18 -0
  23. history4feed-0.0.2/history4feed/app/migrations/__init__.py +0 -0
  24. history4feed-0.0.2/history4feed/app/models.py +203 -0
  25. history4feed-0.0.2/history4feed/app/openapi_params.py +66 -0
  26. history4feed-0.0.2/history4feed/app/serializers.py +181 -0
  27. history4feed-0.0.2/history4feed/app/settings.py +49 -0
  28. history4feed-0.0.2/history4feed/app/tests.py +3 -0
  29. history4feed-0.0.2/history4feed/app/utils.py +93 -0
  30. history4feed-0.0.2/history4feed/app/views.py +793 -0
  31. history4feed-0.0.2/history4feed/asgi.py +16 -0
  32. history4feed-0.0.2/history4feed/h4fscripts/__init__.py +21 -0
  33. history4feed-0.0.2/history4feed/h4fscripts/build_rss.py +34 -0
  34. history4feed-0.0.2/history4feed/h4fscripts/celery.py +12 -0
  35. history4feed-0.0.2/history4feed/h4fscripts/exceptions.py +11 -0
  36. history4feed-0.0.2/history4feed/h4fscripts/h4f.py +198 -0
  37. history4feed-0.0.2/history4feed/h4fscripts/sitemap_helpers.py +59 -0
  38. history4feed-0.0.2/history4feed/h4fscripts/task_helper.py +273 -0
  39. history4feed-0.0.2/history4feed/h4fscripts/wayback_helpers.py +65 -0
  40. history4feed-0.0.2/history4feed/h4fscripts/xml_utils.py +68 -0
  41. history4feed-0.0.2/history4feed/settings.py +203 -0
  42. history4feed-0.0.2/history4feed/urls.py +50 -0
  43. history4feed-0.0.2/history4feed/wsgi.py +16 -0
  44. history4feed-0.0.2/manage.py +22 -0
  45. history4feed-0.0.2/pyproject.toml +51 -0
  46. history4feed-0.0.2/requirements.txt +182 -0
  47. history4feed-0.0.2/run.sh +3 -0
  48. history4feed-0.0.2/tests/README.md +16 -0
  49. history4feed-0.0.2/tests/__init__.py +0 -0
  50. history4feed-0.0.2/tests/docker-compose.yml +18 -0
  51. history4feed-0.0.2/tests/requirements.txt +7 -0
  52. history4feed-0.0.2/tests/src/test_h4f_scripts/__init__.py +0 -0
  53. history4feed-0.0.2/tests/src/test_h4f_scripts/rss_data.py +239 -0
  54. history4feed-0.0.2/tests/src/test_h4f_scripts/test_build_rss.py +53 -0
  55. history4feed-0.0.2/tests/src/test_h4f_scripts/test_h4f__fetch.py +254 -0
  56. history4feed-0.0.2/tests/src/test_h4f_scripts/test_h4f__parse.py +70 -0
  57. history4feed-0.0.2/tests/src/test_h4f_scripts/test_sitemap.py +100 -0
  58. history4feed-0.0.2/tests/src/test_h4f_scripts/test_tasks.py +541 -0
  59. history4feed-0.0.2/tests/src/test_models.py +45 -0
  60. history4feed-0.0.2/tests/src/test_serializers.py +0 -0
  61. history4feed-0.0.2/tests/src/test_settings.py +0 -0
  62. history4feed-0.0.2/tests/src/test_utils.py +67 -0
  63. history4feed-0.0.2/tests/src/test_views/__init__.py +0 -0
  64. history4feed-0.0.2/tests/src/test_views/test_feed_view.py +265 -0
  65. history4feed-0.0.2/tests/src/test_views/test_post_in_feed_view.py +117 -0
  66. history4feed-0.0.2/tests/src/test_views/test_post_only_view.py +152 -0
  67. history4feed-0.0.2/tests/st/.env.schemathesis +10 -0
  68. history4feed-0.0.2/tests/st/__init__.py +0 -0
  69. history4feed-0.0.2/tests/st/hooks.py +33 -0
  70. history4feed-0.0.2/tests/st/st.py +11 -0
  71. history4feed-0.0.2/tests/test_01_add_feeds.py +108 -0
  72. history4feed-0.0.2/tests/test_02_add_post.py +96 -0
  73. history4feed-0.0.2/tests/test_03_delete_post.py +33 -0
  74. history4feed-0.0.2/tests/test_04_delete_feed.py +33 -0
  75. history4feed-0.0.2/tests/test_05_post_filters.py +194 -0
  76. history4feed-0.0.2/tests/test_06_patch_feed.py +39 -0
  77. history4feed-0.0.2/tests/test_07_patch_post.py +37 -0
  78. history4feed-0.0.2/tests/test_99_delete_all_feeds.py +25 -0
  79. history4feed-0.0.2/tests/tests.env +12 -0
  80. history4feed-0.0.2/tests/utils.py +51 -0
@@ -0,0 +1,27 @@
1
+ # POSTGRES
2
+ POSTGRES_HOST=
3
+ POSTGRES_PORT=
4
+ POSTGRES_DB=
5
+ POSTGRES_USER=
6
+ POSTGRES_PASSWORD=
7
+ #django settings
8
+ DJANGO_SECRET=
9
+ DJANGO_DEBUG=
10
+ DJANGO_ALLOWED_HOSTS=
11
+ DJANGO_CORS_ALLOW_ALL_ORIGINS=
12
+ DJANGO_CORS_ALLOWED_ORIGINS=
13
+ # CELERY
14
+ CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP=
15
+ # SCRAPE BACKFILL SETTINGS
16
+ EARLIEST_SEARCH_DATE=
17
+ # PROXY
18
+ SCRAPFILE_APIKEY=
19
+ # SETTINGS TO AVOID RATE LIMITS
20
+ WAYBACK_SLEEP_SECONDS=
21
+ WAYBACK_BACKOFF_TIME=
22
+ REQUEST_RETRY_COUNT=
23
+ # API SETTINGS
24
+ DEFAULT_PAGE_SIZE=
25
+ MAX_PAGE_SIZE=
26
+ # SERPER
27
+ SERPER_API_KEY=
@@ -0,0 +1,64 @@
1
+ # Environmental file info
2
+
3
+ If you're running in production, you should set these securely.
4
+
5
+ However, if you just want to experiment, set the following values
6
+
7
+ ## Django Settings
8
+
9
+ These are all Django settings, defined in `history4feed/settings.py`
10
+
11
+ * `DJANGO_SECRET`: `insecure_django_secret`
12
+ * `DJANGO_DEBUG`: `True`
13
+ * `DJANGO_ALLOWED_HOSTS`: BLANK
14
+ * `DJANGO_CORS_ALLOW_ALL_ORIGINS`: `True`
15
+ * `DJANGO_CORS_ALLOWED_ORIGINS`: LEAVE EMPTY
16
+
17
+ ## Postgres Settings
18
+
19
+ These are all Django settings, defined in `history4feed/settings.py`
20
+
21
+ * `POSTGRES_HOST`: `pgdb`
22
+ * `POSTGRES_PORT`: BLANK
23
+ * `POSTGRES_DB`: `postgres`
24
+ * `POSTGRES_USER`: `postgres`
25
+ * `POSTGRES_PASSWORD`: `postgres`
26
+
27
+ ## Celery settings
28
+
29
+ * `CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP`: `1`
30
+
31
+ ## history4feed API settings
32
+
33
+ These define how the API behaves.
34
+
35
+ * `MAX_PAGE_SIZE`: `50`
36
+ * This is the maximum number of results the API will ever return before pagination
37
+ * `DEFAULT_PAGE_SIZE`: `50`
38
+ * The default page size of result returned by the API
39
+
40
+ ## Search Index Mode (Serper)
41
+
42
+ Search index mode, uses the [Serper API Key](https://serper.dev/) to scrape search results.
43
+
44
+ * `SERPER_API_KEY`
45
+ * [Get your key here](https://serper.dev/api-key).
46
+
47
+ ## Scrape backfill settings
48
+
49
+ * `EARLIEST_SEARCH_DATE`: `2020-01-01T00:00:00Z`
50
+ * determines how far history4feed will backfill posts for newly added feeds. e.g. `EARLIEST_SEARCH_DATE=2020-01-01T00:00:00Z` will import all posts with a publish date >= `2020-01-01T00:00:00Z`
51
+
52
+ ## Proxy settings
53
+
54
+ * `SCRAPFILE_APIKEY`: YOUR_API_KEY
55
+ * We strongly recommend using the [ScrapFly](https://scrapfly.io/) proxy service with history4feed. Though we have no affiliation with them, it is the best proxy service we've tested and thus built in support for it to history4feed.
56
+
57
+ ## Settings to avoid rate limits if not using Scrapfly
58
+
59
+ If you're not using a Proxy it is very likely you'll run into rate limits on the WayBack Machine and the blogs you're requesting the full text from. You should therefore consider the following options
60
+
61
+ * `WAYBACK_SLEEP_SECONDS`: `45`
62
+ * This is useful when a large amount of posts are returned. This sets the time between each request to get the full text of the article to reduce servers blocking robotic requests.
63
+ * `REQUEST_RETRY_COUNT`: `3`
64
+ * This is useful when a large amount of posts are returned. This sets the number of retries when a non-200 response is returned.
@@ -0,0 +1,71 @@
1
+ name: Create Release
2
+ run-name: Creating release
3
+
4
+ on:
5
+ workflow_dispatch:
6
+ push:
7
+ branches:
8
+ - 'main'
9
+
10
+ jobs:
11
+ create-release:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: write
15
+ id-token: write
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.11"
24
+
25
+ - name: Install build dependencies
26
+ run: python3 -m pip install build hatchling
27
+
28
+ - name: Extract version from pyproject.toml
29
+ id: get-version
30
+ run: |
31
+ VERSION=$(python -m hatchling version)
32
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
33
+
34
+ - name: Build package
35
+ run: python3 -m build
36
+
37
+ - name: Determine release tag
38
+ id: release-tag
39
+ run: |
40
+ if [[ "${{ github.ref_name }}" == "main" ]]; then
41
+ echo "tag=${{ steps.get-version.outputs.version }}" >> $GITHUB_OUTPUT
42
+ else
43
+ echo "tag=${{ steps.get-version.outputs.version }}-beta-$(date +"%Y-%m-%d-%H-%M-%S")" >> $GITHUB_OUTPUT
44
+ fi
45
+
46
+ - name: Create GitHub Release
47
+ env:
48
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49
+ run: |
50
+ TAG="${{ steps.release-tag.outputs.tag }}"
51
+ gh release create "$TAG" --repo "${{ github.repository }}" --notes ""
52
+ gh release upload "$TAG" dist/** --repo "${{ github.repository }}"
53
+
54
+ - name: Clean up old beta releases (keep latest 10)
55
+ if: github.ref_name != 'main'
56
+ env:
57
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58
+ run: |
59
+ gh release list --limit 100 --repo "${{ github.repository }}" --json tagName,createdAt \
60
+ | jq -r '.[] | select(.tagName | test("-beta-")) | [.tagName, .createdAt] | @tsv' \
61
+ | sort -k2 -r \
62
+ | tail -n +11 \
63
+ | cut -f1 \
64
+ | while read old_tag; do
65
+ echo "Deleting old beta release: $old_tag"
66
+ gh release delete "$old_tag" --repo "${{ github.repository }}" --cleanup-tag --yes
67
+ done
68
+
69
+ - name: Publish package distributions to PyPI
70
+ if: github.ref_name == 'main'
71
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,93 @@
1
+ name: Run Unit and Schema Tests
2
+
3
+ permissions:
4
+ contents: read
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+ pull_request:
11
+
12
+ jobs:
13
+ unittest-and-schemathesis:
14
+ runs-on: ubuntu-latest
15
+ environment: test_pipeline
16
+
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 1
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.11"
27
+
28
+
29
+ - name: Set .env for docker-compose
30
+ run: |
31
+
32
+ cat tests/tests.env >> .env
33
+ echo POSTGRES_PORT=5432 >> .env
34
+ echo POSTGRES_HOST=pgdb >> .env
35
+ cp tests/docker-compose.yml test-compose.yml
36
+
37
+ echo ==== env file start =====
38
+ cat .env
39
+ echo
40
+ echo ==== env file end =====
41
+
42
+
43
+ - name: Start docker-compose
44
+ uses: hoverkraft-tech/compose-action@v2.0.2
45
+ with:
46
+ compose-file: |
47
+ test-compose.yml
48
+ docker-compose.yml
49
+ compose-flags:
50
+ --env-file .env
51
+ -p history4feed-action
52
+
53
+ - name: Get IP addresses
54
+ id: get_ip
55
+ run: |
56
+ IP_ADDRESS=$(docker network inspect -f '{{range.IPAM.Config}}{{.Gateway}}{{end}}' history4feed-action_default)
57
+ echo "ip_address=$IP_ADDRESS" >> "$GITHUB_OUTPUT"
58
+ echo "IP_ADDRESS=$IP_ADDRESS" >> "$GITHUB_OUTPUT"
59
+ echo "SERVICE_BASE_URL=http://$IP_ADDRESS:8002/" >> "$GITHUB_OUTPUT"
60
+ cat "$GITHUB_OUTPUT"
61
+
62
+ - name: run unit tests with pytest+coverage
63
+ id: test-endpoints
64
+ run: |
65
+ pip install -e .[test]
66
+ set -a; source .env; source tests/tests.env; set +a
67
+ export DJANGO_WWW_PATH=$PWD/django_www_path/
68
+ mkdir -p $DJANGO_WWW_PATH
69
+ export POSTGRES_HOST="${{ steps.get_ip.outputs.IP_ADDRESS }}"
70
+ export PYTHONPATH=.
71
+
72
+ pytest --cov --cov-branch --cov-report=xml --junitxml=junit.xml -o junit_family=legacy tests/src
73
+
74
+ - name: Upload coverage reports to Codecov
75
+ if: ${{ !cancelled() }}
76
+ uses: codecov/codecov-action@v5
77
+ with:
78
+ token: ${{ secrets.CODECOV_TOKEN }}
79
+
80
+ - name: Upload test results to Codecov
81
+ if: ${{ !cancelled() }}
82
+ uses: codecov/test-results-action@v1
83
+ with:
84
+ token: ${{ secrets.CODECOV_TOKEN }}
85
+
86
+ - name: run schemathesis
87
+ uses: schemathesis/action@v1
88
+ if: always()
89
+ with:
90
+ schema: ${{ steps.get_ip.outputs.SERVICE_BASE_URL }}/api/schema/
91
+ checks: all
92
+ wait-for-schema: '30'
93
+ args: '--generation-allow-x00 false -H "Host: localhost"'
@@ -0,0 +1,175 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+ staticfiles
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # poetry
99
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103
+ #poetry.lock
104
+
105
+ # pdm
106
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107
+ #pdm.lock
108
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109
+ # in version control.
110
+ # https://pdm.fming.dev/#use-with-ide
111
+ .pdm.toml
112
+
113
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
114
+ __pypackages__/
115
+
116
+ # Celery stuff
117
+ celerybeat-schedule
118
+ celerybeat.pid
119
+
120
+ # SageMath parsed files
121
+ *.sage.py
122
+
123
+ # Environments
124
+ .env
125
+ .venv
126
+ env/
127
+ venv/
128
+ ENV/
129
+ env.bak/
130
+ venv.bak/
131
+
132
+ # Spyder project settings
133
+ .spyderproject
134
+ .spyproject
135
+
136
+ # Rope project settings
137
+ .ropeproject
138
+
139
+ # mkdocs documentation
140
+ /site
141
+
142
+ # mypy
143
+ .mypy_cache/
144
+ .dmypy.json
145
+ dmypy.json
146
+
147
+ # Pyre type checker
148
+ .pyre/
149
+
150
+ # pytype static type analyzer
151
+ .pytype/
152
+
153
+ # Cython debug symbols
154
+ cython_debug/
155
+
156
+ # PyCharm
157
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
159
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
160
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
161
+ #.idea/
162
+
163
+ config*
164
+
165
+ # ignore venv in config
166
+
167
+ history4feed-venv/
168
+
169
+ # ignore created dirs with generated data
170
+
171
+ logs/
172
+ output/
173
+
174
+ # mac files
175
+ .DS_Store
@@ -0,0 +1,7 @@
1
+ FROM python:3.11
2
+ ENV PYTHONUNBUFFERED=1
3
+ WORKDIR /usr/src/app
4
+ COPY requirements.txt ./
5
+ RUN pip install -r requirements.txt
6
+
7
+ COPY . /usr/src/app
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2020 DOGESEC (https://www.dogesec.com/)
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.