Commit Graph

25 Commits

Author SHA1 Message Date
lwthiker
7a043aac03 Merge pull request #217 from lwthiker/upgrade-boringssl
Upgrade BoringSSL version
2024-03-02 19:16:20 +02:00
lwthiker
6d04ffee27 Use an even newer version of BoringSSL
Use the latest 'chromium-stable' tag, which has fixes for compiling with
gcc 13.
2024-02-29 22:38:23 +02:00
lwthiker
d90993cf06 Fix Docker build missing websocket support
The Docker image first builds a static curl-impersonate, then builds
libcurl-impersonate separately. However, the second build overrode the
binary created in the first one, and was configured without websocket
support in addition. This commit fixes both:
* The second build does not override the first, static build.
* The second build is configured with websockets.
2024-02-27 20:13:34 +02:00
lwthiker
c1b278e671 Upgrade BoringSSL version
Upgrade to commit d24a38200fef19150eef00cad35b138936c08767, which is the
current 'chromium-stable' tag.
2024-02-10 19:55:59 +02:00
lwthiker
d050701b7c Build curl with websocket support
Enable curl's websocket handling with --enable-websockets.
2023-09-16 11:18:45 +03:00
Alexandre Alapetite
172f5185cc Update Docker base images (#168)
Update Docker base images to debian bookworm.
Reduce size of Debian image (remove apt cache) by 10MB
And also minor Markdown lint of INSTALL.md

---------

Co-authored-by: lwthiker <lwt@lwthiker.com>
2023-09-16 11:16:41 +03:00
lwthiker
b0c725fcf5 Upgrade nss to 3.92 (#176)
The nss version currently in use does not build with gcc 13. Upgrade to
nss 3.92.
2023-09-15 18:07:51 +03:00
lwthiker
d48a572344 Upgrade baseline curl to 8.1.1 (#160)
* Upgrade baseline curl to 8.1.1

New curl version includes bugfixes, new options but mainly websocket
support which was long requested in curl impersonate. Upstream curl
reworked a lot of their http2 code which necessitated a lot of changes
on our side as well.

* Fix build on mac due to bad header priorities

On macos, clang gives priority to /usr/local/include
over locations specified with -isystem for some unknown reason. In turn
this causes clang to use the system's openssl, which conflicts with
curl-impersonate's boringssl headers.
To prevent that, disable curl's automatic conversion of -I flags to
-isystem.

* Upgrade zlib version

* Upgrade GitHub Mac runner to macos-12

* Upgrade nghttp2 version to 1.56.0

curl-8.1.1 uses an nghttp2 function that only exists in newer versions
of nghttp2.
2023-09-15 17:46:02 +03:00
Dawid Wróbel
f8be027a2a Dockerfile: use bullseye as Debian base 2022-10-05 17:11:24 +02:00
lwthiker
a87d3d9d52 Install ca-certificates in the Debian containers 2022-07-30 09:37:23 +03:00
lwthiker
c90b33a605 Run ldconfig in Debian Docker images only 2022-07-29 21:58:38 +03:00
lwthiker
8f19c20868 Run 'ldconfig' in Docker images
Run ldconfig to update the loader's cache. This is necessary
specifically on the Debian image since we put .so files in /usr/local.
2022-07-29 21:05:29 +03:00
lwthiker
6eaf8fafa3 Minimize Docker image size with multi-stage build
Minimize the size of the resulting Docker image size by using
multi-stage build and copying the resulting binaries into a minimal
Debian system. This was done with the Alpine Docker images up until now
but not with the Debian images.
2022-07-29 19:49:00 +03:00
lwthiker
fffab4bcc1 Update upstream curl version to 7.84 2022-07-17 16:44:22 +03:00
izzues
0b3d593bfd Use portable shebangs in wrapper scripts (#79)
This is the recommended approach and it's necessary on systems like NixOS.

See: https://web.archive.org/web/20220617225709/https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my
2022-06-22 20:37:10 +03:00
lwthiker
92a5b8c7ab Add support for impersonating Firefox 100
Add support for impersonating Firefox 100. The TLS signature is identical to
previous versions of Firefox.

In addition, upgrade NSS (Firefox's TLS library) to version 3.77 used by
Firefox 100. This is not strictly necessary as the previous version used
works just fine, but it's better keep up with the newest version.
2022-05-15 20:50:45 +03:00
lwthiker
59209c19c7 Add support for linking NSS statically on macOS
This is an attmept to link with NSS statically on macOS (both Intel and
 Apple M1).

 Statically linking with NSS is a total mess and completely
undocumented. There are 20+ .a files to link with, and their linking
order matters. The main reference for this commit is a Mozilla Rust code
responsible for statically linking NSS:

    b2690fd2e4/components/support/rc_crypto/nss/nss_b    uild_common/src/lib.rs#L94

Unfortunately, even with that in hand, a lot of hacking is needed to
make it all work.
2022-04-30 13:56:16 +03:00
lwthiker
f320cecdfd Ensure 'curl-impersonate' is compiled correctly
Add a few commands to the Dockerfile to check that 'curl-impersonate'
was compiled correctly: Check that it has brotli, http2 and tls support,
and check that the dependencies were compiled statically.

These are basic checks which are useful when modifying the Dockerfile:
Sometimes even small modifications cause curl to be compiled
incorrectly but without failing the build.
2022-04-17 17:23:20 +03:00
lwthiker
d7ed859ad0 Change nghttp2 link flags to support macOS
Previously '-l:nghttp2.a' was used to specify static linking with
nghttp2 and to stop the linker from linking dynamically with
libnghttp2.so. This way of linking is not supported on macOS. Instead,
add '--disable-shared' to prevent libnghttp2.so from even being
compiled. This way the linker will find the static library only and link
against it.
2022-04-17 17:01:15 +03:00
lwthiker
8ffeb3ca56 Change binary names as part of curl's build
Change the binary names of curl and libcurl as part of the curl build
process by patching curl's build scripts. When running 'make' in the
patched curl directory the resulting binaries will be already named
'curl-impersonate-ff' and 'curl-impersonate-chrome' (and the same for
libcurl), thus saving the need for manually renaming them after the
compilation. This also enables running 'make install' with curl's own
Makefiles in order to install curl-impersonate.
2022-04-11 17:59:51 +03:00
lwthiker
22508c6863 Use different binary names for Firefox and Chrome
Rename the binary files of curl-impersonate so that the Firefox and
Chrome versions can co-exist on the same system. The Firefox version is
now named 'curl-impersonate-ff' and 'libcurl-impersonate-ff' and the
Chrome version is named 'curl-impersonate-chrome' and
'libcurl-impersonate-chrome'. The wrapper scripts look for these names
as well. Symbolic names with the old names are still created inside the
Docker images to keep compatibility as much as possible.
2022-04-08 19:10:35 +03:00
lwthiker
768e37d194 Impersonate Firefox 98
Add support for impersonating Firefox 98 released a few days ago. It has
the same TLS signature as Firefox 95 so the adaptation includes changing
the user-agent only. Upgrade the NSS version used to 3.75, even though
it's not strictly necessary.
2022-03-12 10:44:24 +02:00
lwthiker
4ea8f859eb Install nss in final alpine image
Add 'apk add nss' for the final alpine image of the Firefox version of
curl-impersonate. This is needed for curl to find the list of root
certificates.
2022-03-10 13:17:31 +02:00
lwthiker
eaeb619fa7 Add Alpine Linux build system
Add Dockerfiles for building curl-impersonate on Alpine Linux.

The Dockerfile template file was modified to support Alpine Linux,
mainly by changing the dependency installation from 'apt' to 'apk'.
The resulting alpine images are small (~11mb) and will be uploaded to
Docker hub.
2022-03-10 11:57:53 +02:00
lwthiker
d1dbfc89c5 Use a template for generating Dockerfiles
Since the firefox and chrome builds are similar except for the TLS
library used, it makes sense to unify their Dockerfiles. This commit
introduces a template Dockerfile from which both the build Dockerfiles
are generated using the simple 'mustache' template system.
2022-03-09 11:01:44 +02:00