hotcell-core 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b90b3c31e988d71fe6f9b1da6c1e727d8c25b934c5085757367fe6e38ffd5aef
4
- data.tar.gz: d8eed61e4eeb2d52fe65571ff75b34ff0f73d37ef96c615ec5ab88b7e4d64696
3
+ metadata.gz: e60aebb6474f67f6a35f01d9fe1e3a686c422a073e11ebf785af0816ade80e79
4
+ data.tar.gz: eb13e25de57e23ff35d57fe100926cd64c11ecad18af96104dd3864d2246411b
5
5
  SHA512:
6
- metadata.gz: 5b8e87d2713d7d8aae5091a469f3a16be1a1dc860e37c4a0b40aa2b3819a1ee3336f7807e88cbb4ae35892f4a6ad5ad892a3c239a6f4928108ecd584946d1d19
7
- data.tar.gz: 16ea6b1a37ab997e25d4553f697a6fd390b3b4dbe6869a6b703e0bccf1a1a8467fb14e95921e19c0125e48462aecc4ac578214729573106d4f00e5c0a8ac509c
6
+ metadata.gz: 0c0373bb9b2831d65e5fce1b02c7cb0ede24eed5a3d64144d905abbd93d72a7dcbf3d46250acb24caf195e1e1f9e0a530fa07ef2845c1ccba2118aed4f4e1aa2
7
+ data.tar.gz: a087aedd5855c87b413c53085e23d9d579a59176bc9453d1e07e4712592d1c1405f8939d42c6123ae3fa5bcf9b50ad3d0112353d3adba359a7814d55a0e0b10f
@@ -79,6 +79,18 @@ module HotCell
79
79
  # from somewhere it cannot see: a cgroup OOM kill chosen on aggregate pressure across concurrent workers,
80
80
  # or one worker signalling another — they share a uid, and nothing stops that. Attributing either to the
81
81
  # input this worker happened to be holding condemns a file for something it did not do.
82
+ #
83
+ # So the supervisor never infers either of them from a signal. They are decided in the worker, which is
84
+ # the process that holds the request: `memory` when it catches NoMemoryError itself, and `fsize` when a
85
+ # write of its own returns EFBIG. See Worker#disarm_file_size_signal for why the file-size verdict has
86
+ # to be earned that way rather than read off a wait status.
87
+ #
88
+ # That is a narrower guarantee than "a permanent verdict cannot be forged", and the difference matters.
89
+ # It removes the supervisor as an instrument: a sibling's signal no longer travels through a wait status
90
+ # into someone else's blob. It does nothing about a cell that has been compromised outright and answers
91
+ # a connection itself — `from_wire` believes a `permanent` boolean off the wire, and a worker that stole
92
+ # `work.sock` writes whatever it likes. That is the socket-theft residual `docs/DESIGN.md` records, and
93
+ # it is not closed here.
82
94
  PERMANENT_BY_CAUSE = {
83
95
  FSIZE => true,
84
96
  MEMORY => true,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HotCell
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -76,6 +76,14 @@ module HotCell
76
76
  error_class: wire[:class], message: wire[:message]
77
77
  end
78
78
 
79
+ # For a message that is about to be written as one line of a log. `sanitize` leaves CR and LF alone,
80
+ # which is right for a message an application stores or re-raises, but a peer that puts a newline in
81
+ # one writes a second log line of its own — formatted and indented like the real ones. Escape them,
82
+ # and the rest of the control characters with them.
83
+ def one_line(text)
84
+ sanitize(text)&.gsub(/[[:cntrl:]]/) { |character| character.dump[1..-2] }
85
+ end
86
+
79
87
  def sanitize(message)
80
88
  return nil if message.nil?
81
89
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotcell-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Dalessio
@@ -10,12 +10,9 @@ cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: |
13
- HotCell runs untrusted media conversion in an unprivileged sibling container with no network,
14
- reached over a Unix socket that carries file descriptors rather than paths or bytes.
15
-
16
- This gem holds what both sides must agree on: the request and response format, SCM_RIGHTS
17
- marshalling, descriptor access-mode verification, payload validation, and the error taxonomy.
18
- It performs no I/O of its own and loads no media library.
13
+ The wire protocol between an application and a HotCell container: the request and response format,
14
+ file descriptor passing over SCM_RIGHTS, payload validation, and the error taxonomy. Both
15
+ hotcell-client and hotcell-server depend on it. Install one of those rather than this.
19
16
  email:
20
17
  - mike@37signals.com
21
18
  executables: []
@@ -46,8 +43,8 @@ licenses:
46
43
  - MIT
47
44
  metadata:
48
45
  homepage_uri: https://github.com/basecamp/hotcell
49
- source_code_uri: https://github.com/basecamp/hotcell/tree/v0.1.0/hotcell-core
50
- changelog_uri: https://github.com/basecamp/hotcell/blob/v0.1.0/CHANGELOG.md
46
+ source_code_uri: https://github.com/basecamp/hotcell/tree/v0.2.0/hotcell-core
47
+ changelog_uri: https://github.com/basecamp/hotcell/blob/v0.2.0/CHANGELOG.md
51
48
  bug_tracker_uri: https://github.com/basecamp/hotcell/issues
52
49
  rubygems_mfa_required: 'true'
53
50
  rdoc_options: []