{"id":104506,"date":"2022-06-25T15:36:47","date_gmt":"2022-06-25T13:36:47","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv"},"modified":"2022-06-25T15:36:47","modified_gmt":"2022-06-25T13:36:47","slug":"redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv","status":"publish","type":"post","link":"https:\/\/prohoster.info\/pt\/blog\/news\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv","title":{"rendered":"Redbean 2.0 \u2014 uma plataforma para web aplicativos, empacotados em um arquivo ZIP execut\u00e1vel universal","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Foi lan\u00e7ada a vers\u00e3o 2.0 do projeto Redbean, que oferece um servidor web capaz de fornecer aplica\u00e7\u00f5es web na forma de um arquivo execut\u00e1vel universal que pode ser executado em Linux, Windows, MacOS, FreeBSD, NetBSD e OpenBSD. Todos os recursos associados \u00e0 aplica\u00e7\u00e3o web e ao servidor s\u00e3o incorporados em um \u00fanico arquivo execut\u00e1vel, que \u00e9 compat\u00edvel com o formato de arquivo ZIP e permite o uso da ferramenta zip para adicionar arquivos adicionais. A capacidade de executar um \u00fanico arquivo em diferentes sistemas operacionais e seu reconhecimento como um arquivo ZIP \u00e9 alcan\u00e7ada atrav\u00e9s de manipula\u00e7\u00f5es nos cabe\u00e7alhos dos arquivos execut\u00e1veis e da vincula\u00e7\u00e3o com a biblioteca padr\u00e3o em C multiplataforma Cosmopolitan. O c\u00f3digo do projeto \u00e9 distribu\u00eddo sob a licen\u00e7a ISC.      <\/p>\n<p>A ideia do projeto \u00e9 fornecer um \u00fanico arquivo execut\u00e1vel &#171;redbean.com&#187; com um servidor web embutido. O desenvolvedor de aplicativos web pode usar a ferramenta zip para adicionar arquivos HTML e Lua a este arquivo e obter como resultado um aplicativo web autossuficiente, que pode ser executado em todos os sistemas operacionais populares e n\u00e3o requer a execu\u00e7\u00e3o de um servidor web separado no sistema.         <\/p>\n<p>Ap\u00f3s a execu\u00e7\u00e3o do arquivo execut\u00e1vel gerado, um servidor web embutido \u00e9 usado para acessar a aplica\u00e7\u00e3o web salva no arquivo. Por padr\u00e3o, o manipulador \u00e9 anexado ao localhost, mas o servidor tamb\u00e9m pode ser usado como um servidor web p\u00fablico comum (por exemplo, este servidor hospeda o site do projeto). O servidor web embutido suporta acessos via HTTPS e pode ser executado utilizando isolamento sandbox, permitindo controlar quais interfaces do sistema s\u00e3o acessadas. Para gerenciar a opera\u00e7\u00e3o do servidor durante sua execu\u00e7\u00e3o, \u00e9 fornecida uma interface interativa REPL (baseada em Lua REPL e na biblioteca bestline, an\u00e1loga ao GNU Readline), que permite alterar o estado do processo em modo interativo.      <\/p>\n<p>Afirma-se que o servidor web \u00e9 capaz de processar mais de um milh\u00e3o de solicita\u00e7\u00f5es por segundo em um PC comum, entregando conte\u00fado comprimido com o m\u00e9todo gzip. O alto desempenho \u00e9 favorecido pelo fato de que zip e gzip utilizam um formato comum, assim, os dados s\u00e3o entregues sem reempacotamento a partir de \u00e1reas j\u00e1 compactadas no arquivo zip. Al\u00e9m disso, como o arquivo execut\u00e1vel \u00e9 criado usando vincula\u00e7\u00e3o est\u00e1tica e tem um tamanho pequeno, a chamada da fun\u00e7\u00e3o fork praticamente n\u00e3o gera custos adicionais ao ser alocado na mem\u00f3ria.       <\/p>\n<p>Al\u00e9m de processar conte\u00fado web est\u00e1tico e executar JavaScript no navegador, a l\u00f3gica do aplicativo web pode ser expandida com scripts em Lua, o framework web Fullmoon e o banco de dados SQLite. Entre os recursos adicionais, destaca-se o suporte para o esquema de hash de senhas argon2, a capacidade de definir a regi\u00e3o IP com base na base de dados MaxMind e o acesso \u00e0 API Unix da biblioteca Cosmopolitan. O tamanho da pilha base, que inclui o servidor web, MbedTLS, Cosmopolitan, Lua e SQLite, \u00e9 de apenas 1,9 MB.     <\/p>\n<p>Um arquivo execut\u00e1vel universal \u00e9 formado pela combina\u00e7\u00e3o de segmentos e cabe\u00e7alhos espec\u00edficos para diferentes sistemas operacionais (PE, ELF, MACHO, OPENBSD, ZIP) em um \u00fanico arquivo. Para garantir a execu\u00e7\u00e3o de um \u00fanico arquivo execut\u00e1vel em sistemas Windows e Unix, \u00e9 aplicada uma t\u00e9cnica que consiste na codifica\u00e7\u00e3o de arquivos Windows PE na forma de um shell script, aproveitando o fato de que o Thompson Shell n\u00e3o utiliza o marcador de scripts &#171;#!&#187;. Como resultado, cria-se um arquivo execut\u00e1vel que combina v\u00e1rios formatos diferentes utilizados no Linux, BSD, Windows e macOS.         $ curl https:\/\/redbean.dev\/redbean-demo-2.0.7.com &gt;redbean.com     $ chmod +x redbean.com       $ zip redbean.com hello.html     $ zip redbean.com hello.lua        $ .\/redbean.com -vv     I2022-06-23T08:27:14+000767:redbean] (srvr) listen   http:\/\/127.0.0.1:8080     &gt;: waiting for command\u2026       $ curl https:\/\/127.0.0.1:8080\/hello.html     hello          $ printf \u2018GET \/hello.lua\n\n\u2019 | nc 127.0.0.1 8080     hello        <center>  <video id=\"video\"  controls=\"\" style=\"width: 700px; height: 350px; max-width:100%\"><source src=\"https:\/\/storage.googleapis.com\/justine\/redbean2\/redbean-2.0-demo.mp4\" type=\"video\/mp4\"><\/video><\/center>    <\/center><br \/>\n<br \/>Fonte: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=57407\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Redbean 2.0, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0435\u0433\u043e web-\u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 Linux, Windows, MacOS, FreeBSD, NetBSD \u0438 OpenBSD. \u0412\u0441\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c \u0430\u0440\u0445\u0438\u0432\u043e\u0432 ZIP \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 zip \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-104506","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Redbean 2.0, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0435\u0433\u043e web-\u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 Linux, Windows, MacOS, FreeBSD, NetBSD.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/pt\/blog\/news\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"pt_PT\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47Redbean 2.0 \u2014 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 ZIP-\u0430\u0440\u0445\u0438\u0432 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Redbean 2.0, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0435\u0433\u043e web-\u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 Linux, Windows, MacOS, FreeBSD, NetBSD.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/pt\/blog\/news\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2022-06-25T13:36:47+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-06-25T13:36:47+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Redbean 2.0 \u2014 plataforma para aplicativos web empacotados em um arquivo ZIP execut\u00e1vel universal | ProHoster","description":"Foi lan\u00e7ado o projeto Redbean 2.0, que oferece um servidor web que permite a entrega de aplicativos web na forma de um arquivo execut\u00e1vel universal, que pode ser executado em Linux, Windows, MacOS, FreeBSD e NetBSD.","canonical_url":"https:\/\/prohoster.info\/pt\/blog\/news\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"pt_PT","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47Redbean 2.0 \u2014 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 ZIP-\u0430\u0440\u0445\u0438\u0432 | ProHoster","og:description":"\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Redbean 2.0, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0435\u0433\u043e web-\u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 Linux, Windows, MacOS, FreeBSD, NetBSD.","og:url":"https:\/\/prohoster.info\/pt\/blog\/news\/redbean-2-0-platforma-dlya-web-prilozhenij-upakovannyh-v-universalnyj-ispolnyaemyj-zip-arhiv","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2022-06-25T13:36:47+00:00","article:modified_time":"2022-06-25T13:36:47+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"104506","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2022-06-25 13:36:54","updated":"2022-09-28 11:49:08","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts\/104506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/comments?post=104506"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/posts\/104506\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/media?parent=104506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/categories?post=104506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/pt\/wp-json\/wp\/v2\/tags?post=104506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}