cron и фикс бага с пнг + защила filer
This commit is contained in:
@@ -54,6 +54,16 @@ def main():
|
||||
+ struct.pack(">I", zlib.crc32(kind + payload) & 0xFFFFFFFF)
|
||||
)
|
||||
|
||||
bad_idat = bytearray(zlib.compress(b"\x00\x10\x20\x30"))
|
||||
bad_idat[-3] ^= 0xFF
|
||||
damaged_idat = (
|
||||
b"\x89PNG\r\n\x1a\n"
|
||||
+ chunk(b"IHDR", struct.pack(">IIBBBBB", 1, 1, 8, 2, 0, 0, 0))
|
||||
+ chunk(b"IDAT", bytes(bad_idat))
|
||||
+ chunk(b"IEND", b"")
|
||||
)
|
||||
upload(client, alice, chat["id"], damaged_idat, expected=415)
|
||||
|
||||
too_many_pixels = (
|
||||
b"\x89PNG\r\n\x1a\n"
|
||||
+ chunk(b"IHDR", struct.pack(">IIBBBBB", 10001, 4000, 8, 2, 0, 0, 0))
|
||||
|
||||
@@ -44,9 +44,25 @@ finally:
|
||||
"""
|
||||
|
||||
PRIVATE_CHECK_CODE = """
|
||||
import socket
|
||||
import sys
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
|
||||
try:
|
||||
socket.getaddrinfo("s3-core", 8888)
|
||||
except socket.gaierror:
|
||||
print("PASS: SeaweedFS master/filer network is isolated")
|
||||
else:
|
||||
raise RuntimeError("API network can resolve the SeaweedFS core service")
|
||||
|
||||
for port in (8181, 9101):
|
||||
try:
|
||||
socket.create_connection(("s3", port), timeout=1).close()
|
||||
except OSError:
|
||||
continue
|
||||
raise RuntimeError("unexpected SeaweedFS gateway interface is reachable on port " + str(port))
|
||||
|
||||
try:
|
||||
urllib.request.urlopen("http://s3:8333/messenger-attachments/", timeout=3)
|
||||
except urllib.error.HTTPError as error:
|
||||
|
||||
Reference in New Issue
Block a user