plain.dev 0.29.0__tar.gz → 0.29.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 (32) hide show
  1. {plain_dev-0.29.0 → plain_dev-0.29.2}/PKG-INFO +1 -1
  2. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/cli.py +15 -21
  3. {plain_dev-0.29.0 → plain_dev-0.29.2}/pyproject.toml +1 -1
  4. {plain_dev-0.29.0 → plain_dev-0.29.2}/.gitignore +0 -0
  5. {plain_dev-0.29.0 → plain_dev-0.29.2}/LICENSE +0 -0
  6. {plain_dev-0.29.0 → plain_dev-0.29.2}/README.md +0 -0
  7. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/README.md +0 -0
  8. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/__init__.py +0 -0
  9. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/contribute/README.md +0 -0
  10. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/contribute/__init__.py +0 -0
  11. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/contribute/cli.py +0 -0
  12. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/debug.py +0 -0
  13. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/default_settings.py +0 -0
  14. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/entrypoints.py +0 -0
  15. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/gunicorn_logging.json +0 -0
  16. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/mkcert.py +0 -0
  17. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/pdb.py +0 -0
  18. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/poncho/__init__.py +0 -0
  19. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/poncho/color.py +0 -0
  20. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/poncho/compat.py +0 -0
  21. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/poncho/manager.py +0 -0
  22. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/poncho/printer.py +0 -0
  23. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/poncho/process.py +0 -0
  24. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/precommit/__init__.py +0 -0
  25. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/precommit/cli.py +0 -0
  26. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/requests.py +0 -0
  27. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/services.py +0 -0
  28. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/templates/dev/requests.html +0 -0
  29. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/urls.py +0 -0
  30. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/utils.py +0 -0
  31. {plain_dev-0.29.0 → plain_dev-0.29.2}/plain/dev/views.py +0 -0
  32. {plain_dev-0.29.0 → plain_dev-0.29.2}/tests/settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.dev
3
- Version: 0.29.0
3
+ Version: 0.29.2
4
4
  Summary: Local development tools for Plain.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
@@ -49,8 +49,8 @@ ENTRYPOINT_GROUP = "plain.dev"
49
49
  @click.option(
50
50
  "--log-level",
51
51
  "-l",
52
- default="info",
53
- type=click.Choice(["debug", "info", "warning", "error", "critical"]),
52
+ default="",
53
+ type=click.Choice(["debug", "info", "warning", "error", "critical", ""]),
54
54
  help="Log level",
55
55
  )
56
56
  def cli(ctx, port, hostname, log_level):
@@ -145,10 +145,13 @@ class Dev:
145
145
  self.plain_env = {
146
146
  "PYTHONUNBUFFERED": "true",
147
147
  "PLAIN_DEV": "true",
148
- "PLAIN_LOG_LEVEL": self.log_level.upper(),
149
- "APP_LOG_LEVEL": self.log_level.upper(),
150
148
  **os.environ,
151
149
  }
150
+
151
+ if log_level:
152
+ self.plain_env["PLAIN_LOG_LEVEL"] = log_level.upper()
153
+ self.plain_env["APP_LOG_LEVEL"] = log_level.upper()
154
+
152
155
  self.custom_process_env = {
153
156
  **self.plain_env,
154
157
  "PORT": str(self.port),
@@ -198,7 +201,7 @@ class Dev:
198
201
 
199
202
  self.symlink_plain_src()
200
203
  self.modify_hosts_file()
201
- self.set_csrf_and_allowed_hosts()
204
+ self.set_allowed_hosts()
202
205
  self.run_preflight()
203
206
 
204
207
  # If we start services ourselves, we should manage the pidfile
@@ -351,22 +354,13 @@ class Dev:
351
354
  )
352
355
  sys.exit(1)
353
356
 
354
- def set_csrf_and_allowed_hosts(self):
355
- if "PLAIN_CSRF_TRUSTED_ORIGINS" not in os.environ:
356
- csrf_trusted_origins = json.dumps(
357
- [
358
- self.url,
359
- ]
360
- )
361
- self.plain_env["PLAIN_CSRF_TRUSTED_ORIGINS"] = csrf_trusted_origins
362
- self.custom_process_env["PLAIN_CSRF_TRUSTED_ORIGINS"] = csrf_trusted_origins
363
- click.secho(
364
- f"Automatically set PLAIN_CSRF_TRUSTED_ORIGINS={csrf_trusted_origins}",
365
- dim=True,
366
- )
367
-
357
+ def set_allowed_hosts(self):
368
358
  if "PLAIN_ALLOWED_HOSTS" not in os.environ:
369
- allowed_hosts = json.dumps([self.hostname])
359
+ hostnames = [self.hostname]
360
+ if self.tunnel_url:
361
+ # Add the tunnel URL to the allowed hosts
362
+ hostnames.append(self.tunnel_url.split("://")[1])
363
+ allowed_hosts = json.dumps(hostnames)
370
364
  self.plain_env["PLAIN_ALLOWED_HOSTS"] = allowed_hosts
371
365
  self.custom_process_env["PLAIN_ALLOWED_HOSTS"] = allowed_hosts
372
366
  click.secho(
@@ -404,7 +398,7 @@ class Dev:
404
398
  "--timeout",
405
399
  "60",
406
400
  "--log-level",
407
- self.log_level,
401
+ self.log_level or "info",
408
402
  "--access-logfile",
409
403
  "-",
410
404
  "--error-logfile",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "plain.dev"
3
- version = "0.29.0"
3
+ version = "0.29.2"
4
4
  description = "Local development tools for Plain."
5
5
  authors = [{name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev"}]
6
6
  license = "BSD-3-Clause"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes