mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 00:45:19 +00:00
Windows friendly changes after walking through getting started guide (#1441)
* update .gitattributes to be explicit about line endings with regards to the test certs * update building-fleet guide to include python2 dependency on windows * update configuration to default to OS specific temporary directories
This commit is contained in:
parent
484c6153e3
commit
799243ffb5
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -6,3 +6,8 @@
|
|||||||
website/ linguist-vendored
|
website/ linguist-vendored
|
||||||
website/* linguist-vendored
|
website/* linguist-vendored
|
||||||
website/** linguist-vendored
|
website/** linguist-vendored
|
||||||
|
|
||||||
|
# windows is funny about line endings see https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings for more details
|
||||||
|
# test TestCertificateChain in server/service/service_certificate_test.go was having issues on Windows
|
||||||
|
server/service/testdata/server.key text eol=lf
|
||||||
|
server/service/testdata/server.pem text eol=lf
|
@ -41,7 +41,7 @@ sudo npm install -g yarn
|
|||||||
|
|
||||||
To install dependecies, we recommend using [Chocolatey](https://chocolatey.org/install). Chocolatey must be run in Powershell as an Administrator. Assuming your setup does not include any of our requirements, please run:
|
To install dependecies, we recommend using [Chocolatey](https://chocolatey.org/install). Chocolatey must be run in Powershell as an Administrator. Assuming your setup does not include any of our requirements, please run:
|
||||||
```
|
```
|
||||||
choco install nodejs git golang docker make
|
choco install nodejs git golang docker make python2
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: all packages default to the latest versions. To specify a version, place `--version <version-number>` after each package. You may also install all packages manually from their websites if you prefer.
|
Note: all packages default to the latest versions. To specify a version, place `--version <version-number>` after each package. You may also install all packages manually from their websites if you prefer.
|
||||||
|
@ -3,6 +3,8 @@ package config
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -334,9 +336,9 @@ func (man Manager) addConfigs() {
|
|||||||
man.addConfigBool("pubsub.add_attributes", false, "Add PubSub attributes in addition to the message body")
|
man.addConfigBool("pubsub.add_attributes", false, "Add PubSub attributes in addition to the message body")
|
||||||
|
|
||||||
// Filesystem
|
// Filesystem
|
||||||
man.addConfigString("filesystem.status_log_file", "/tmp/osquery_status",
|
man.addConfigString("filesystem.status_log_file", filepath.Join(os.TempDir(), "osquery_status"),
|
||||||
"Log file path to use for status logs")
|
"Log file path to use for status logs")
|
||||||
man.addConfigString("filesystem.result_log_file", "/tmp/osquery_result",
|
man.addConfigString("filesystem.result_log_file", filepath.Join(os.TempDir(), "osquery_result"),
|
||||||
"Log file path to use for result logs")
|
"Log file path to use for result logs")
|
||||||
man.addConfigBool("filesystem.enable_log_rotation", false,
|
man.addConfigBool("filesystem.enable_log_rotation", false,
|
||||||
"Enable automatic rotation for osquery log files")
|
"Enable automatic rotation for osquery log files")
|
||||||
@ -659,6 +661,10 @@ func (man Manager) loadConfigFile() {
|
|||||||
// TestConfig returns a barebones configuration suitable for use in tests.
|
// TestConfig returns a barebones configuration suitable for use in tests.
|
||||||
// Individual tests may want to override some of the values provided.
|
// Individual tests may want to override some of the values provided.
|
||||||
func TestConfig() FleetConfig {
|
func TestConfig() FleetConfig {
|
||||||
|
var testLogFile = "/dev/null"
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
testLogFile = "NUL"
|
||||||
|
}
|
||||||
return FleetConfig{
|
return FleetConfig{
|
||||||
App: AppConfig{
|
App: AppConfig{
|
||||||
TokenKeySize: 24,
|
TokenKeySize: 24,
|
||||||
@ -686,8 +692,8 @@ func TestConfig() FleetConfig {
|
|||||||
DisableBanner: true,
|
DisableBanner: true,
|
||||||
},
|
},
|
||||||
Filesystem: FilesystemConfig{
|
Filesystem: FilesystemConfig{
|
||||||
StatusLogFile: "/dev/null",
|
StatusLogFile: testLogFile,
|
||||||
ResultLogFile: "/dev/null",
|
ResultLogFile: testLogFile,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user