Documentation
¶
Overview ¶
Package termuxenv prepares a PiG process for Termux on Android.
Termux has no /etc and no /tmp. PiG's Android build links the C library (cgo), so Go resolves names through bionic and trusts Android's system certificates. This package sets the defaults Termux's own tools use, and gives a build without cgo the resolver configuration Go cannot find: without cgo Go's resolver falls back to the name servers 127.0.0.1 and ::1 and every lookup fails (golang/go#8877).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Configure ¶
func Configure()
Configure adapts the process to Termux and does nothing elsewhere. Call it before the first network request or temporary file. It
- sets TMPDIR to $PREFIX/tmp when it is unset, as Termux's profile does;
- sets SSL_CERT_FILE to Termux's CA bundle when it is unset, so TLS trusts the same certificates as Termux's own tools;
- without cgo, replaces net.DefaultResolver with one that reads $PREFIX/etc/resolv.conf when /etc/resolv.conf is missing.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.