Git Product home page Git Product logo

gochro's Introduction

firefart

that austrian security guy

Twitter Linkedin Email

FireFart's GitHub stats

Top Langs

gochro's People

Contributors

dependabot[bot] avatar firefart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gochro's Issues

Args by url parameters.

I have an issue where i need to pass --print-to-pdf-no-header to Chromium,
It would be great if it was possible to pass values to args via the request URL.
Something like: /html2pdf?w=1024&h=768&print-to-pdf-no-header=true

gochro/main.go

Line 142 in b5c0792

func (app *application) execChrome(ctxMain context.Context, action, url string, w, h *int, userAgent *string) ([]byte, error) {

Failed to connect to the bus

Hi, I have noticed this strange error log in gochro container. It is occurring on every request. It is even stranger that gochro returns correct PDF with response 200 ๐Ÿ˜„ .

Do you have some hint what is going on inside? I am using headless mode with seccomp profile.

time="2023-12-11T22:11:50Z" level=debug msg="number of goroutines: 5"
time="2023-12-11T22:11:53Z" level=debug msg="number of goroutines: 5"
time="2023-12-11T22:11:55Z" level=debug msg="going to call chromium with the following args: [--headless=new --disable-gpu --disable-software-rasterizer --virtual-time-budget=55000 --disable-dev-shm-usage --hide-scrollbars --disable-crash-reporter --block-new-web-contents --enable-logging --v=1 --ignore-certificate-errors --print-to-pdf --no-pdf-header-footer /tmp/pdf.4137431764.html]"
time="2023-12-11T22:11:55Z" level=debug msg="STDOUT: "
time="2023-12-11T22:11:55Z" level=debug msg="STDERR: [2354:2374:1211/221155.451578:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[2354:2377:1211/221155.458716:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[2354:2377:1211/221155.458902:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[2354:2374:1211/221155.461941:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are \"tcp\" and on UNIX \"unix\")
[2354:2374:1211/221155.462025:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are \"tcp\" and on UNIX \"unix\")
[2354:2374:1211/221155.462183:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are \"tcp\" and on UNIX \"unix\")
[2354:2374:1211/221155.462249:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are \"tcp\" and on UNIX \"unix\")
[2354:2354:1211/221155.466591:ERROR:policy_logger.cc(157)] :components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc(163) Cloud management controller initialization aborted as CBCM is not enabled.
[2354:2374:1211/221155.479960:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are \"tcp\" and on UNIX \"unix\")
[2354:2374:1211/221155.480024:ERROR:bus.cc(407)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are \"tcp\" and on UNIX \"unix\")
[2354:2438:1211/221155.591215:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[2354:2438:1211/221155.591326:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[2354:2438:1211/221155.591663:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[2354:2438:1211/221155.591730:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[2354:2438:1211/221155.591781:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
37576 bytes written to file output.pdf
"
time="2023-12-11T22:11:55Z" level=error msg="os: process already released"
10.0.1.29 - - [11/Dec/2023:22:11:55 +0000] "POST /html2pdf HTTP/1.1" 200 37576 "" "python-requests/2.31.0"
time="2023-12-11T22:11:56Z" level=debug msg="number of goroutines: 5"
time="2023-12-11T22:11:59Z" level=debug msg="number of goroutines: 5"

[Request] Full document's height capture

Hi,

I was wondering if there is a way to get a capture of the whole URL, not just cropped to provided height, or if it's going to be implemented.

Otherwise, thanks, it works perfectly !

Features suggestion

Hi,

It's a great job you've done.
Some feature suggestions that might be great to implement in the future:

  1. Argument to ignore cookies: to avoid GDPR popups
  2. Argument to specify the browser language (Accept-Language) in the request
  3. Export as a PNG
  4. Argument to set the user agent

Cheers,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.