Compare commits
18 commits
v0.5.0
...
debian/sid
Author | SHA1 | Date | |
---|---|---|---|
|
4bf9baa1ae | ||
|
4f3d9f75bb | ||
|
2bcf3024d7 | ||
|
7c88972fa9 | ||
|
0c7d517e5c | ||
|
b7689fcc97 | ||
|
bad9eff45e | ||
|
5cd4632c13 | ||
|
8d3aeb2b07 | ||
|
6d60429bb2 | ||
|
0025aa8f8a | ||
|
f7fd789c27 | ||
|
58824d8cc3 | ||
|
8fe336a60b | ||
|
4d20decb7a | ||
|
24634585a3 | ||
|
1efc60bbcd | ||
|
d1c9063d26 |
20 changed files with 623 additions and 40 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -21,3 +21,5 @@
|
||||||
go.work
|
go.work
|
||||||
|
|
||||||
.idea/
|
.idea/
|
||||||
|
/.pc/
|
||||||
|
/_build/
|
||||||
|
|
67
.gitlab-ci.yml
Normal file
67
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
# Is performed before the scripts in the stages step
|
||||||
|
before_script:
|
||||||
|
- source /etc/profile
|
||||||
|
|
||||||
|
# Defines stages which are to be executed
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- upload
|
||||||
|
- release
|
||||||
|
|
||||||
|
.setup_script: &setup_scripts
|
||||||
|
- apt-get update
|
||||||
|
- apt-get -y build-dep .
|
||||||
|
- apt-get -y install dpkg-dev
|
||||||
|
|
||||||
|
.compile: &compile
|
||||||
|
stage: compile
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
script:
|
||||||
|
- *setup_scripts
|
||||||
|
- dpkg-buildpackage -b
|
||||||
|
- mkdir -p ./build/{release,debug}
|
||||||
|
- find ../ -name "*.deb" -not -name "*dbgsym*" -exec mv {} ./build/release/ \;
|
||||||
|
- find ../ -name "*dbgsym*.deb" -exec mv {} ./build/debug/ \;
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- build/release/*
|
||||||
|
- build/debug/*
|
||||||
|
untracked: true
|
||||||
|
|
||||||
|
build:
|
||||||
|
<<: *compile
|
||||||
|
stage: build
|
||||||
|
|
||||||
|
upload:
|
||||||
|
stage: upload
|
||||||
|
dependencies:
|
||||||
|
- build
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
script:
|
||||||
|
- find ./build/release -name "*.deb"
|
||||||
|
- debs=( $( find ./build/release -name "*.deb" ) )
|
||||||
|
- assets=""
|
||||||
|
- for d in ${debs[@]};do
|
||||||
|
- file=$( basename ${d} )
|
||||||
|
- url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${file}"
|
||||||
|
- assets="${assets} --assets-link {\"name\":\"${file}\",\"url\":\"${url}\",\"link_type\":\"other\"} "
|
||||||
|
- "curl --header \"JOB-TOKEN: $CI_JOB_TOKEN\" --upload-file \"${d}\" \"${url}\""
|
||||||
|
- done
|
||||||
|
- echo "ASSETS_ARG=${assets}" >> assets.env
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
dotenv: assets.env
|
||||||
|
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
script:
|
||||||
|
- echo "making release!"
|
||||||
|
- echo ${ASSETS_ARG}
|
||||||
|
- release-cli create --name "Release ${CI_COMMIT_TAG}" --tag-name "${CI_COMMIT_TAG}" ${ASSETS_ARG}
|
||||||
|
tags:
|
||||||
|
- x86_64
|
85
CHANGELOG.md
Normal file
85
CHANGELOG.md
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project since will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2.1.0] - 2023-01-19
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add device auto-connect setter
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Connection settings route and address data types
|
||||||
|
|
||||||
|
## [2.0.0] - 2022-11-22
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
- Update go-dbus to v5.1.0
|
||||||
|
- **BREAKING CHANGE** : Generic recursive settings map dbus variants decoding
|
||||||
|
|
||||||
|
## [0.5.0] - 2022-11-22
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Godoc standard comment prefix
|
||||||
|
- DnsManager
|
||||||
|
- Device: GetIp4Connectivity
|
||||||
|
- Constants for Nm80211APSec
|
||||||
|
- Add gitignore
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- CheckpointCreate: fix devicePaths variable scope
|
||||||
|
|
||||||
|
## [0.4.0] - 2022-01-17
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- AccessPoint: add LastSeen property
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Examples: move examples to their own subfolders
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- DeviceWireless: remove duplicated fields
|
||||||
|
- PrimaryConnection: use ActiveConnection type
|
||||||
|
- SubscribeState: add the path to the recieved chan type, catch connect event for ActiveConnection
|
||||||
|
|
||||||
|
## [0.3.0] - 2020-03-26
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- SetPropertyManaged (@joseffilzmaier)
|
||||||
|
- GetConnectionByUUID (@paulburlumi)
|
||||||
|
- VpnConnection
|
||||||
|
- ActiveConnectionSignalStateChanged
|
||||||
|
- CheckpointRollback
|
||||||
|
- SetPropertyWirelessEnabled (@Raqbit)
|
||||||
|
- Settings.ReloadConnections (@appnostic-io)
|
||||||
|
|
||||||
|
Static connection example (@everactivemilligan)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- GetPropertyRouteData panic (@zhengdelun)
|
||||||
|
|
||||||
|
## [0.2.0] - 2020-03-06
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- added missing flag for Reload
|
||||||
|
- added parameter specific_object for AddAndActivateConnection
|
||||||
|
- Fix CheckpointCreateand GetPropertyCheckpoints
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Add property setter helper
|
||||||
|
- Add Device.SetPropertyRefreshRateMs
|
||||||
|
- Add Device.Reapply
|
|
@ -2,7 +2,6 @@ package gonetworkmanager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/godbus/dbus/v5"
|
"github.com/godbus/dbus/v5"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -97,44 +96,66 @@ func (c *connection) Delete() error {
|
||||||
|
|
||||||
func (c *connection) GetSettings() (ConnectionSettings, error) {
|
func (c *connection) GetSettings() (ConnectionSettings, error) {
|
||||||
var settings map[string]map[string]dbus.Variant
|
var settings map[string]map[string]dbus.Variant
|
||||||
err := c.callWithReturn(&settings, ConnectionGetSettings)
|
|
||||||
|
|
||||||
if err != nil {
|
if err := c.callWithReturn(&settings, ConnectionGetSettings); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
rv := make(ConnectionSettings)
|
return decodeSettings(settings), nil
|
||||||
|
|
||||||
for k1, v1 := range settings {
|
|
||||||
rv[k1] = make(map[string]interface{})
|
|
||||||
|
|
||||||
for k2, v2 := range v1 {
|
|
||||||
rv[k1][k2] = v2.Value()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return rv, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *connection) GetSecrets(settingName string) (ConnectionSettings, error) {
|
func (c *connection) GetSecrets(settingName string) (ConnectionSettings, error) {
|
||||||
var settings map[string]map[string]dbus.Variant
|
var settings map[string]map[string]dbus.Variant
|
||||||
err := c.callWithReturn(&settings, ConnectionGetSecrets, settingName)
|
|
||||||
|
|
||||||
if err != nil {
|
if err := c.callWithReturn(&settings, ConnectionGetSecrets, settingName); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
rv := make(ConnectionSettings)
|
return decodeSettings(settings), nil
|
||||||
|
}
|
||||||
|
|
||||||
for k1, v1 := range settings {
|
func decodeSettings(input map[string]map[string]dbus.Variant) (settings ConnectionSettings) {
|
||||||
rv[k1] = make(map[string]interface{})
|
valueMap := ConnectionSettings{}
|
||||||
|
for key, data := range input {
|
||||||
|
valueMap[key] = decode(data).(map[string]interface{})
|
||||||
|
}
|
||||||
|
return valueMap
|
||||||
|
}
|
||||||
|
|
||||||
for k2, v2 := range v1 {
|
func decode(input interface{}) (value interface{}) {
|
||||||
rv[k1][k2] = v2.Value()
|
if variant, isVariant := input.(dbus.Variant); isVariant {
|
||||||
|
return decode(variant.Value())
|
||||||
|
} else if inputMap, isMap := input.(map[string]dbus.Variant); isMap {
|
||||||
|
return decodeMap(inputMap)
|
||||||
|
} else if inputArray, isArray := input.([]dbus.Variant); isArray {
|
||||||
|
return decodeArray(inputArray)
|
||||||
|
} else if inputArray, isArray := input.([]map[string]dbus.Variant); isArray {
|
||||||
|
return decodeMapArray(inputArray)
|
||||||
|
} else {
|
||||||
|
return input
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv, nil
|
func decodeArray(input []dbus.Variant) (value []interface{}) {
|
||||||
|
for _, data := range input {
|
||||||
|
value = append(value, decode(data))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func decodeMapArray(input []map[string]dbus.Variant) (value []map[string]interface{}) {
|
||||||
|
for _, data := range input {
|
||||||
|
value = append(value, decodeMap(data))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func decodeMap(input map[string]dbus.Variant) (value map[string]interface{}) {
|
||||||
|
value = map[string]interface{}{}
|
||||||
|
for key, data := range input {
|
||||||
|
value[key] = decode(data)
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *connection) ClearSecrets() error {
|
func (c *connection) ClearSecrets() error {
|
||||||
|
|
173
Connection_test.go
Normal file
173
Connection_test.go
Normal file
|
@ -0,0 +1,173 @@
|
||||||
|
package gonetworkmanager
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/godbus/dbus/v5"
|
||||||
|
"reflect"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestDecodeSettings(t *testing.T) {
|
||||||
|
settings := map[string]map[string]dbus.Variant{
|
||||||
|
"ipv4": {
|
||||||
|
"address-data": dbus.MakeVariant([]map[string]dbus.Variant{
|
||||||
|
{
|
||||||
|
"address": dbus.MakeVariant("192.168.1.156"),
|
||||||
|
"prefix": dbus.MakeVariant(24),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
"dns-search": dbus.MakeVariant([]string{}),
|
||||||
|
"method": dbus.MakeVariant("manual"),
|
||||||
|
"route-data": dbus.MakeVariant([]map[string]dbus.Variant{}),
|
||||||
|
"routes": dbus.MakeVariant([][]uint32{}),
|
||||||
|
"addresses": dbus.MakeVariant([][]uint32{
|
||||||
|
{
|
||||||
|
2617354432,
|
||||||
|
24,
|
||||||
|
16885952,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
"gateway": dbus.MakeVariant("192.168.1.1"),
|
||||||
|
"route-metric": dbus.MakeVariant(100),
|
||||||
|
"dhcp-timeout": dbus.MakeVariant(45),
|
||||||
|
},
|
||||||
|
"ipv6": {
|
||||||
|
"addr-gen-mode": dbus.MakeVariant(3),
|
||||||
|
"address-data": dbus.MakeVariant([]map[string]dbus.Variant{}),
|
||||||
|
"routes": dbus.MakeVariant([][]interface{}{}),
|
||||||
|
"dns-search": dbus.MakeVariant([]string{}),
|
||||||
|
"method": dbus.MakeVariant("auto"),
|
||||||
|
"route-data": dbus.MakeVariant([]map[string]dbus.Variant{}),
|
||||||
|
"dhcp-timeout": dbus.MakeVariant(45),
|
||||||
|
"route-metric": dbus.MakeVariant(100),
|
||||||
|
"addresses": dbus.MakeVariant([][]interface{}{}),
|
||||||
|
},
|
||||||
|
"proxy": {},
|
||||||
|
"connection": {
|
||||||
|
"uuid": dbus.MakeVariant("390e5c2b-7312-415e-80e6-7b94a5c24fc3"),
|
||||||
|
"autoconnect-priority": dbus.MakeVariant(1),
|
||||||
|
"autoconnect-retries": dbus.MakeVariant(0),
|
||||||
|
"id": dbus.MakeVariant("main"),
|
||||||
|
"interface-name": dbus.MakeVariant("eth0"),
|
||||||
|
"permissions": dbus.MakeVariant([]string{}),
|
||||||
|
"timestamp": dbus.MakeVariant(1669049774),
|
||||||
|
"type": dbus.MakeVariant("802-3-ethernet"),
|
||||||
|
},
|
||||||
|
"802-3-ethernet": {
|
||||||
|
"auto-negotiate": dbus.MakeVariant(false),
|
||||||
|
"mac-address-blacklist": dbus.MakeVariant([]string{}),
|
||||||
|
"s390-options": dbus.MakeVariant(map[string]string{}),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
result := decodeSettings(settings)
|
||||||
|
|
||||||
|
expected := ConnectionSettings{
|
||||||
|
"ipv4": {
|
||||||
|
"address-data": []map[string]interface{}{
|
||||||
|
{
|
||||||
|
"address": "192.168.1.156",
|
||||||
|
"prefix": 24,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"dns-search": []string{},
|
||||||
|
"method": "manual",
|
||||||
|
"route-data": []map[string]interface{}(nil),
|
||||||
|
"routes": [][]uint32{},
|
||||||
|
"addresses": [][]uint32{
|
||||||
|
{
|
||||||
|
2617354432,
|
||||||
|
24,
|
||||||
|
16885952,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"gateway": "192.168.1.1",
|
||||||
|
"route-metric": 100,
|
||||||
|
"dhcp-timeout": 45,
|
||||||
|
},
|
||||||
|
"ipv6": {
|
||||||
|
"addr-gen-mode": 3,
|
||||||
|
"address-data": []map[string]interface{}(nil),
|
||||||
|
"routes": [][]interface{}{},
|
||||||
|
"dns-search": []string{},
|
||||||
|
"method": "auto",
|
||||||
|
"route-data": []map[string]interface{}(nil),
|
||||||
|
"dhcp-timeout": 45,
|
||||||
|
"route-metric": 100,
|
||||||
|
"addresses": [][]interface{}{},
|
||||||
|
},
|
||||||
|
"proxy": {},
|
||||||
|
"connection": {
|
||||||
|
"uuid": "390e5c2b-7312-415e-80e6-7b94a5c24fc3",
|
||||||
|
"autoconnect-priority": 1,
|
||||||
|
"autoconnect-retries": 0,
|
||||||
|
"id": "main",
|
||||||
|
"interface-name": "eth0",
|
||||||
|
"permissions": []string{},
|
||||||
|
"timestamp": 1669049774,
|
||||||
|
"type": "802-3-ethernet",
|
||||||
|
},
|
||||||
|
"802-3-ethernet": {
|
||||||
|
"auto-negotiate": false,
|
||||||
|
"mac-address-blacklist": []string{},
|
||||||
|
"s390-options": map[string]string{},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if !reflect.DeepEqual(result, expected) {
|
||||||
|
t.Fatalf("failed: \nexpected: %#v\nresult : %#v", expected, result)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDecode(t *testing.T) {
|
||||||
|
ipSettings := map[string]dbus.Variant{
|
||||||
|
"address-data": dbus.MakeVariant([]map[string]dbus.Variant{
|
||||||
|
{
|
||||||
|
"address": dbus.MakeVariant("192.168.1.156"),
|
||||||
|
"prefix": dbus.MakeVariant(24),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
"dns-search": dbus.MakeVariant([]string{}),
|
||||||
|
"method": dbus.MakeVariant("manual"),
|
||||||
|
"route-data": dbus.MakeVariant([]map[string]dbus.Variant{}),
|
||||||
|
"routes": dbus.MakeVariant([][]uint32{}),
|
||||||
|
"addresses": dbus.MakeVariant([][]uint32{
|
||||||
|
{
|
||||||
|
2617354432,
|
||||||
|
24,
|
||||||
|
16885952,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
"gateway": dbus.MakeVariant("192.168.1.1"),
|
||||||
|
"route-metric": dbus.MakeVariant(100),
|
||||||
|
"dhcp-timeout": dbus.MakeVariant(45),
|
||||||
|
}
|
||||||
|
|
||||||
|
result := decode(ipSettings)
|
||||||
|
|
||||||
|
expected := map[string]interface{}{
|
||||||
|
"address-data": []map[string]interface{}{
|
||||||
|
{
|
||||||
|
"address": "192.168.1.156",
|
||||||
|
"prefix": 24,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"dns-search": []string{},
|
||||||
|
"method": "manual",
|
||||||
|
"route-data": []map[string]interface{}(nil),
|
||||||
|
"routes": [][]uint32{},
|
||||||
|
"addresses": [][]uint32{
|
||||||
|
{
|
||||||
|
2617354432,
|
||||||
|
24,
|
||||||
|
16885952,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"gateway": "192.168.1.1",
|
||||||
|
"route-metric": 100,
|
||||||
|
"dhcp-timeout": 45,
|
||||||
|
}
|
||||||
|
|
||||||
|
if !reflect.DeepEqual(result, expected) {
|
||||||
|
t.Fatalf("failed: \nexpected: %#v\nresult : %#v", expected, result)
|
||||||
|
}
|
||||||
|
}
|
|
@ -128,6 +128,7 @@ type Device interface {
|
||||||
|
|
||||||
// GetPropertyAutoConnect If TRUE, indicates the device is allowed to autoconnect. If FALSE, manual intervention is required before the device will automatically connect to a known network, such as activating a connection using the device, or setting this property to TRUE. This property cannot be set to TRUE for default-unmanaged devices, since they never autoconnect.
|
// GetPropertyAutoConnect If TRUE, indicates the device is allowed to autoconnect. If FALSE, manual intervention is required before the device will automatically connect to a known network, such as activating a connection using the device, or setting this property to TRUE. This property cannot be set to TRUE for default-unmanaged devices, since they never autoconnect.
|
||||||
GetPropertyAutoConnect() (bool, error)
|
GetPropertyAutoConnect() (bool, error)
|
||||||
|
SetPropertyAutoConnect(bool) error
|
||||||
|
|
||||||
// GetPropertyFirmwareMissing If TRUE, indicates the device is likely missing firmware necessary for its operation.
|
// GetPropertyFirmwareMissing If TRUE, indicates the device is likely missing firmware necessary for its operation.
|
||||||
GetPropertyFirmwareMissing() (bool, error)
|
GetPropertyFirmwareMissing() (bool, error)
|
||||||
|
@ -270,6 +271,10 @@ func (d *device) GetPropertyAutoConnect() (bool, error) {
|
||||||
return d.getBoolProperty(DevicePropertyAutoconnect)
|
return d.getBoolProperty(DevicePropertyAutoconnect)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *device) SetPropertyAutoConnect(managed bool) error {
|
||||||
|
return d.setProperty(DevicePropertyAutoconnect, managed)
|
||||||
|
}
|
||||||
|
|
||||||
func (d *device) GetPropertyFirmwareMissing() (bool, error) {
|
func (d *device) GetPropertyFirmwareMissing() (bool, error) {
|
||||||
return d.getBoolProperty(DevicePropertyFirmwareMissing)
|
return d.getBoolProperty(DevicePropertyFirmwareMissing)
|
||||||
}
|
}
|
||||||
|
|
34
README.md
34
README.md
|
@ -4,16 +4,32 @@
|
||||||
gonetworkmanager
|
gonetworkmanager
|
||||||
================
|
================
|
||||||
|
|
||||||
Go D-Bus bindings for NetworkManager 1.16.
|
Go D-Bus bindings for [NetworkManager](https://networkmanager.dev/).
|
||||||
|
|
||||||
Tested with NetworkManager 1.16.0.
|
|
||||||
|
|
||||||
[NetworkManager 1.16 D-Bus Spec](https://developer.gnome.org/NetworkManager/1.16/spec.html)
|
|
||||||
|
|
||||||
## Backward compatibility
|
|
||||||
|
|
||||||
The library should also be compatible with NetworkManager 0.9.8.10.
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
You can find some examples in the [examples](examples) directory.
|
You can find some examples in the [examples](examples) directory.
|
||||||
|
|
||||||
|
## External documentations
|
||||||
|
|
||||||
|
- [NetworkManager D-Bus Spec](https://networkmanager.dev/docs/api/latest/spec.html)
|
||||||
|
- [nm-settings-dbus](https://networkmanager.dev/docs/api/latest/nm-settings-dbus.html)
|
||||||
|
|
||||||
|
|
||||||
|
## Backward compatibility
|
||||||
|
|
||||||
|
The library is most likely compatible with NetworkManager 0.9 to 1.40.
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
Tested with NetworkManager 1.40.0.
|
||||||
|
|
||||||
|
There are no automated tests for this library. Tests are made manually on a best-effort basis. Unit tests PRs are welcome.
|
||||||
|
|
||||||
|
## Development and contributions
|
||||||
|
|
||||||
|
There is no active development workforce from the maintainer. PRs are welcome.
|
||||||
|
|
||||||
|
## Issues
|
||||||
|
|
||||||
|
Before reporting an issue, please test the scenario with nmcli (if possible) to ensure the problem comes from the library.
|
||||||
|
|
7
debian/.gitignore
vendored
Normal file
7
debian/.gitignore
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
*.debhelper
|
||||||
|
*.log
|
||||||
|
*.substvars
|
||||||
|
/.debhelper/
|
||||||
|
/debhelper-build-stamp
|
||||||
|
/files
|
||||||
|
/golang-github-wifx-gonetworkmanager-dev/
|
17
debian/changelog
vendored
Normal file
17
debian/changelog
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
golang-github-wifx-gonetworkmanager (2.1.0-3) unstable; urgency=medium
|
||||||
|
|
||||||
|
* revert meta changes
|
||||||
|
|
||||||
|
-- Penelope Gwen <support@pogmom.me> Tue, 11 Jun 2024 16:51:58 -0600
|
||||||
|
|
||||||
|
golang-github-wifx-gonetworkmanager (2.1.0-2) unstable; urgency=medium
|
||||||
|
|
||||||
|
* update packaging meta
|
||||||
|
|
||||||
|
-- Penelope Gwen <support@pogmom.me> Tue, 11 Jun 2024 16:13:39 -0600
|
||||||
|
|
||||||
|
golang-github-wifx-gonetworkmanager (2.1.0-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Initial debian package
|
||||||
|
|
||||||
|
-- Penelope Gwen <support@pogmom.me> Tue, 11 Jun 2024 14:44:53 -0600
|
62
debian/control
vendored
Normal file
62
debian/control
vendored
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
Source: golang-github-wifx-gonetworkmanager
|
||||||
|
Section: golang
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: Penelope Gwen <support@pogmom.me>
|
||||||
|
Uploaders: Penelope Gwen <support@pogmom.me>
|
||||||
|
Rules-Requires-Root: no
|
||||||
|
Build-Depends: debhelper-compat (= 13),
|
||||||
|
dh-sequence-golang,
|
||||||
|
golang-any,
|
||||||
|
golang-dbus-dev,
|
||||||
|
golang-github-google-uuid-dev
|
||||||
|
Testsuite: autopkgtest-pkg-go
|
||||||
|
Standards-Version: 4.6.2
|
||||||
|
Homepage: https://git.pogmom.me/pogmommy/gonetworkmanager
|
||||||
|
XS-Go-Import-Path: github.com/Wifx/gonetworkmanager
|
||||||
|
|
||||||
|
Package: golang-github-wifx-gonetworkmanager-dev
|
||||||
|
Architecture: all
|
||||||
|
Multi-Arch: foreign
|
||||||
|
Depends: golang-dbus-dev,
|
||||||
|
golang-github-google-uuid-dev,
|
||||||
|
${misc:Depends}
|
||||||
|
Description: Go D-Bus bindings for NetworkManager (library)
|
||||||
|
GoDoc (https://pkg.go.dev/github.com/Wifx/gonetworkmanager) Go build
|
||||||
|
(https://github.com/Wifx/gonetworkmanager/actions?query=workflow%3AGo)
|
||||||
|
.
|
||||||
|
gonetworkmanager
|
||||||
|
.
|
||||||
|
Go D-Bus bindings for NetworkManager (https://networkmanager.dev/).
|
||||||
|
.
|
||||||
|
Usage
|
||||||
|
.
|
||||||
|
You can find some examples in the (/examples) directory.
|
||||||
|
.
|
||||||
|
External documentations
|
||||||
|
.
|
||||||
|
* NetworkManager D-Bus Spec
|
||||||
|
(https://networkmanager.dev/docs/api/latest/spec.html)
|
||||||
|
* nm-settings-dbus (https://networkmanager.dev/docs/api/latest/nm-settings-
|
||||||
|
dbus.html)
|
||||||
|
.
|
||||||
|
Backward compatibility
|
||||||
|
.
|
||||||
|
The library is most likely compatible with NetworkManager 0.9 to 1.40.
|
||||||
|
.
|
||||||
|
Tests
|
||||||
|
.
|
||||||
|
Tested with NetworkManager 1.40.0.
|
||||||
|
.
|
||||||
|
There are no automated tests for this library. Tests are made manually
|
||||||
|
on a best-effort basis. Unit tests PRs are welcome.
|
||||||
|
.
|
||||||
|
Development and contributions
|
||||||
|
.
|
||||||
|
There is no active development workforce from the maintainer. PRs are
|
||||||
|
welcome.
|
||||||
|
.
|
||||||
|
Issues
|
||||||
|
.
|
||||||
|
Before reporting an issue, please test the scenario with nmcli (if
|
||||||
|
possible) to ensure the problem comes from the library.
|
||||||
|
|
106
debian/copyright
vendored
Normal file
106
debian/copyright
vendored
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Source: https://github.com/Wifx/gonetworkmanager
|
||||||
|
Upstream-Name: gonetworkmanager
|
||||||
|
Upstream-Contact: Wifx <support@iot.wifx.net>
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: 2019 Wifx
|
||||||
|
License: The MIT License (MIT)
|
||||||
|
.
|
||||||
|
Copyright (c) 2019 Wifx Sàrl
|
||||||
|
.
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
.
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
.
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
.
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
.
|
||||||
|
The MIT License (MIT)
|
||||||
|
.
|
||||||
|
Copyright (c) 2016 Bellerophon Mobile
|
||||||
|
.
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
.
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
.
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
|
Files: debian/*
|
||||||
|
Copyright: 2024 Penelope Gwen <support@pogmom.me>
|
||||||
|
License: Opinionated Queer License
|
||||||
|
PERMISSIONS
|
||||||
|
.
|
||||||
|
The creators of this Work (“The Licensor”) grant permission
|
||||||
|
to any person, group or legal entity that doesn't violate the prohibitions below (“The User”),
|
||||||
|
to do everything with this Work that would otherwise infringe their copyright or any patent claims,
|
||||||
|
subject to the following conditions:
|
||||||
|
.
|
||||||
|
OBLIGATIONS
|
||||||
|
.
|
||||||
|
The User must give appropriate credit to the Licensor,
|
||||||
|
provide a copy of this license or a (clickable, if the medium allows) link to
|
||||||
|
oql.avris.it/license/v1.1,
|
||||||
|
and indicate whether and what kind of changes were made.
|
||||||
|
The User may do so in any reasonable manner,
|
||||||
|
but not in any way that suggests the Licensor endorses the User or their use.
|
||||||
|
.
|
||||||
|
PROHIBITIONS
|
||||||
|
.
|
||||||
|
No one may use this Work for prejudiced or bigoted purposes, including but not limited to:
|
||||||
|
racism, xenophobia, queerphobia, queer exclusionism, homophobia, transphobia, enbyphobia, misogyny.
|
||||||
|
.
|
||||||
|
No one may use this Work to inflict or facilitate violence or abuse of human rights as defined in the
|
||||||
|
Universal Declaration of Human Rights.
|
||||||
|
.
|
||||||
|
No law enforcement, carceral institutions, immigration enforcement entities, military entities or military contractors
|
||||||
|
may use the Work for any reason. This also applies to any individuals employed by those entities.
|
||||||
|
.
|
||||||
|
No business entity where the ratio of pay (salaried, freelance, stocks, or other benefits)
|
||||||
|
between the highest and lowest individual in the entity is greater than 50 : 1
|
||||||
|
may use the Work for any reason.
|
||||||
|
.
|
||||||
|
No private business run for profit with more than a thousand employees
|
||||||
|
may use the Work for any reason.
|
||||||
|
.
|
||||||
|
Unless the User has made substantial changes to the Work,
|
||||||
|
or uses it only as a part of a new work (eg. as a library, as a part of an anthology, etc.),
|
||||||
|
they are prohibited from selling the Work.
|
||||||
|
That prohibition includes processing the Work with machine learning models.
|
||||||
|
.
|
||||||
|
SANCTIONS
|
||||||
|
.
|
||||||
|
If the Licensor notifies the User that they have not complied with the rules of the license,
|
||||||
|
they can keep their license by complying within 30 days after the notice.
|
||||||
|
If they do not do so, their license ends immediately.
|
||||||
|
.
|
||||||
|
WARRANTY
|
||||||
|
.
|
||||||
|
This Work is provided “as is”, without warranty of any kind, express or implied.
|
||||||
|
The Licensor will not be liable to anyone for any damages related to the Work or this license,
|
||||||
|
under any kind of legal claim as far as the law allows.
|
3
debian/gbp.conf
vendored
Normal file
3
debian/gbp.conf
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[DEFAULT]
|
||||||
|
debian-branch = debian/sid
|
||||||
|
dist = DEP14
|
4
debian/rules
vendored
Executable file
4
debian/rules
vendored
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@ --builddirectory=_build --buildsystem=golang
|
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
3.0 (quilt)
|
5
debian/upstream/metadata
vendored
Normal file
5
debian/upstream/metadata
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
Bug-Database: https://github.com/Wifx/gonetworkmanager/issues
|
||||||
|
Bug-Submit: https://github.com/Wifx/gonetworkmanager/issues/new
|
||||||
|
Repository: https://github.com/Wifx/gonetworkmanager.git
|
||||||
|
Repository-Browse: https://github.com/Wifx/gonetworkmanager
|
4
debian/watch
vendored
Normal file
4
debian/watch
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
version=4
|
||||||
|
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%@PACKAGE@-$1.tar.gz%,\
|
||||||
|
uversionmangle=s/(\d)[_\.\-\+]?(RC|rc|pre|dev|beta|alpha)[.]?(\d*)$/$1~$2$3/" \
|
||||||
|
https://github.com/Wifx/gonetworkmanager/tags .*/v?(\d\S*)\.tar\.gz debian
|
|
@ -2,7 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/Wifx/gonetworkmanager"
|
"github.com/Wifx/gonetworkmanager/v2"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/Wifx/gonetworkmanager"
|
"github.com/Wifx/gonetworkmanager/v2"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
7
go.mod
7
go.mod
|
@ -1,5 +1,8 @@
|
||||||
module github.com/Wifx/gonetworkmanager
|
module github.com/Wifx/gonetworkmanager/v2
|
||||||
|
|
||||||
go 1.12
|
go 1.12
|
||||||
|
|
||||||
require github.com/godbus/dbus/v5 v5.0.2
|
require (
|
||||||
|
github.com/godbus/dbus/v5 v5.1.0
|
||||||
|
github.com/google/uuid v1.3.0
|
||||||
|
)
|
||||||
|
|
6
go.sum
6
go.sum
|
@ -1,2 +1,4 @@
|
||||||
github.com/godbus/dbus/v5 v5.0.2 h1:QtWdZQyXTEn7S0LXv9nVxPUiT37d1i7UntpRTiKM86E=
|
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
|
||||||
github.com/godbus/dbus/v5 v5.0.2/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
|
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||||
|
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
|
Reference in a new issue