Граф коммитов

779 Коммитов

Автор SHA1 Сообщение Дата
Kevin Meinhardt 2a64618e9d
Enable Production Mode via DEBUG or docker-compose.ci.yml (#22613)
* TMP: clean bake metadata file

* SPLIT: Log UWSGI in docker compose console

Remove PID

* SPLIT: Raise error in update_assets if file not found

* Enable Production mode via DEBUG and or docker-compose.ci.yml

* Option 1: Load node_modules from statifiles directory

* Option 2: Load node_modules via django-node-asset

* separate ./static from locally built static files

* Add docs for static file serving

* TMP: fixes from code review

* Update docs/topics/development/static-files.md

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

* TMP: update docs

---------

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
2024-09-05 16:20:03 +02:00
Kevin Meinhardt ad91f29730
Revert "Enable running wsgi in production mode" (#22614)
This reverts commit 469f85f6924f0c94b8e0b4af369416149beb65de.
2024-08-30 13:12:12 +02:00
Kevin Meinhardt e3b8da1533 Enable running wsgi in production mode 2024-08-30 13:02:49 +02:00
Kevin Meinhardt d7b21e18e6
Remove supervisor and enable more efficient container startup (#22592)
* TMP: add http server to expose version endpoint

* Use data volume for mounting repository files

* Use watchmedo directly from docker to run celery

* TMP: fix test

* TMP: remove data_olympia volume on ci yml

* TMP: add settings djanmgo modeul to celery worker.

* TMP: remove references to ssupervisor

* Update docs/topics/development/building_and_running_services.md

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

---------

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
2024-08-27 12:42:10 +02:00
dependabot[bot] 8a99ae753e
Bump ruff from 0.2.2 to 0.3.2 in /requirements (#21994)
* Bump ruff from 0.2.2 to 0.3.2 in /requirements

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.2 to 0.3.2.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/v0.2.2...v0.3.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* ruff formatting changes in 0.3.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Williamson <awilliamson@mozilla.com>
2024-03-18 11:28:28 +00:00
Kevin Meinhardt 10fe3e19d5
Create empty local_settings.py when none exists to avoid erronious "missing local_settings" warning (#21890)
* Create empty local_settings.py if none exsits

* Update settings.py

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

* Format code

---------

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
2024-02-26 09:13:35 +01:00
Kevin Meinhardt d48f92bdd0
chore(swagger): add session auth settings for authenticated requests in swagger ui (#21612) 2023-12-14 13:46:45 +01:00
Kevin Meinhardt 3ab0252f3a
chore(): add swagger UI to document our apis (#21521)
* chore(): generate api versions from method

* chore(): add swagger UI to document our apis
2023-12-11 18:26:58 +01:00
Andrew Williamson 47dffb2ef1
fix ruff rules B017, B018, B028, B905 - or explictly disable per line (#20990)
* fix ruff rules B017, B018, B028, B905 - or explictly disable per line

* slightly rework get_disco_recommendations
2023-07-13 12:37:56 +01:00
Andrew Williamson ee8a48ec68
reformat codebase to reduce the ignore rules for ruff (#20972)
* ignore rule F405 per file

* ruff autofix of B007 and B010

* B007 manual fixes

* B026 fixes

* B023 fixes

* updated ruff ignore list

* black formatting & rework decorators

* optimize iterating on dicts where we don't need the keys or values
2023-07-10 15:31:09 +01:00
Andrew Williamson e4038c3805
Enable isort (#20718)
* Enable isort in ruff

* auto-format codebase with isort
2023-05-23 15:36:16 +01:00
Andrew Williamson 5274157249
drop local fxa credentials; simplify FXA_CONFIGs (#19685) 2022-09-20 10:24:40 +01:00
Mathieu Pillard 50e2cda78b
Replace nobot with django-recaptcha (#19312)
* Replace nobot with django-recaptcha

* Silence system check since we'll be using the test keys locally

* Customize template to avoid inline JavaScript
2022-06-07 12:54:23 +02:00
William Durand 6ea321ace0
Remove code related to the wat scanner (#19153) 2022-04-26 14:38:35 +02:00
Bob Silverberg 2bd1adb585
Allow Fake FxA login page to redirect to :7000 (#18718) 2022-02-01 14:34:44 -05:00
Mathieu Pillard 71ea6b9fde
Remove lib/cache.py, simplify CACHES settings (#18706)
* Remove lib/cache.py, simplify CACHES settings

* Remove useless noqa comments

* Useless f prefix
2022-01-27 14:17:34 +01:00
Mathieu Pillard 32ba705b4b
Load addons-server static files and user-uploaded images from the main domain on stage and prod (#18110)
* Load addons-server static files and user-uploaded images from the main domain on stage and prod

* Adjust tests

* black
2021-10-15 11:53:13 +02:00
Andrew Williamson f58ecaebf0
switch memcache backend to pymemcache (#17691) 2021-08-11 11:46:08 +01:00
Andrew Williamson 6101446f3c
implement sitemap.xml with basic site and addon support (#16904)
* implement sitemap.xml with basic site and addon support

* rm commented out lines from development
2021-04-13 11:04:48 +01:00
William Durand 6765fbbe07
Update settings.py (#15977) 2020-11-12 13:39:24 +01:00
Mathieu Pillard 4e56d728ce
Add special URL to bypass authentication locally (#15702)
* Don't run generate_default_addons_for_frontend outside ui tests

* Add special URL to bypass authentication locally

* Always go through generate_default_addons_for_frontend but skip fxa if not needed

* Add fake FxA authentication flow for local development

* Revert "Add special URL to bypass authentication locally"

* Tests for the view

* Test fxa_login_url()

* More testing

* Remove leftover obsolete import
2020-10-12 19:19:50 +02:00
Lisa Chan cb3c4b457f
RE: Add validations to Shelf model (#14998)
* Draft pull request - validator for criteria

* Updated validation for criteria; revised models, test_admin, conftest

* Added additional criteria validation tests to test_admin

* Replaced validator with clean_criteria method

* Removed responses for shelves

* Revised clean_criteria method and added tests to test_admin.py

* Revised shelf types in models.py

* Added message to inform admin the total addons returned after successfully saving a shelf

* Updated success message and respective tests

* Created test_forms, revised forms, admin, test admin

* Updated settings to add INTERNAL_SITE_URL and nginx to ALLOWED_HOSTS

* Revised baseUrl, removed results/save method - to add later

* Revised settings (dev, stage, prod) to move INTERNAL_SITE_URL near EXTERNAL_SITE_URL, moved 'nginx' to list from settings_base.py

* Formatting
2020-08-05 11:35:25 -04:00
Andrew Williamson ac50305b57
drop Block.include_in_legacy and derive legacy state from legacy_id (#15043) 2020-07-27 10:47:51 +01:00
William Durand de18ebf5c8
Add waffle flag for the beta stats (#14542) 2020-06-05 17:45:39 +02:00
William Durand 75c3cbfce7
Fix logging config (#14486) 2020-06-05 13:30:11 +02:00
William Durand 18bf215bd6
Introduce new setting for internal routes (#14254) 2020-05-25 11:51:18 +02:00
William Durand 9a129eb7a4
Update logging config (#14310) 2020-05-19 16:54:15 +02:00
Andrew Williamson 068d33509f
submit blocks to Kinto blocklist bucket (v2) (#13602)
* submit blocks to Kinto blocklist bucket (v2)

* add is_imported_from_kinto_regex test

* change KINTO_API_IS_TEST_SERVER default to False
2020-03-03 18:27:34 +00:00
Andrew Williamson f6dafeb47a
move /authenticate api endpoint to new versionless api; update clients (#12570) 2019-10-11 17:20:43 +01:00
Andrew Williamson 855464d389
Merge pull request #12532 from eviljeff/12417-drop-skip-register-redirect
drop skip_register_redirect + some refactoring
2019-10-08 15:55:42 +01:00
Andrew Williamson 493f01d63a change default to be prod fxa server; stage to use prod fxa server 2019-10-08 11:47:24 +01:00
Andrew Williamson 8a5b67d43e update redirects_url comments to make it clearer what it is 2019-10-08 09:48:10 +01:00
MyeongJun Go 9cf0ac5b43 fixed debugtool middleware be after GZip middleware (#12443)
Fix django-debug-toolbar middleware be after GZip middleware
2019-10-07 15:33:49 +02:00
Andrew Williamson 75c4d139cb drop skip_register_redirect + some refactoring 2019-10-04 18:47:05 +01:00
William Durand 98348e2a43
Use XSENDFILE in local dev (#12312) 2019-09-10 12:57:24 +02:00
William Durand 87a2cf7d35
Add task to run `wat` (#12225) 2019-09-09 13:04:44 +02:00
William Durand 458cc64170
Add task to run `customs` (over HTTP) (#12191) 2019-08-29 12:21:20 +02:00
Christopher Grebs d6c44135ce Merge pull request from GHSA-jq22-wqf5-666p
* Serve files in old file-viewer through FileResponse.

Fixes bug 1566954

The old file-viewer will be going away "soon" anyway so we should be
using the same technique as for the new one.

The problem here specifically is that when going through Nginx via
X-Accel-Redirect nginx isn't setting proper CSP headers for the
download. Serving the files ourselves allows us to much easier restrict
CSP in the future even further.

* Explicitly restrict CSP config on download endpoints.

* Set report uri in settings.py too

* Explicitly add frame-ancestors

* Remove outdated test
2019-07-18 16:52:11 +01:00
Christopher Grebs 2de22598bd
Remove all usage of 'six' and as much compat code as I could f… (#11730)
* Remove all usage of 'six' and as much compat code as I could find.

Cleans up some imports along the way.

Fixes #11728

* Fix typo

* Fix rta related code paths, I actually misread the comment…

* Move ResourceWarning filtering to setup.cfg
2019-07-16 12:01:31 +02:00
Mathieu Pillard 766ac85e1a Re-add Django-Debug-Toolbar for easier debugging, particularly in the admin 2019-07-03 22:43:09 +02:00
Mathieu Pillard 0d5e70bc29 Make sure File.get_url_path() returns a relative path
Also make sure get_absolute_url() is used as much as possible when we
want the absolute url, instead of doing it ourselves using absolutify.
2019-06-06 12:25:53 +02:00
Kumar McMillan d7b9e6cc6a
Link to Code Manager from reviewer tools (#11038) 2019-03-28 23:35:03 -05:00
William Durand 2e44800eac
Add new code-manager FxA configs (#11016) 2019-03-27 12:24:05 +01:00
Andrew Williamson 85e9ea6f03
use utf8mb4 everywhere; replace reset_db (#10935) 2019-03-18 10:57:49 +00:00
Andreas Wagner bd3500a392
Fix flake8 errors outside src/ 2019-03-04 16:01:00 +01:00
Andrew Williamson 8420fb2ee2
replace django-cors-headers-multi with django-cors-headers (#10704) 2019-02-18 21:04:11 +08:00
Adrian Utrilla c8e1a28208
Use utf8mb4 for connections to MySQL in dev 2019-01-18 17:29:32 +01:00
Mathieu Pillard 70760159c3 Replace urlparse imports by six.moves.urllib_parse for Python 3 compatibility
This keeps backwards-compatibility to Python 2 but moves us closer to running
with Python 3.
2019-01-07 17:43:17 +01:00
Christopher Grebs 2c82ea7728
Enable memcached by default for tests. Upgrade python-memcached
* Adds a test to test unicode support for latest python-memcached
  versions
* Configures caches key prefix so that tests don't conflict with each other
* Remove a few cache.clear calls with `cache.delete` calls that avoids
deleting all memcached entries while other tests are running
* Remove zadmin.memcached as it's crazy dangerous, such power should
only be wielded by ops-folks who wake up at night when pressed
* Fixes waffle helpers to call .flush() to flush appropriate caches

This also fixes how parameters are forwarded to memcached and fix KEY_PREFIX initialization

We are now making sure parameters from `settings.CACHES` are properly forwarded
to the actual cache backend (now memcached). These errors were not seen
since LocMemCache didn't require any parameters.

The `KEY_PREFIX` setting is set to a uuid instead of the xdist-slaveid to
ensure test functions are properly isolated from each other.

`cache.clear` is not called anywhere unless absolutely necessary to reduce
the side-effects of our test-setup.

Fixes #8602
2018-11-21 18:26:30 +01:00
William Durand e6ed0f3371
Use the right domain in each env (#9727) 2018-10-17 17:52:21 +02:00