Commit graph

170 commits

Author SHA1 Message Date
inqrphl
b9cd60ec3a
add proxy argument and improve dns cache usage (#2209)
* add proxy argument and improve dns cache usage

add proxy argument that useing the -x and --proxy argument. add it to
the static curl config struct, command usage and help outputs of the
cli.

parse these argument together with the environment variables like
http_proxy before setting the CURLOPT_PROXY in the curl configuration
option. this is required, as there is no easy way to ascertain/get what
the CURLOPT_PROXY that libcurl will use. by the point it is set by
libcurl, we have no control over it anymore, and need it for the other
steps in the configuration.

if the CURLOPT_PROXY is set, skip the DNS cache population which would
set the CURLOPT_RESOLVE. this is currently not perfect however. if a
proxy is set with socks4 or socks5 scheme, the host should be resolving
the hostname.

* codespell, clang-format and hints fixes

* add curl version and ssl enabelement macro checks

might fix rocky linux 8 compilation issues.

* add proxy_resolves_hostname, determined by proxy scheme

leave the functions that print out an curl_easyoption, but dont use it. organize the code slightly, print out the final CURLOPT_PROXY and proxy_resolves_hostname flag on verbose mode, add comments

* remove unused handle_curl_easyoption and format_curl_easyoption functions

* fix typo in the proxy argument

* fix typo with proxy scheme socks5a->socks5h

* improve proxy environment parsing

add another argument: --no-proxy , which is used when setting
CURL_NOPROXY

additionally parse all_proxy, ALL_PROXY, no_proxy and NO_PROXY
environment variables in the correct order.

set the curlopt_proxy and curlopt_noproxy of libcurl, and additionally
save them in check_curl_working_state.

add function determine_hostname_resolver, uses the working state and
static config. it can tokenize the no_proxy variable and check for exact
matches, but cannot determine subnet matches for ip addresses yet.

* document proxy cli arguments

clarify and add more examples of proxy environment variables and their
behavior when multiple are specified, overriden etc.

add single wildcard '*' checking for no_proxy to
determine_hostname_resolver, special case per curlopt_noproxy
documentation

* check curlopt_noproxy before accessing it

* switch argument from --no-proxy to --noproxy like curl cli

* check if host name is a subdomain of an noproxy item

* use strdup where destination working_state.curlopt_proxy may be NULL

* add disclaimer about uppercase HTTP_PROXY

* add subdomain checks for each item in the no_proxy, if the target host is a subdomain proxy wont resolve it

add function ip_addr_inside_cidr, use it for checking possible cidr ranges  given in the no_proxy

* wip tests that work on local perl http/https server

* wip tests that work on the live debian image

* fix subnet definition

* make apache2 listen on [::1] for ipv6 tests

* remove squid certificate

* rewrite ip_addr_inside_cidr, split ipv4 and ipv6 parsing path and copy them to a shared buffer later on for prefix check

* Adapt tests for the squid sever, disable checking return code for socks 4/5 proxies. Squid does not support it, and we do not install a capable proxy for these schemes.

* specify localhost acl and allow it through the proxy. used in check_curl tests

* typo in comment

* move function comments to header

* fix failing tests

* handle case where proxy is set as empty string

* removed duplicate tests, corrected wrong comments

* corrected some annotations

* move docker apache subdomain setup files to /tools/subdomain1

* add a newline before dying in handle_curl_option_return_code

* fix the -ssl better, now does not segfault on empty --ssl argument as well.


---------

Co-authored-by: Ahmet Oeztuerk <Ahmet.Oeztuerk@consol.de>
2026-03-13 15:54:23 +01:00
Dirk Mueller
423d0c5267
Fix a few typos (#2231) 2026-02-16 11:21:21 +01:00
Lorenz Kästle
802e46f8ea Run clang-format again 2025-09-15 12:59:37 +02:00
Lorenz Kästle
a8466af86c Remove tinderbox related stuff
Tinderbox ist quite dead (and has been for a while now).
Removing the related files.
2025-02-25 18:01:51 +01:00
Lorenz Kästle
0d0f4ee7e3 Add a comment to opttest to explain the purpose 2025-02-19 19:46:37 +01:00
Lorenz Kästle
b982e12ecf Fix opttest script 2025-02-19 19:43:40 +01:00
Lorenz Kästle
cb5abf1981 opttest.pl: Move to tools 2025-02-19 14:36:37 +01:00
Jan Wagner
0f3703e641 Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
Markus Frosch
198611a3c2 test: Add proxy tests via proxy
On Travis with a local squid
2018-11-06 12:33:24 +01:00
Holger Weiss
5553c0be7c tools/update-thanks: Match case-insensitively
When checking whether an author name already exists in the AUTHORS or
THANKS.in file, perform a case-insensitive match.
2016-11-28 21:44:39 +01:00
Holger Weiss
0a236c7c70 Add tools/update-thanks script
The tools/update-thanks script can be used to update the THANKS.in file.
2014-12-15 22:35:02 +01:00
Sven Nierlein
15f8dab30e tools/generate-change-log: workaround for broken Text::Wrap
workaround for broken Text::Wrap:
"This shouldn't happen at /usr/share/perl/5.18/Text/Wrap.pm line 84."
changing huge to overflow make generating changelogs work again at
the price of not having changelog strictly cut of at 80 columns
anymore. Words longer than 80 characters will now printed in one
line. This mainly affects old sf.net urls.

Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-07-30 15:21:27 +02:00
Sven Nierlein
de6f3dddf6 no need for the signed off messages in our changelog
Signed-off-by: Sven Nierlein <Sven.Nierlein@consol.de>
2014-07-30 15:21:22 +02:00
Holger Weiss
01e570f4a4 Capitalize "Monitoring Plugins"
"Monitoring Plugins" is a name.
2014-01-21 16:19:20 +01:00
Holger Weiss
a8c9b696f4 Minor fixes to be amended into "rename" commit 2014-01-20 03:01:55 +01:00
Monitoring Plugins Development Team
63734f52ab Project rename initial commit.
This is an initial take at renaming the project to Monitoring Plugins.
It's not expected to be fully complete, and it is expected to break
things (The perl module for instance). More testing will be required
before this goes mainline.
2014-01-19 14:18:47 -05:00
Jan Wagner
c54625ecc1 tools: Update CVS references
We moved our stuff from CVS/SourceForge to Git/GitHub.
2013-10-02 09:54:15 +02:00
Holger Weiss
4ad0f80ec3 Add tools/generate-change-log
Add the tools/generate-change-log script for auto-generating the
ChangeLog file from the Git history when running "make dist".
2013-09-28 00:58:02 +02:00
Holger Weiss
9ae1cd8f91 tools: Remove Drupal/SourceForge scripts
We moved our web site away from Drupal and the snapshots/guidelines away
from SourceForge.  The new infrastructure scripts will be maintained in
a separate repository together with the Markdown source of the new web
site.
2013-09-27 23:10:53 +02:00
Holger Weiss
983d10e060 Remove tools/git2svn.pl
We no longer mirror out Git repositories into Subversion.
2013-09-27 22:43:08 +02:00
Holger Weiss
ba7615631a Merge branch 'hw/update-pm'
* hw/update-pm:
  Use own variable instead of ENV
  Updated with last working copy of build_perl_modules used by Opsview

Conflicts:
	tools/build_perl_modules
2013-08-30 18:15:00 +02:00
Ton Voon
af85216c79 Use own variable instead of ENV 2013-08-23 17:13:09 +01:00
Ton Voon
ed9a0f3a7b Updated with last working copy of build_perl_modules used by Opsview 2013-08-23 15:17:17 +01:00
Sven Nierlein
fae168a68b perlmods: fixed install_order
on older systems Module::Build is not available by default, therefore we have
to change the order of installation.
2013-08-23 12:40:55 +02:00
Ton Voon
ae8ff32eac Updated perl modules 2013-08-21 00:20:30 +01:00
Holger Weiss
f7bc3a0965 Update the bundled Params::Validate module
Building the old version fails with recent Perl releases:

| Validate.xs: In function `get_type':
| Validate.xs:208:5: error: duplicate case value
| Validate.xs:205:5: error: previously used here
2013-08-20 23:47:01 +02:00
Thomas Guyot-Sionnest
217a6a7643 Fix sfwebcron probe file
The initial file was created in the user's home and later tested in the
doc directory. Instead, just rsync if the file is missing.

Also add some temporary files to gitignore/make clean
2012-11-07 17:57:37 +00:00
dermoth
d51f87cc79 Update tools
- fix sfwebcron (tool updating sf developer guidelines)
- remove obsolete snapshot script
2012-11-03 22:04:53 +00:00
dermoth
42a7b3d6d6 Add scripts that update man pages in drupal 2012-11-03 19:07:40 +00:00
Thomas Guyot-Sionnest
fdd0028be1 Update the README text 2011-01-01 16:21:56 -05:00
Thomas Guyot-Sionnest
654086f111 sfsnapshotgit: Better handling of remote refs
This commit allow to track branches from unusually-named remote refs and
makes possible using external remotes (other than origin) for snapshots.
2010-10-11 21:38:42 -04:00
Ton Voon
9bab433981 Added text re: MD5SUM updates in nightlies, but tarballs not 2010-07-14 14:22:04 +01:00
Holger Weiss
319e308521 git-notify: Be careful with "--no-merge"
The "-X" option (which asks git-notify to not report merge commits) was
implemented by setting the "--no-merge" option on each invocation of
git-rev-list(1).  However, we do not only use git-rev-list(1) to get the
list of new commits, but also to check whether the old branch head (or
tag) is a parent of the new branch head (or tag).  For this latter
check, the "--no-merge" option should not be set; otherwise, git-notify
would be fooled to believe that the branch has been rewritten if the old
head was a merge commit.
2010-07-02 15:28:35 +02:00
Thomas Guyot-Sionnest
b48c2bdd59 tools/distclean: use git-clean when possible
git-clean is much faster and more reliable...

Also add confdefs.h in gitignore, although this file is normally removed
at the end of the configure script.
2010-04-28 05:28:22 -04:00
Holger Weiss
ee06edc646 git-notify: Fix the ordering of commits
If notifications for multiple commits are created, sort them
chronologically instead of in reverse chronological order.
2010-04-14 16:22:21 +02:00
Thomas Guyot-Sionnest
74da141e61 Sync with the latest Gnulib code (177f525)
Signed-off-by: Thomas Guyot-Sionnest <dermoth@aei.ca>
2010-04-12 21:26:35 -04:00
Holger Weiss
45e205f4a6 git-notify: Pipe e-mails directly to sendmail(8)
Use sendmail(8) instead of mail(1) in order to be able to set the
"Content-Type" header field on systems where the available mail(1)
command doesn't allow for setting it.  This makes the "-H" flag (cf.
commit 71350c5a) unnecessary.
2009-12-07 01:58:21 +01:00
Holger Weiss
78fc8f4909 Enable CIA's commit notifications
We now use CIA's service to send commit notifications to IRC.  They are
currently sent to the #Nagios-Devel channel on Freenode.  See:

	http://cia.vc/stats/project/nagiosplug/
	http://cia.vc/account/bots/15699/
2009-12-06 01:23:41 +01:00
Ton Voon
4b2265d20c Updated link to sfsnapshotgit 2009-11-19 21:55:18 +00:00
Thomas Guyot-Sionnest
175b2c8703 Fix fetching of remote branches 2009-11-11 09:53:35 -05:00
dermoth
bb193973a8 Many fixes to snapshot scripts
sfsnapshotgit:
  - Use fetch/reset instead to pull to avoid merges on forced updates

sfsnapshot-upload:
  - Fix link deletion walking the entire home dir
	- Allow CLEAN_TIME=0 (no retention)
	- Re-add per-branch links when CLEAN_TIME > 0
	- Add many comments
2009-11-11 10:34:22 +00:00
Holger Weiss
2b442ff177 Git commit notifications via post-receive hook
Now that we moved our Git repositories to SourceForge, we don't need to
maintain local clones for generating commit notifications anymore, as
SourceForge provides shell access to the repositories.  Instead, we now
run git-notify as a post-receive hook on the SourceForge server.
Actually, we use a wrapper which executes git-notify with the desired
options and which makes it easy to add other post-receive hooks in the
future.
2009-11-07 10:40:22 +01:00
Holger Weiss
c3e2186b15 git-notify: Support SourceForge repositories
The Gitweb URLs for repositories hosted by SourceForge are slightly
different than other Gitweb URLs.  The correct URL cannot be specified
via "-u" if we append "/$repos_name.git/?" to that URL as we usually do.
If the new "-S" flag is specified or "notify.sourceforge" is set, we'll
append "/$repos_name;" instead, which makes the "-u" option usable for
SourceForge repositories.
2009-11-07 10:40:22 +01:00
Holger Weiss
71351c5a4d git-notify: Optionally call mail(1) without "-a"
Not all mail(1) implementations support specifying additional header
fields via "-a": with some, this flag is used for attaching files,
others don't provide an "-a" flag at all (this is true for the /bin/mail
utility currently installed on the SourceForge servers, for example).
We now provide the "-H" flag and the "notify.legacyMail" configuration
key for these cases.
2009-11-07 10:40:22 +01:00
Holger Weiss
600fecab6a git-notify: Polish up the "tag notifications"
Use better labels for the tag ref and the SHA1 name of the tag object.
2009-11-07 10:40:22 +01:00
Holger Weiss
ecdb5aa53f git-notify: Distinguish between tag types
Distinguish between annotated tags and lightweight tags.  In the former
case, send an annotated "tag notification", in the latter case, send a
"ref change notification" (as we did in both cases before).
2009-11-07 10:40:22 +01:00
Holger Weiss
73141bfd92 git-notify: Fix "global" notifications
If the number of commits included with a single push exceeds the maximum
specified via "-n", a single notification will be generated instead of
individual e-mails.  For listing the commits within such a notification,
git-rev-list(1)'s "--pretty" option is used.  This yields output which
the git_rev_list() subroutine didn't accept.  That's now fixed.
2009-11-07 10:40:00 +01:00
Holger Weiss
d100429a48 git-notify: Optionally [tag] the subject
If the new "-T" option is specified or "notify.emitRepository" is set,
the subject of e-mail notifications will be prefixed with [<tag>], where
<tag> is the name of the updated repository.
2009-11-07 02:23:32 +01:00
Holger Weiss
366d102dba git-notify: Optionally omit the author name
If the new "-A" option is specified (or "notify.omitAuthor" is set), the
author name will be omitted from the subject of e-mail notifications.
2009-11-07 02:23:32 +01:00
Holger Weiss
40ef916946 git-notify: Make abbreviating Gitweb URLs optional
The SHA1 object name part of Gitweb URLs is now only shortened if the
user requested this by specifying the new "-z" option (or by setting
"notify.shortURLs").

While at it, also shorten the additional URL which references a diff in
e-mail notifications which don't include that diff inline because its
size exceeds the maximum number of bytes specified via "-s".

Note that while the abbreviated SHA1 object names will be unique at push
time, this cannot be guaranteed for the future, so the shortened URLs
might break some day.
2009-11-07 02:23:32 +01:00