Commit Graph

786 Commits

Author SHA1 Message Date
Íñigo Huguet
69ceee1a0b contrib: new script to anonymize logs
Script to do some anonymization to NetworkManager logs. It does
very basic stuff so it shouldn't be trusted without manually
reviewing the logs, but it can still be useful to replace lot
of potentially sensitive data.

What it masks by default:
- MAC addresses
- Public IP addresses
- Hostnames detected from `hostname` command and some known
  log messages from NM.
- Hostnames ending in some common domains such as .com or .org
- Hostnames specified via --hostname argument

What it can mask but it doesn't by default:
- Private IPs

Options like --show-macs and --hide-private-ips can override the default
behaviour.

Note that masking IP addresses can make difficult to analyze routing
problems, and trying to be smart analyzing the defined routes from the
logs or from `ip route` can lead to even worse results. Because of this,
if routing problems need to be analyzed, --show-public-ips need to be
passed.
2023-11-24 07:40:08 +00:00
Thomas Haller
a6e085b3e8 clang-format: rework "nm-code-format-container.sh" script
Instead of doing the broken `podman run` and `podman start` approach,
build an image ("nm-code-format:f38"), cache it, and use it to run
"nm-code-format.sh" via `podman run`. We should build and keep a
container image, not a container.

The benefit is that this allows to hand over the command line arguments
to "nm-code-format.sh". In particular the "-u" and "-F" options, which
are life savers.

This means,

  $ contrib/scripts/nm-code-format-container.sh -u

works.

Try also

  $ contrib/scripts/nm-code-format-container.sh -h

which tells you that you are running inside the container, and how to
delete/renew the container image.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1798
2023-11-22 13:25:04 +01:00
Fernando Fernandez Mancera
084beb0818 contrib/rpm: fix reference to "22-wifi-mac-addr.conf" 2023-11-21 13:03:24 +01:00
Thomas Haller
1d241f5295 contrib: fix invalid escape sequence in "find-backports"
Fixes: 57cfa5daf9 ('contrib: add "find-backports" script')
2023-11-20 17:14:47 +01:00
Thomas Haller
ea8dbd7a6d contrib/rpm: add "22-wifi-mac-addr.conf" to F40+
Install a configuration snippet on Fedora 40+, that sets the default for
"wifi.cloned-mac-address" to "stable-ssid" (otherwise, the built-in default
is "preserve").

This will mean, that on Wi-Fi profiles that don't explicitly override
the property "wifi.cloned-mac-address", a stable address is generated.
The benefit is, that Fedora will randomize the MAC address by default.

Note that this also affects all pre-existing Wi-Fi profiles, that don't
explicitly configure the property in the profile. Depending on how you
see it, this is desirable. Randomization should be done, unless the user
opts-out (not the other way around).

Note that setting "wifi.cloned-mac-address=stable-ssid" is similar to
setting a stable ID "${NETWORK_SSID}" and "wifi.cloned-mac-address=stable".
The difference is that the latter also affects other properties, like

  - "ipv6.addr-gen-mode=stable-privacy"
  - "{ethernet,wifi}.cloned-mac-address=stable"
  - "ipv4.dhcp-client-id=stable"
  - "ipv6.dhcp-duid=stable-{llt,ll,uuid}"
  - "{ipv4,ipv6}.iaid=stable"

Especially with "ipv6.addr-gen-mode=stable", changing the stable ID
would mean that also all IPv6 addresses change. We want to avoid that by
only changing the cloned-mac-address to "stable-ssid".

This means, after upgrade to F40, different MAC addresses will be used
on most users' Wi-Fi. This means, DHCP might hand out different IP
addresses, sessions might expire, and configuration that depended on the
previous MAC address will be affected.

https://pagure.io/fedora-workstation/issue/350
2023-11-17 12:48:37 +01:00
Thomas Haller
eb5b78c4bf all: drop support for building with Python2
Now that we no longer test on CentOS7, we also have no more tests that
build using Python2.

Note that build with Python2 is currently broken already (which would be
fixable).

Drop Python2 too.

Existing Python scripts still use a common subset of Python2 and
Python3. They can be improved to use Python3 features in the future.
2023-11-14 10:29:48 +01:00
Íñigo Huguet
1560052dcc contrib/rpm: libnm: migrate to SPDX license
The license identifier was updated for the main package, but not for
libnm which overrides it to LGPL 2.1 or later. Update it too.

Fixes: 8c5aec7a1b ('contrib/rpm: migrate to SPDX license')
2023-11-07 07:20:04 +00:00
Íñigo Huguet
72b2485042 spec: Add missing epoch to some obsoleted versions
An rpm linter has complained with:
Missing epoch prefix on the version-release in 'Obsoletes: NetworkManager < 1.0.0' for NetworkManager-team
2023-10-25 10:20:03 +00:00
Beniamino Galvani
cb4c8c2147 contrib/rpm: add note about interface renaming with ifcfg vs keyfile 2023-10-03 14:09:21 +02:00
Beniamino Galvani
c3ca0b90cd contrib/rpm: ship a different readme when ifcfg migration is enabled
Ship a different file in /etc/sysconfig/network-scripts to warn that
migration is enabled.
2023-10-03 14:09:21 +02:00
Íñigo Huguet
510952b036 contrib: add libpsl-dev to debian requirements
It's installed for Fedora and Alpine, and building with meson requires
it by default.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1723
2023-09-13 16:29:01 +02:00
Beniamino Galvani
995539cd30 contrib/rpm: enable ifcfg migration on Fedora 39+
https://fedoraproject.org/wiki/Changes/MigrateIfcfgToKeyfile
2023-08-10 13:21:49 +02:00
Thomas Haller
514e944da3 contrib: add "cloud-init", "firewalld", "nftables" to makerepo.sh script 2023-07-14 09:40:26 +02:00
Thomas Haller
f08102bf41 contrib: autodetect the Fedora version for "nm-code-format-container.sh" script
From time to time we bump the used clang-format (and Fedora) version.
Previously, we had to change more than one places.

Instead, let the "nm-code-format-container.sh" parse it from ".gitlab-ci/config.yml".
2023-06-27 15:19:01 +02:00
Miroslav Suchy
8c5aec7a1b contrib/rpm: migrate to SPDX license
Fedora is moving to SPDX standard in naming a licenses.
See https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2 .

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1668
2023-06-23 10:14:56 +02:00
Thomas Haller
dd561875dc contrib/rpm: update RPM description for NetworkManager-cloud-setup package
https://bugzilla.redhat.com/show_bug.cgi?id=2214491
2023-06-13 09:34:36 +02:00
Wen Liang
f04a9eb098 cloud-setup: add pre-up event to prevent reaching network-online.target
network-online.target should not be reached before nm-cloud-setup
completes configuring the network, which may make user service get
started before the network is fully configured.

Setting nm-cloud-setup.service as "Before=network-online.target" would
maybe have already achieved that. However, also use a pre-up dispatcher
script, so that the device activation in NetworkManager is also waiting
for nm-cloud-setup to complete.

https://bugzilla.redhat.com/show_bug.cgi?id=2151040
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1653
2023-06-09 09:18:20 -04:00
Thomas Haller
9ede7e04b1 contrib: extend usage for "contrib/scripts/nm-setup-git.sh" script 2023-06-06 15:00:23 +02:00
Thomas Haller
e75deb8c94 contrib/copr: update URL in "nm-copr-build.sh" to new nm-git-bundle 2023-06-06 14:53:37 +02:00
Thomas Haller
a8b2997fa5 contrib/copr: improve readme in copr scripts (2) 2023-06-06 12:21:30 +02:00
Thomas Haller
fd6fcf335c contrib/copr: improve readme in copr scripts 2023-06-06 12:20:29 +02:00
Thomas Haller
fe95e07fef contrib: fix fedora/REQUIRED_PACKAGES for {lib,}vala-devel
Originally, the package was called vala-devel (it still is on CentOS7).
Then it was renamed to libvala-devel, but keeping a Provides.

On Fedora 39, the Provides was dropped. Workaround.
2023-05-19 12:49:23 +02:00
Thomas Haller
c275d24637 clang-format: reformat code with clang-format 16.0.2-1.fc38
This is the version shipped in Fedora 38. As Fedora 38 is now out, the
core developers switch to it. Our gitlab-ci will also use that as base
image for the check-{patch.tree} tests and to generate the pages. There
is a need that everybody agrees on which clang-format version to use,
and that version should be the one of the currently used Fedora release.

Also update the used Fedora image in "contrib/scripts/nm-code-format-container.sh"
script.

The gitlab-ci still needs update in the following commit. This change
in isolation will break the "check-tree" test.
2023-05-19 10:53:13 +02:00
Thomas Haller
e37a15acad all: avoid "==" bashism in scripts 2023-05-18 09:16:41 +02:00
Beniamino Galvani
c67d65f733 rpm: fix detection of ppp version for ppp >= 2.5.0
In ppp 2.5.0 the "patchlevel.h" header file was removed and pkg-config
must be used. Update the detection command to support both ways.
2023-04-20 11:55:49 +02:00
Thomas Haller
cae2011b08 contrib: show clang-format version in failure message
The actual formatting depends on the version of clang-format. Print the
used version, which is in particular interesting when we get an error in
our gitlab-ci check (which uses the correct version).
2023-04-18 19:05:02 +02:00
Thomas Haller
229163202d release.sh: adjust check for gitlab-ci for changes in pipeline
- We need to fetch more entries per page. 100 is the maximum without
  pagination, but that is enough for us.

- Previously, we checked all stages. Now, let's skip the "prep" and "tier3" stages.
  This change should work both with old and new pipelines.
2023-04-13 13:18:27 +02:00
Thomas Haller
fe4e5c24e4 find-backports: improve git_ref_exists() to cache also the hashes themselves
git_ref_exists() memoizes the result. But while it looks up the SHA sum
for "ref", it also can cache the result for the SHA sum itself.
2023-04-07 17:23:13 +02:00
Thomas Haller
65ef6bc9bc find-backports: warn if any commits are not from the first reference
Every branch (for example "nm-1-40") has exactly one next branch, from
which patches should be backported (in that example that branch is
"nm-1-42").

While "find-backports" searches all newer branches for patches, it does
not make it clear form where the patch should come from.

That means, if you run the script `contrib/scripts/find-backports origin/nm-1-40`
it will check nm-1-42 and main branch, and might suggest to backport
patches that are only on main, but not "nm-1-42". That would be wrong,
because patches need to first go into nm-1-42, and then backported (from
there) further to nm-1-40.

Print a warning to highlight that.
2023-04-06 21:37:10 +02:00
Thomas Haller
9f89910852 find-backports: various cleanups in script
- avoid list([...]).
- use some f-strings.
2023-04-06 18:34:15 +02:00
Thomas Haller
efd23da26b find-backports: enable debug logging in script 2023-04-06 18:34:15 +02:00
Thomas Haller
1ed3854402 checkpatch: discourage deprecated "(allow-none)" annotation 2023-03-29 11:46:48 +02:00
Thomas Haller
2c9faea63c contrib,tools: move "nm-in-container.sh" script to "tools"
This script seems very useful to me. Give it a more prominent place and
move it out from "contrib/scripts". Also do some further renaming.
2023-03-20 08:59:59 +01:00
Thomas Haller
a6802cfa74 nm-in-container: disable handling of "/etc/resolv.conf" in container and use 8.8.8.8.
By default, podman bind mounts a "/etc/resolv.conf" file. That prevents
NetworkManager (inside the container) to update the file, which leads to
warnings in the log and certain NM-ci tests won't pass due to that.

Disable handling of "/etc/resolv.conf" in podman. But also pre-deploy a
default resolv.conf, with the google name server 8.8.8.8.  I don't
understand why, but even with "--dns=none", writing "/etc/resolv.conf"
while building the container doesn't take effect.  Instead, write a
usable "/etc/resolv.conf" from "/etc/rc.d/rc.local".
2023-03-16 08:33:00 +01:00
Thomas Haller
d453188ed2 nm-in-container: add nm-deploy.sh script for reinstalling NetworkManager 2023-03-15 16:50:57 +01:00
Thomas Haller
0c233fb216 nm-in-container: symlink NM/NM-ci directories in nm-in-container 2023-03-15 16:50:57 +01:00
Thomas Haller
9bf193f1a8 contrib: escape shell arguments in "nm-setup-git.sh" output 2023-03-09 16:56:18 +01:00
Thomas Haller
3c548dd081 release: improve hint about documentation in "release.sh"
A "minor" release can still be the latest release. It depends
on which minor release you do. The script isn't smart enough
to understand the difference, so make the hint a bit clearer.
2023-03-09 09:50:03 +01:00
Thomas Haller
b88700bd4b release: fix honoring $ORIGIN environment variable 2023-03-09 09:05:21 +01:00
Thomas Haller
acd895e1f7 contrib: update history and hints in "nm-in-container.sh" script
Calling `nm-env-prepare.sh --prefix eth -i 1 && nmcli device connect eth1` has
a race, where NetworkManager didn't see the interface yet. Add a sleep.
2023-03-08 11:22:52 +01:00
Thomas Haller
d0732962d2 contrib: install more packages in "nm-in-container.sh" 2023-03-03 15:42:05 +01:00
Thomas Haller
713de313dc contrib: add usage comment to "git-subtree-reimport.sh" 2023-03-03 13:45:31 +01:00
Thomas Haller
004464cfbd contrib: update "configure-for-system.sh" and start build
"configure-for-system.sh" is supposed to be in sync with
NetworkManager.spec. Update for the recent changes.

Also add a make/ninja call at the end. Almost always we want to build
after the configure.
2023-02-14 09:15:39 +01:00
Thomas Haller
786ebecee9 contrib/rpm: minor cleanup of "NetworkManager.spec"
Reorder ppp arguments so that they make more sense and are consistent
with the autotools code.
2023-02-14 09:03:31 +01:00
Thomas Haller
5973e83160 systemd: merge branch systemd into main
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1529
2023-02-13 15:33:02 +01:00
Thomas Haller
a798b4f3f6 contrib/release: fix version in import-docs hint message 2023-02-13 10:24:08 +01:00
Thomas Haller
06dc84a563 contrib/rpm: fix "--enable-ppp" flag to build without ppp
[thaller@redhat.com: I introduced this bug when taking the original patch].

Fixes: 820f6f3a4a ('contrib/rpm: sync obsoletes_{initscripts_updown,ifcfg_rh} version')
2023-02-10 10:09:27 +01:00
Thomas Haller
820f6f3a4a contrib/rpm: sync obsoletes_{initscripts_updown,ifcfg_rh} version
Initially, when we obsoleted {initscripts_updown,ifcfg_rh}, the package
versions that we build from this upstream spec file differed from what
we put into Fedora/RHEL.

By now, this is long gone, and for upstream package builds we don't care
to accurately track the version, when using upstream/copr builds. Just
sync the version to what they are in Fedora/RHEL.
2023-02-10 10:05:03 +01:00
Stewart Smith
2598ec3a1f contrib/rpm: fix building without ppp
We need to explicitly say we don't want PPP as the default is
that we do want to build with PPP.

https://src.fedoraproject.org/rpms/NetworkManager/pull-request/13
2023-02-10 09:53:15 +01:00
Yaakov Selkowitz
42cd422f18 contrib/rpm: fix flatpak build
https://src.fedoraproject.org/rpms/NetworkManager/pull-request/13
2023-02-10 09:51:01 +01:00