Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

balena-io/resin-network-config

Repository files navigation

resin-network-config

npm version dependencies Build Status Build status

DEPRECATED in favor of https://github.com/resin-io/resin-device-config

Handle resin images network configuration.

Installation

Install resin-network-config by running:

$ npm install --save resin-network-config

Documentation

Object network.getFiles(Object options = {})

Get network related configuration files.

The function accepts an optional options object which can have the following properties:

  • options.wifiSsid, a string that represents the wifi ssid to connect to. If this property is not defined, only ethernet connection will be configured for the device.
  • options.wifiKey, a string that represents the wifi key to use with the defined wifi ssid. If this property is not defined, then the wifi connection will be configured without a passphrase.
networkConfig = require('resin-network-config')

files = networkConfig.getFiles
	wifiSsid: 'foobar'
	wifiKey: 'hello'

console.log(files)

{
	'network/settings': '''
		[global]
		OfflineMode=false

		[WiFi]
		Enable=true
		Tethering=false

		[Wired]
		Enable=true
		Tethering=false

		[Bluetooth]
		Enable=true
		Tethering=false
	''',
	'network/network.config': '''
		[service_home_ethernet]
		Type = ethernet
		Nameservers = 8.8.8.8,8.8.4.4

		[service_home_wifi]
		Type = wifi
		Name = foobar
		Passphrase = hello
		Nameservers = 8.8.8.8,8.8.4.4
	'''
}

Tests

Run the test suite by doing:

$ gulp test

Contribute

Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:

$ gulp lint

Support

If you're having any problem, please raise an issue on GitHub.

License

The project is licensed under the MIT license.

About

DEPRECATED. Handle resin images network configuration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published