CARVIEW |
Select Language
HTTP/2 302
date: Wed, 23 Jul 2025 17:16:28 GMT
content-type: text/html; charset=utf-8
content-length: 0
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
location: https://release-assets.githubusercontent.com/github-production-release-asset/930794416/3fc587ab-93e3-4bf6-862a-affdf668d666?sp=r&sv=2018-11-09&sr=b&spr=https&se=2025-07-23T18%3A13%3A40Z&rscd=attachment%3B+filename%3DLuaShip.lua&rsct=application%2Foctet-stream&skoid=96c2d410-5711-43a1-aedd-ab1947aa7ab0&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skt=2025-07-23T17%3A13%3A00Z&ske=2025-07-23T18%3A13%3A40Z&sks=b&skv=2018-11-09&sig=q1fo0wdtDkrIMezlT1GmWY605UoXHgguOANWrYOHmnY%3D&jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmVsZWFzZS1hc3NldHMuZ2l0aHVidXNlcmNvbnRlbnQuY29tIiwia2V5Ijoia2V5MSIsImV4cCI6MTc1MzI5MTI4OCwibmJmIjoxNzUzMjkwOTg4LCJwYXRoIjoicmVsZWFzZWFzc2V0cHJvZHVjdGlvbi5ibG9iLmNvcmUud2luZG93cy5uZXQifQ.q1VKOcBrbHKpmut8hcWcWYG4TVmxS3cKiq2Rx960-60&response-content-disposition=attachment%3B%20filename%3DLuaShip.lua&response-content-type=application%2Foctet-stream
cache-control: no-cache
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
x-github-request-id: C21A:124FF4:F1055E:11D0C65:688118EC
HTTP/2 200
last-modified: Wed, 12 Feb 2025 03:42:29 GMT
etag: "0x8DD4B1746A30B58"
server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: 226a0694-501e-006a-4af5-fb397d000000
x-ms-version: 2018-11-09
x-ms-creation-time: Wed, 12 Feb 2025 03:42:29 GMT
x-ms-blob-content-md5: WboNZ9dmqv27A16QcXQKoA==
x-ms-lease-status: unlocked
x-ms-lease-state: available
x-ms-blob-type: BlockBlob
x-ms-server-encrypted: true
via: 1.1 varnish, 1.1 varnish
accept-ranges: bytes
age: 0
date: Wed, 23 Jul 2025 17:16:28 GMT
x-served-by: cache-iad-kjyo7100112-IAD, cache-bom-vanm7210056-BOM
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-timer: S1753290989.579129,VS0,VE310
content-disposition: attachment; filename=LuaShip.lua
content-type: application/octet-stream
content-length: 9418
function PrivateDarwing_parse_to_bytes(seq)
local buffer = {}
for i = 1, #seq do
buffer[#buffer + 1] = string.char(seq[i])
end
return buffer
end
PRIVATE_DARWIN_lua_ship_SO_INCLUDED = {}
private_lua_ship = {}
private_lua_ship_machine_methods = {}
if io then
if io.open then
private_lua_ship.open = io.open
end
end
if os then
if os.execute then
private_lua_ship.os_execute = os.execute
end
if os.remove then
private_lua_ship.os_remove = os.remove
end
end
private_lua_ship.error = error
if string then
private_lua_ship.string = string
end
private_lua_ship.create_machine = function(start_image)
local self_obj = {}
self_obj.provider = "docker"
self_obj.docker_file = "FROM " .. start_image .. "\n"
self_obj.add_comptime_command = function(command)
private_lua_ship_machine_methods.add_comptime_command(self_obj, command)
end
self_obj.add_runtime_command = function(command)
private_lua_ship_machine_methods.add_runtime_command(self_obj, command)
end
self_obj.copy = function(host_data, machine_dest)
private_lua_ship_machine_methods.copy(self_obj, host_data, machine_dest)
end
self_obj.save_to_file = function(filename)
private_lua_ship_machine_methods.save_to_file(self_obj, filename)
end
self_obj.build = function(name)
return private_lua_ship_machine_methods.build(self_obj, name)
end
self_obj.start = function(props)
private_lua_ship_machine_methods.start(self_obj, props)
end
return self_obj
end
private_lua_ship_machine_methods.add_comptime_command = function(self_obj, command)
self_obj.docker_file = self_obj.docker_file .. "RUN " .. command .. "\n"
end
private_lua_ship_machine_methods.add_runtime_command = function(self_obj, command)
self_obj.docker_file = self_obj.docker_file .. "CMD " .. command .. "\n"
end
private_lua_ship_machine_methods.env = function(self_obj, key, value)
self_obj.docker_file = self_obj.docker_file .. "ENV " .. key .. " " .. value .. "\n"
end
private_lua_ship_machine_methods.copy = function(self_obj, host_data, machine_dest)
self_obj.docker_file = self_obj.docker_file .. "COPY " .. host_data .. " " .. machine_dest .. "\n"
end
private_lua_ship_machine_methods.save_to_file = function(self_obj, filename)
private_lua_ship.open(filename, "w"):write(self_obj.docker_file):close()
end
private_lua_ship_machine_methods.build = function(self_obj, name)
if not name then
name = "sha" .. private_lua_ship.sha256(self_obj.docker_file)
end
local filename = name .. ".Dockerfile"
private_lua_ship_machine_methods.save_to_file(self_obj, filename)
local command = self_obj.provider .. " build -t " .. name .. " -f " .. filename .. " . --quiet "
local ok = private_lua_ship.os_execute(command)
if not ok then
private_lua_ship.error("unable to execute command:\n" .. command)
end
private_lua_ship.os_remove(filename)
return name
end
private_lua_ship_machine_methods.start = function(self_obj, props)
if not props.rebuild then
props.rebuild = true
end
local name = props.name
if props.rebuild then
name = private_lua_ship_machine_methods.build(self_obj, props.name)
end
if not props.flags then
props.flags = {}
end
local command = self_obj.provider .. " run "
for i = 1, #props.flags do
local current_flag = props.flags[i]
command = command .. current_flag .. " "
end
if not props.volumes then
props.volumes = {}
end
for i = 1, #props.volumes do
local current_volume = props.volumes[i]
command = command .. "-v " .. current_volume[1] .. ":" .. current_volume[2] .. ":z "
end
command = command .. name
if props.command then
local formmated = private_lua_ship.string.gsub(props.command, "'", "'\\''")
command = command .. " sh -c '" .. formmated.."'"
end
local ok = private_lua_ship.os_execute(command)
if not ok then
private_lua_ship.error("unable to execute command:\n" .. command)
end
end
--[[
Author: OGabrieLima
GitHub: https://github.com/OGabrieLima
Discord: ogabrielima
Description: This is a Lua script that implements the SHA-256 algorithm to calculate the hash of a message.
It includes a helper function for right rotation (bitwise) and the main function `sha256`.
The `sha256` function can be used to calculate the SHA-256 hash of a message.
Creation Date: 2024-04-08
]]
-- Auxiliary function: right rotation (bitwise)
local function bit_ror(x, y)
return ((x >> y) | (x << (32 - y))) & 0xFFFFFFFF
end
-- Main function: SHA256
private_lua_ship.sha256 = function(message)
local k = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
}
local function preprocess(message)
local len = #message
local bitLen = len * 8
message = message .. "\128" -- append single '1' bit
local zeroPad = 64 - ((len + 9) % 64)
if zeroPad ~= 64 then
message = message .. string.rep("\0", zeroPad)
end
-- append length
message = message .. string.char(
bitLen >> 56 & 0xFF,
bitLen >> 48 & 0xFF,
bitLen >> 40 & 0xFF,
bitLen >> 32 & 0xFF,
bitLen >> 24 & 0xFF,
bitLen >> 16 & 0xFF,
bitLen >> 8 & 0xFF,
bitLen & 0xFF
)
return message
end
local function chunkify(message)
local chunks = {}
for i = 1, #message, 64 do
table.insert(chunks, message:sub(i, i + 63))
end
return chunks
end
local function processChunk(chunk, hash)
local w = {}
for i = 1, 64 do
if i <= 16 then
w[i] = string.byte(chunk, (i - 1) * 4 + 1) << 24 |
string.byte(chunk, (i - 1) * 4 + 2) << 16 |
string.byte(chunk, (i - 1) * 4 + 3) << 8 |
string.byte(chunk, (i - 1) * 4 + 4)
else
local s0 = bit_ror(w[i - 15], 7) ~ bit_ror(w[i - 15], 18) ~ (w[i - 15] >> 3)
local s1 = bit_ror(w[i - 2], 17) ~ bit_ror(w[i - 2], 19) ~ (w[i - 2] >> 10)
w[i] = (w[i - 16] + s0 + w[i - 7] + s1) & 0xFFFFFFFF
end
end
local a, b, c, d, e, f, g, h = table.unpack(hash)
for i = 1, 64 do
local s1 = bit_ror(e, 6) ~ bit_ror(e, 11) ~ bit_ror(e, 25)
local ch = (e & f) ~ ((~e) & g)
local temp1 = (h + s1 + ch + k[i] + w[i]) & 0xFFFFFFFF
local s0 = bit_ror(a, 2) ~ bit_ror(a, 13) ~ bit_ror(a, 22)
local maj = (a & b) ~ (a & c) ~ (b & c)
local temp2 = (s0 + maj) & 0xFFFFFFFF
h = g
g = f
f = e
e = (d + temp1) & 0xFFFFFFFF
d = c
c = b
b = a
a = (temp1 + temp2) & 0xFFFFFFFF
end
return (hash[1] + a) & 0xFFFFFFFF,
(hash[2] + b) & 0xFFFFFFFF,
(hash[3] + c) & 0xFFFFFFFF,
(hash[4] + d) & 0xFFFFFFFF,
(hash[5] + e) & 0xFFFFFFFF,
(hash[6] + f) & 0xFFFFFFFF,
(hash[7] + g) & 0xFFFFFFFF,
(hash[8] + h) & 0xFFFFFFFF
end
message = preprocess(message)
local chunks = chunkify(message)
local hash = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }
for _, chunk in ipairs(chunks) do
hash = { processChunk(chunk, hash) }
end
local result = ""
for _, h in ipairs(hash) do
result = result .. string.format("%08x", h)
end
return result
end
return private_lua_ship
---@class LuaShipStartProps
---@class flags string[]
---@class volumes string[]string[]
---@class command string
---@class LuaShipMachine
---@field provider "podman"| "docker"
---@field docker_file string
---@field add_comptime_command fun(command:string)
---@field copy fun(host_data:string,dest_data:string)
---@field env fun(name:string,value:string)
---@field save_to_file fun(filename:string)
---@field start fun(props:LuaShipStartProps)
---@class LuaShip
---@field create_machine fun(distro:string):LuaShipMachine
---@field open fun(filename:string,mode:string)
---@field os_execute fun(command:string):boolean
---@field os_remove fun(filename:string)
---@field error fun(errror:string)