diff --git a/cmd/fleet/config_dump.go b/cmd/fleet/config_dump.go index a99fb04b77..b35d8e51bc 100644 --- a/cmd/fleet/config_dump.go +++ b/cmd/fleet/config_dump.go @@ -16,7 +16,7 @@ func createConfigDumpCmd(configManager config.Manager) *cobra.Command { Long: ` Dump the parsed configuration in yaml format. -Kolide retrieves configuration options from many locations, and it can be +Fleet retrieves configuration options from many locations, and it can be useful to see the result of merging those configs. The following precedence is used when reading configs: diff --git a/docs/1-Using-Fleet/2-fleetctl-CLI.md b/docs/1-Using-Fleet/2-fleetctl-CLI.md index 9991b4bc4e..6f82f85eb3 100644 --- a/docs/1-Using-Fleet/2-fleetctl-CLI.md +++ b/docs/1-Using-Fleet/2-fleetctl-CLI.md @@ -493,7 +493,7 @@ spec: org_logo_url: "https://example.org/logo.png" org_name: Example Org server_settings: - kolide_server_url: https://fleet.example.org:8080 + server_url: https://fleet.example.org:8080 smtp_settings: authentication_method: authmethod_plain authentication_type: authtype_username_password diff --git a/docs/1-Using-Fleet/3-REST-API.md b/docs/1-Using-Fleet/3-REST-API.md index f5ed734729..0059ad2d94 100644 --- a/docs/1-Using-Fleet/3-REST-API.md +++ b/docs/1-Using-Fleet/3-REST-API.md @@ -4043,7 +4043,7 @@ None. "org_logo_url": "" }, "server_settings": { - "kolide_server_url": "https://localhost:8080", + "server_url": "https://localhost:8080", "live_query_disabled": false }, "smtp_settings": { @@ -4092,7 +4092,7 @@ Modifies the Fleet's configuration with the supplied information. | --------------------- | ------- | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | org_name | string | body | _Organization information_. The organization name. | | org_logo_url | string | body | _Organization information_. The URL for the organization logo. | -| kolide_server_url | string | body | _Server settings_. The Fleet server URL. | +| server_url | string | body | _Server settings_. The Fleet server URL. | | live_query_disabled | boolean | body | _Server settings_. Whether the live query capabilities are disabled. | | enable_smtp | boolean | body | _SMTP settings_. Whether SMTP is enabled for the Fleet app. | | sender_address | string | body | _SMTP settings_. The sender email address for the Fleet app. An invitation email is an example of the emails that may use this sender address | @@ -4147,7 +4147,7 @@ Modifies the Fleet's configuration with the supplied information. "org_logo_url": "https://fleetdm.com/logo.png" }, "server_settings": { - "kolide_server_url": "https://localhost:8080", + "server_url": "https://localhost:8080", "live_query_disabled": false }, "smtp_settings": { diff --git a/docs/3-Deployment/2-Configuration.md b/docs/3-Deployment/2-Configuration.md index 570899ce95..1ed9ebb51a 100644 --- a/docs/3-Deployment/2-Configuration.md +++ b/docs/3-Deployment/2-Configuration.md @@ -144,39 +144,39 @@ The address of the MySQL server which Fleet should connect to. Include the hostn The name of the MySQL database which Fleet will use. -- Default value: `kolide` +- Default value: `fleet` - Environment variable: `FLEET_MYSQL_DATABASE` - Config file format: ``` mysql: - database: kolide + database: fleet ``` ###### `mysql_username` The username to use when connecting to the MySQL instance. -- Default value: `kolide` +- Default value: `fleet` - Environment variable: `FLEET_MYSQL_USERNAME` - Config file format: ``` mysql: - username: kolide + username: fleet ``` ###### `mysql_password` The password to use when connecting to the MySQL instance. -- Default value: `kolide` +- Default value: `fleet` - Environment variable: `FLEET_MYSQL_PASSWORD` - Config file format: ``` mysql: - password: kolide + password: fleet ``` ##### `mysql_password_path` @@ -371,26 +371,26 @@ The TLS cert to use when terminating TLS. See [TLS certificate considerations](./1-Installation.md#tls-certificate-considerations) for more information about certificates and Fleet. -- Default value: `./tools/osquery/kolide.crt` +- Default value: `./tools/osquery/fleet.crt` - Environment variable: `FLEET_SERVER_CERT` - Config file format: ``` server: - cert: /tmp/kolide.crt + cert: /tmp/fleet.crt ``` ###### `server_key` The TLS key to use when terminating TLS. -- Default value: `./tools/osquery/kolide.key` +- Default value: `./tools/osquery/fleet.key` - Environment variable: `FLEET_SERVER_KEY` - Config file format: ``` server: - key: /tmp/kolide.key + key: /tmp/fleet.key ``` ###### `server_tls` @@ -1250,11 +1250,11 @@ AWS STS role ARN to use for S3 authentication. ## Managing osquery configurations -We recommend that you use an infrastructure configuration management tool to manage these osquery configurations consistently across your environment. If you're unsure about what configuration management tools your organization uses, contact your company's system administrators. If you are evaluating new solutions for this problem, the founders of Kolide have successfully managed configurations in large production environments using [Chef](https://www.chef.io/chef/) and [Puppet](https://puppet.com/). +We recommend that you use an infrastructure configuration management tool to manage these osquery configurations consistently across your environment. If you're unsure about what configuration management tools your organization uses, contact your company's system administrators. If you are evaluating new solutions for this problem, the founders of Fleet have successfully managed configurations in large production environments using [Chef](https://www.chef.io/chef/) and [Puppet](https://puppet.com/). ## Running with systemd -Once you've verified that you can run fleet in your shell, you'll likely want to keep fleet running in the background and after the server reboots. To do that we recommend using [systemd](https://coreos.com/os/docs/latest/getting-started-with-systemd.html). +Once you've verified that you can run Fleet in your shell, you'll likely want to keep Fleet running in the background and after the server reboots. To do that we recommend using [systemd](https://coreos.com/os/docs/latest/getting-started-with-systemd.html). Below is a sample unit file. @@ -1267,7 +1267,7 @@ After=network.target LimitNOFILE=8192 ExecStart=/usr/local/bin/fleet serve \ --mysql_address=127.0.0.1:3306 \ - --mysql_database=kolide \ + --mysql_database=fleet \ --mysql_username=root \ --mysql_password=toor \ --redis_address=127.0.0.1:6379 \ diff --git a/docs/3-Deployment/4-Example-deployment-scenarios.md b/docs/3-Deployment/4-Example-deployment-scenarios.md index 71a3f62325..cf4998f373 100644 --- a/docs/3-Deployment/4-Example-deployment-scenarios.md +++ b/docs/3-Deployment/4-Example-deployment-scenarios.md @@ -1,4 +1,5 @@ # Example deployment scenarios + - [Fleet on CentOS](#fleet-on-centos) - [Setting up a host](#setting-up-a-host) - [Installing Fleet](#installing-fleet) @@ -75,13 +76,15 @@ sudo systemctl start mysqld ``` Let's set a password for the MySQL root user. -MySQL creates an initial temporary root password which you can find in ```/var/log/mysqld.log``` you will need this password to change the root password. +MySQL creates an initial temporary root password which you can find in `/var/log/mysqld.log` you will need this password to change the root password. Connect to MySQL + ``` mysql -u root -p ``` -When prompted enter in the temporary password from ```/var/log/mysqld.log``` + +When prompted enter in the temporary password from `/var/log/mysqld.log` Change root password, in this case we will use `toor?Fl33t` as default password validation requires a more complex password. @@ -96,23 +99,30 @@ For MySQL 5.7.5 and older, use: ``` mysql> SET PASSWORD FOR "root"@"localhost" = PASSWORD("toor?Fl33t"); ``` + Now issue the command + ``` mysql> flush privileges; ``` + And exit MySQL + ``` mysql> exit ``` + Stop MySQL and start again + ``` sudo mysqld stop sudo systemctl start mysqld ``` -It's also worth creating a MySQL database for us to use at this point. Run the following to create the `kolide` database in MySQL. Note that you will be prompted for the password you created above. + +It's also worth creating a MySQL database for us to use at this point. Run the following to create the `fleet` database in MySQL. Note that you will be prompted for the password you created above. ``` -echo 'CREATE DATABASE kolide;' | mysql -u root -p +echo 'CREATE DATABASE fleet;' | mysql -u root -p ``` #### Redis @@ -137,7 +147,7 @@ Now that we have installed Fleet, MySQL, and Redis, we are ready to launch Fleet ``` /usr/bin/fleet prepare db \ --mysql_address=127.0.0.1:3306 \ - --mysql_database=kolide \ + --mysql_database=fleet \ --mysql_username=root \ --mysql_password=toor?Fl33t ``` @@ -167,7 +177,7 @@ Now we are ready to run the server! We do this via `fleet serve`: ``` /usr/bin/fleet serve \ --mysql_address=127.0.0.1:3306 \ - --mysql_database=kolide \ + --mysql_database=fleet \ --mysql_username=root \ --mysql_password=toor \ --redis_address=127.0.0.1:6379 \ @@ -175,7 +185,8 @@ Now we are ready to run the server! We do this via `fleet serve`: --server_key=/tmp/server.key \ --logging_json ``` -You will be prompted to add a value for ```--auth_jwt_key```. A randomly generated key will be suggested, you can simply add the flag with the suggested key. + +You will be prompted to add a value for `--auth_jwt_key`. A randomly generated key will be suggested, you can simply add the flag with the suggested key. Now, if you go to [https://localhost:8080](https://localhost:8080) in your local browser, you should be redirected to [https://localhost:8080/setup](https://localhost:8080/setup) where you can create your first Fleet user account. @@ -183,7 +194,6 @@ Now, if you go to [https://localhost:8080](https://localhost:8080) in your local See [Running with systemd](./2-Configuration.md#running-with-systemd) for documentation on running fleet as a background process and managing the fleet server logs. - ### Installing and running osquery > Note that this whole process is outlined in more detail in the [Adding Hosts To Fleet](./3-Adding-hosts.md) document. The steps are repeated here for the sake of a continuous tutorial. @@ -199,7 +209,7 @@ You will need to set the osquery enroll secret and osquery server certificate. I ![Add New Host](../images/add-new-host-modal.png) -If you select "Fetch Kolide Certificate", your browser will download the appropriate file to your downloads directory (to a file probably called `localhost-8080.pem`). Copy this file to your CentOS host at `/var/osquery/server.pem`. +If you select "Fetch Fleet Certificate", your browser will download the appropriate file to your downloads directory (to a file probably called `localhost-8080.pem`). Copy this file to your CentOS host at `/var/osquery/server.pem`. You can also select "Reveal Secret" on that modal and the enrollment secret for your Fleet instance will be revealed. Copy that text and create a file with its contents: @@ -279,10 +289,10 @@ ps aux | grep mysqld mysql 13158 3.1 14.4 1105320 146408 ? Ssl 21:36 0:00 /usr/sbin/mysqld ``` -It's also worth creating a MySQL database for us to use at this point. Run the following to create the `kolide` database in MySQL. Note that you will be prompted for the password you created above. +It's also worth creating a MySQL database for us to use at this point. Run the following to create the `fleet` database in MySQL. Note that you will be prompted for the password you created above. ``` -echo 'CREATE DATABASE kolide;' | mysql -u root -p +echo 'CREATE DATABASE fleet;' | mysql -u root -p ``` #### Redis @@ -308,7 +318,7 @@ Now that we have installed Fleet, MySQL, and Redis, we are ready to launch Fleet ``` /usr/bin/fleet prepare db \ --mysql_address=127.0.0.1:3306 \ - --mysql_database=kolide \ + --mysql_database=fleet \ --mysql_username=root \ --mysql_password=toor ``` @@ -336,7 +346,7 @@ Now we are ready to run the server! We do this via `fleet serve`: ``` /usr/bin/fleet serve \ --mysql_address=127.0.0.1:3306 \ - --mysql_database=kolide \ + --mysql_database=fleet \ --mysql_username=root \ --mysql_password=toor \ --redis_address=127.0.0.1:6379 \ @@ -344,6 +354,7 @@ Now we are ready to run the server! We do this via `fleet serve`: --server_key=/tmp/server.key \ --logging_json ``` + You will be prompted to add a value for `--auth_jwt_key`. A randomly generated key will be suggested, you can simply add the flag with the suggested key. Now, if you go to [https://localhost:8080](https://localhost:8080) in your local browser, you should be redirected to [https://localhost:8080/setup](https://localhost:8080/setup) where you can create your first Fleet user account. @@ -352,7 +363,6 @@ Now, if you go to [https://localhost:8080](https://localhost:8080) in your local See [Running with systemd](./2-Configuration.md#running-with-systemd) for documentation on running fleet as a background process and managing the fleet server logs. - ### Installing and running osquery > Note that this whole process is outlined in more detail in the [Adding Hosts To Fleet](./3-Adding-hosts.md) document. The steps are repeated here for the sake of a continuous tutorial. @@ -406,7 +416,6 @@ sudo /usr/bin/osqueryd \ If you go back to [https://localhost:8080/hosts/manage](https://localhost:8080/hosts/manage), you should have a host successfully enrolled in Fleet! - ## Deploying Fleet on Kubernetes In this guide, we're going to install Fleet and all of its application dependencies on a Kubernetes cluster. Kubernetes is a container orchestration tool that was open sourced by Google in 2014. @@ -425,13 +434,13 @@ The MySQL that we will use for this tutorial is not replicated and it is not Hig To install MySQL from Helm, run the following command. Note that there are some options that are specified. These options basically just enumerate that: -- There should be a `kolide` database created -- The default user's username should be `kolide` +- There should be a `fleet` database created +- The default user's username should be `fleet` ``` helm install \ --name fleet-database \ - --set mysqlUser=kolide,mysqlDatabase=kolide \ + --set mysqlUser=fleet,mysqlDatabase=fleet \ stable/mysql ``` diff --git a/docs/4-Contribution/FAQ.md b/docs/4-Contribution/FAQ.md index 26538cc68e..5c433e0566 100644 --- a/docs/4-Contribution/FAQ.md +++ b/docs/4-Contribution/FAQ.md @@ -1,4 +1,5 @@ # Contribution FAQ + - [Make errors](#make-errors) - [`dep: command not found`](#dep-command-not-found) - [`undefined: Asset`](#undefined-asset) @@ -20,7 +21,7 @@ See the Go language documentation for [workspaces](https://golang.org/doc/code.h ### `undefined: Asset` ``` -server/kolide/emails.go:90:23: undefined: Asset +server/fleet/emails.go:90:23: undefined: Asset make: *** [fleet] Error 2 ``` @@ -34,7 +35,7 @@ Visit [locahost:8025](http://localhost:8025) to view Mailhog's admin interface w ## Adding hosts for testing -The `osquery` directory contains a docker-compose.yml and additional configuration files to start containerized osquery agents. +The `osquery` directory contains a docker-compose.yml and additional configuration files to start containerized osquery agents. To start osquery, first retrieve the "Enroll Secret" from Fleet (by clicking the "Add New Host") button in the Fleet dashboard, or with `fleetctl get enroll-secret`). diff --git a/frontend/components/forms/RegistrationForm/ConfirmationPage/ConfirmationPage.jsx b/frontend/components/forms/RegistrationForm/ConfirmationPage/ConfirmationPage.jsx index 30e1387b8b..292cf76d5e 100644 --- a/frontend/components/forms/RegistrationForm/ConfirmationPage/ConfirmationPage.jsx +++ b/frontend/components/forms/RegistrationForm/ConfirmationPage/ConfirmationPage.jsx @@ -59,7 +59,7 @@ class ConfirmationPage extends Component { handleSubmit, formData: { email, - kolide_server_url: kolideWebAddress, + server_url: kolideWebAddress, org_name: orgName, username, }, diff --git a/frontend/components/forms/RegistrationForm/ConfirmationPage/ConfirmationPage.tests.jsx b/frontend/components/forms/RegistrationForm/ConfirmationPage/ConfirmationPage.tests.jsx index 7ea12bba60..0f8a6c71d8 100644 --- a/frontend/components/forms/RegistrationForm/ConfirmationPage/ConfirmationPage.tests.jsx +++ b/frontend/components/forms/RegistrationForm/ConfirmationPage/ConfirmationPage.tests.jsx @@ -9,7 +9,7 @@ describe("ConfirmationPage - form", () => { username: "jmeller", email: "jason@kolide.co", org_name: "Kolide", - kolide_server_url: "http://kolide.kolide.co", + server_url: "http://kolide.kolide.co", }; it("renders the user information", () => { @@ -20,7 +20,7 @@ describe("ConfirmationPage - form", () => { expect(form.text()).toContain(formData.username); expect(form.text()).toContain(formData.email); expect(form.text()).toContain(formData.org_name); - expect(form.text()).toContain(formData.kolide_server_url); + expect(form.text()).toContain(formData.server_url); }); it("submits the form", () => { diff --git a/frontend/components/forms/RegistrationForm/KolideDetails/KolideDetails.jsx b/frontend/components/forms/RegistrationForm/KolideDetails/KolideDetails.jsx index c17ac0d576..c12ce59c3f 100644 --- a/frontend/components/forms/RegistrationForm/KolideDetails/KolideDetails.jsx +++ b/frontend/components/forms/RegistrationForm/KolideDetails/KolideDetails.jsx @@ -7,7 +7,7 @@ import Button from "components/buttons/Button"; import helpers from "components/forms/RegistrationForm/KolideDetails/helpers"; import InputFieldWithIcon from "components/forms/fields/InputFieldWithIcon"; -const formFields = ["kolide_server_url"]; +const formFields = ["server_url"]; const { validate } = helpers; class KolideDetails extends Component { @@ -15,7 +15,7 @@ class KolideDetails extends Component { className: PropTypes.string, currentPage: PropTypes.bool, fields: PropTypes.shape({ - kolide_server_url: formFieldInterface.isRequired, + server_url: formFieldInterface.isRequired, }).isRequired, handleSubmit: PropTypes.func.isRequired, }; @@ -42,7 +42,7 @@ class KolideDetails extends Component {
{ describe("kolide web address input", () => { it("renders an input field", () => { const form = mount(); - const kolideWebAddressField = form.find({ name: "kolide_server_url" }); + const kolideWebAddressField = form.find({ name: "server_url" }); expect(kolideWebAddressField.length).toBeGreaterThan(0); }); it("updates state when the field changes", () => { const form = mount(); - const kolideWebAddressField = form - .find({ name: "kolide_server_url" }) + const serverAddressField = form + .find({ name: "server_url" }) .find("input"); - fillInFormInput(kolideWebAddressField, "https://gnar.kolide.co"); + fillInFormInput(serverAddressField, "https://gnar.kolide.co"); expect(form.state().formData).toMatchObject({ - kolide_server_url: "https://gnar.kolide.co", + server_url: "https://gnar.kolide.co", }); }); }); @@ -38,7 +38,7 @@ describe("KolideDetails - form", () => { expect(handleSubmitSpy).not.toHaveBeenCalled(); expect(form.state().errors).toMatchObject({ - kolide_server_url: "Kolide web address must be completed", + server_url: "Kolide web address must be completed", }); }); @@ -46,7 +46,7 @@ describe("KolideDetails - form", () => { const handleSubmitSpy = jest.fn(); const form = mount(); const kolideWebAddressField = form - .find({ name: "kolide_server_url" }) + .find({ name: "server_url" }) .find("input"); const htmlForm = form.find("form"); @@ -55,7 +55,7 @@ describe("KolideDetails - form", () => { expect(handleSubmitSpy).not.toHaveBeenCalled(); expect(form.state().errors).toMatchObject({ - kolide_server_url: "Kolide web address must start with https://", + server_url: "Kolide web address must start with https://", }); }); @@ -63,7 +63,7 @@ describe("KolideDetails - form", () => { const handleSubmitSpy = jest.fn(); const form = mount(); const kolideWebAddressField = form - .find({ name: "kolide_server_url" }) + .find({ name: "server_url" }) .find("input"); const htmlForm = form.find("form"); diff --git a/frontend/components/forms/RegistrationForm/KolideDetails/helpers.js b/frontend/components/forms/RegistrationForm/KolideDetails/helpers.js index d27f8917e7..fa42585519 100644 --- a/frontend/components/forms/RegistrationForm/KolideDetails/helpers.js +++ b/frontend/components/forms/RegistrationForm/KolideDetails/helpers.js @@ -2,14 +2,14 @@ import { size, startsWith } from "lodash"; const validate = (formData) => { const errors = {}; - const { kolide_server_url: kolideWebAddress } = formData; + const { server_url: kolideWebAddress } = formData; if (!kolideWebAddress) { - errors.kolide_server_url = "Kolide web address must be completed"; + errors.server_url = "Kolide web address must be completed"; } if (kolideWebAddress && !startsWith(kolideWebAddress, "https://")) { - errors.kolide_server_url = "Kolide web address must start with https://"; + errors.server_url = "Kolide web address must start with https://"; } const valid = !size(errors); diff --git a/frontend/components/forms/RegistrationForm/RegistrationForm.jsx b/frontend/components/forms/RegistrationForm/RegistrationForm.jsx index b0a51e5d4f..c21f8744c7 100644 --- a/frontend/components/forms/RegistrationForm/RegistrationForm.jsx +++ b/frontend/components/forms/RegistrationForm/RegistrationForm.jsx @@ -23,7 +23,7 @@ class RegistrationForm extends Component { this.state = { errors: {}, formData: { - kolide_server_url: window.location.origin, + server_url: window.location.origin, }, }; } diff --git a/frontend/components/forms/admin/AppConfigForm/AppConfigForm.jsx b/frontend/components/forms/admin/AppConfigForm/AppConfigForm.jsx index ad2b5a08b8..2294a836bc 100644 --- a/frontend/components/forms/admin/AppConfigForm/AppConfigForm.jsx +++ b/frontend/components/forms/admin/AppConfigForm/AppConfigForm.jsx @@ -30,7 +30,7 @@ const formFields = [ "domain", "enable_ssl_tls", "enable_start_tls", - "kolide_server_url", + "server_url", "org_logo_url", "org_name", "osquery_enroll_secret", @@ -80,7 +80,7 @@ class AppConfigForm extends Component { domain: formFieldInterface.isRequired, enable_ssl_tls: formFieldInterface.isRequired, enable_start_tls: formFieldInterface.isRequired, - kolide_server_url: formFieldInterface.isRequired, + server_url: formFieldInterface.isRequired, org_logo_url: formFieldInterface.isRequired, org_name: formFieldInterface.isRequired, password: formFieldInterface.isRequired, @@ -227,7 +227,7 @@ class AppConfigForm extends Component {
diff --git a/frontend/components/forms/admin/AppConfigForm/AppConfigForm.tests.jsx b/frontend/components/forms/admin/AppConfigForm/AppConfigForm.tests.jsx index 1812b6bd8a..c020324ca1 100644 --- a/frontend/components/forms/admin/AppConfigForm/AppConfigForm.tests.jsx +++ b/frontend/components/forms/admin/AppConfigForm/AppConfigForm.tests.jsx @@ -32,7 +32,7 @@ describe("AppConfigForm - form", () => { describe("Fleet App URL input", () => { it("renders an input field", () => { - itBehavesLikeAFormInputElement(form, "kolide_server_url"); + itBehavesLikeAFormInputElement(form, "server_url"); }); }); diff --git a/frontend/components/forms/admin/AppConfigForm/validate.js b/frontend/components/forms/admin/AppConfigForm/validate.js index 32b0198272..02161818d1 100644 --- a/frontend/components/forms/admin/AppConfigForm/validate.js +++ b/frontend/components/forms/admin/AppConfigForm/validate.js @@ -4,7 +4,7 @@ export default (formData) => { const errors = {}; const { authentication_type: authType, - kolide_server_url: kolideServerUrl, + server_url: kolideServerUrl, org_name: orgName, enable_smtp: enableSMTP, password: smtpPassword, @@ -34,7 +34,7 @@ export default (formData) => { } if (!kolideServerUrl) { - errors.kolide_server_url = "Fleet Server URL must be present"; + errors.server_url = "Fleet Server URL must be present"; } if (!orgName) { diff --git a/frontend/components/forms/admin/AppConfigForm/validate.tests.js b/frontend/components/forms/admin/AppConfigForm/validate.tests.js index 74efd970e6..d9b481050d 100644 --- a/frontend/components/forms/admin/AppConfigForm/validate.tests.js +++ b/frontend/components/forms/admin/AppConfigForm/validate.tests.js @@ -4,7 +4,7 @@ describe("AppConfigForm - validations", () => { const validFormData = { org_name: "The Gnar Co.", authentication_type: "username_password", - kolide_server_url: "https://gnar.dog", + server_url: "https://gnar.dog", sender_address: "hi@gnar.dog", enable_smtp: true, server: "192.168.99.100", @@ -33,16 +33,16 @@ describe("AppConfigForm - validations", () => { }); }); - it("validates presence of the kolide_server_url field", () => { + it("validates presence of the server_url field", () => { const invalidFormData = { ...validFormData, - kolide_server_url: "", + server_url: "", }; expect(validate(invalidFormData)).toEqual({ valid: false, errors: { - kolide_server_url: "Fleet Server URL must be present", + server_url: "Fleet Server URL must be present", }, }); }); diff --git a/frontend/interfaces/config.ts b/frontend/interfaces/config.ts index 9e231d1b44..cbabd76498 100644 --- a/frontend/interfaces/config.ts +++ b/frontend/interfaces/config.ts @@ -10,7 +10,7 @@ export default PropTypes.shape({ enable_start_tls: PropTypes.bool, host_expiry_enabled: PropTypes.bool, host_expiry_window: PropTypes.number, - kolide_server_url: PropTypes.string, + server_url: PropTypes.string, org_logo_url: PropTypes.string, org_name: PropTypes.string, password: PropTypes.string, @@ -32,7 +32,7 @@ export interface IConfig { enable_start_tls: boolean; host_expiry_enabled: boolean; host_expiry_window: number; - kolide_server_url: string; + server_url: string; org_logo_url: string; org_name: string; password: string; diff --git a/frontend/kolide/entities/account.tests.js b/frontend/kolide/entities/account.tests.js index 816e71c109..e9939da479 100644 --- a/frontend/kolide/entities/account.tests.js +++ b/frontend/kolide/entities/account.tests.js @@ -16,7 +16,7 @@ describe("Kolide - API client (account)", () => { const formData = { email: "hi@gnar.dog", name: "Gnar Dog", - kolide_server_url: "https://gnar.kolide.co", + server_url: "https://gnar.kolide.co", org_logo_url: "https://thegnar.co/assets/logo.png", org_name: "The Gnar Co.", password: "p@ssw0rd", diff --git a/frontend/kolide/entities/config.tests.js b/frontend/kolide/entities/config.tests.js index a543d46d87..4e12890514 100644 --- a/frontend/kolide/entities/config.tests.js +++ b/frontend/kolide/entities/config.tests.js @@ -30,7 +30,7 @@ describe("Kolide - API client (config)", () => { const formData = { org_name: "Kolide", org_logo_url: "0.0.0.0:8080/logo.png", - kolide_server_url: "", + server_url: "", configured: false, sender_address: "", server: "", diff --git a/frontend/kolide/helpers.tests.js b/frontend/kolide/helpers.tests.js index 407aa5ecfd..6094092a4c 100644 --- a/frontend/kolide/helpers.tests.js +++ b/frontend/kolide/helpers.tests.js @@ -21,7 +21,7 @@ describe("Kolide API - helpers", () => { const config = { org_name: "Kolide", org_logo_url: "0.0.0.0:8080/logo.png", - kolide_server_url: "", + server_url: "", configured: false, domain: "", smtp_enabled: true, @@ -50,11 +50,11 @@ describe("Kolide API - helpers", () => { expect( formatConfigDataForServer({ org_name: "The Gnar Co", - kolide_server_url: "https://example.com", + server_url: "https://example.com", }) ).toEqual({ org_info: { org_name: "The Gnar Co" }, - server_settings: { kolide_server_url: "https://example.com" }, + server_settings: { server_url: "https://example.com" }, }); expect( formatConfigDataForServer({ domain: "https://kolide.co" }) @@ -172,7 +172,7 @@ describe("Kolide API - helpers", () => { const formData = { email: "hi@gnar.dog", name: "Gnar Dog", - kolide_server_url: "https://gnar.kolide.co", + server_url: "https://gnar.kolide.co", org_logo_url: "https://thegnar.co/assets/logo.png", org_name: "The Gnar Co.", password: "p@ssw0rd", @@ -182,7 +182,7 @@ describe("Kolide API - helpers", () => { it("formats the form data to send to the server", () => { expect(helpers.setupData(formData)).toEqual({ - kolide_server_url: "https://gnar.kolide.co", + server_url: "https://gnar.kolide.co", org_info: { org_logo_url: "https://thegnar.co/assets/logo.png", org_name: "The Gnar Co.", diff --git a/frontend/kolide/helpers.ts b/frontend/kolide/helpers.ts index 0853083f39..ad1ef61380 100644 --- a/frontend/kolide/helpers.ts +++ b/frontend/kolide/helpers.ts @@ -84,7 +84,7 @@ const filterTarget = (targetType: string) => { export const formatConfigDataForServer = (config: any): any => { const orgInfoAttrs = pick(config, ["org_logo_url", "org_name"]); const serverSettingsAttrs = pick(config, [ - "kolide_server_url", + "server_url", "osquery_enroll_secret", "live_query_disabled", ]); @@ -250,7 +250,7 @@ const setupData = (formData: any) => { const adminInfo = pick(formData, ADMIN_ATTRS); return { - kolide_server_url: formData.kolide_server_url, + server_url: formData.server_url, org_info: { ...orgInfo, }, diff --git a/frontend/pages/hosts/ManageHostsPage/components/AddHostModal/AddHostModal.jsx b/frontend/pages/hosts/ManageHostsPage/components/AddHostModal/AddHostModal.jsx index 17689d6b0a..e49b0f1aaa 100644 --- a/frontend/pages/hosts/ManageHostsPage/components/AddHostModal/AddHostModal.jsx +++ b/frontend/pages/hosts/ManageHostsPage/components/AddHostModal/AddHostModal.jsx @@ -90,9 +90,9 @@ class AddHostModal extends Component { const { fetchCertificateError, selectedTeam } = this.state; const { createTeamDropdownOptions, onChangeSelectTeam } = this; - let tlsHostname = config.kolide_server_url; + let tlsHostname = config.server_url; try { - const serverUrl = new URL(config.kolide_server_url); + const serverUrl = new URL(config.server_url); tlsHostname = serverUrl.hostname; if (serverUrl.port) { tlsHostname += `:${serverUrl.port}`; diff --git a/frontend/redux/nodes/auth/actions.js b/frontend/redux/nodes/auth/actions.js index e02e101481..bec41af3f1 100644 --- a/frontend/redux/nodes/auth/actions.js +++ b/frontend/redux/nodes/auth/actions.js @@ -170,7 +170,7 @@ export const setup = (registrationFormData) => { dispatch( configSuccess({ - kolide_server_url: response.kolide_server_url, + server_url: response.server_url, ...response.org_info, }) ); diff --git a/frontend/test/stubs.ts b/frontend/test/stubs.ts index c7d3d752fd..d4af1072fc 100644 --- a/frontend/test/stubs.ts +++ b/frontend/test/stubs.ts @@ -15,7 +15,7 @@ export const configStub = { org_logo_url: "0.0.0.0:8080/logo.png", }, server_settings: { - kolide_server_url: "", + server_url: "", live_query_disabled: false, }, smtp_settings: { @@ -41,7 +41,7 @@ export const configStub = { export const flatConfigStub = { org_name: "Kolide", org_logo_url: "0.0.0.0:8080/logo.png", - kolide_server_url: "", + server_url: "", configured: false, domain: "", sender_address: "", diff --git a/frontend/utilities/format_api_errors/format_api_errors.tests.js b/frontend/utilities/format_api_errors/format_api_errors.tests.js index c4720444d5..289c3738ed 100644 --- a/frontend/utilities/format_api_errors/format_api_errors.tests.js +++ b/frontend/utilities/format_api_errors/format_api_errors.tests.js @@ -9,7 +9,7 @@ describe("formatApiErrors", () => { reason: "is not the correct format", }, { - name: "kolide_server_url", + name: "server_url", reason: "must be present", }, ], @@ -19,7 +19,7 @@ describe("formatApiErrors", () => { it("formats errors for the Form HOC", () => { expect(formatApiErrors(errorStub)).toEqual({ email: "is not the correct format", - kolide_server_url: "must be present", + server_url: "must be present", }); }); }); diff --git a/go.sum b/go.sum index 7c21d6a23a..5e4697cdce 100644 --- a/go.sum +++ b/go.sum @@ -444,6 +444,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= diff --git a/server/contexts/token/token.go b/server/contexts/token/token.go index e778caa1a2..4c23807a43 100644 --- a/server/contexts/token/token.go +++ b/server/contexts/token/token.go @@ -12,7 +12,7 @@ type key int const tokenKey key = 0 -// Token is the concrete type which represents kolide session tokens +// Token is the concrete type that represents Fleet session tokens type Token string // FromHTTPRequest extracts an Authorization diff --git a/server/datastore/datastore_app.go b/server/datastore/datastore_app.go index 472d50653d..3060f37a78 100644 --- a/server/datastore/datastore_app.go +++ b/server/datastore/datastore_app.go @@ -12,7 +12,7 @@ import ( func testOrgInfo(t *testing.T, ds fleet.Datastore) { info := &fleet.AppConfig{ - OrgName: "Kolide", + OrgName: "Test", OrgLogoURL: "localhost:8080/logo.png", } @@ -25,7 +25,7 @@ func testOrgInfo(t *testing.T, ds fleet.Datastore) { assert.Equal(t, info2.OrgName, info.OrgName) assert.False(t, info2.SMTPConfigured) - info2.OrgName = "koolide" + info2.OrgName = "testss" info2.SMTPDomain = "foo" info2.SMTPConfigured = true info2.SMTPSenderAddress = "123" @@ -39,7 +39,7 @@ func testOrgInfo(t *testing.T, ds fleet.Datastore) { info2.SMTPVerifySSLCerts = true info2.SMTPEnableStartTLS = true info2.EnableSSO = true - info2.EntityID = "kolide" + info2.EntityID = "test" info2.MetadataURL = "https://idp.com/metadata.xml" info2.IssuerURI = "https://idp.issuer.com" info2.IDPName = "My IDP" @@ -59,7 +59,7 @@ func testOrgInfo(t *testing.T, ds fleet.Datastore) { func testAdditionalQueries(t *testing.T, ds fleet.Datastore) { additional := json.RawMessage("not valid json") info := &fleet.AppConfig{ - OrgName: "Kolide", + OrgName: "Test", OrgLogoURL: "localhost:8080/logo.png", AdditionalQueries: &additional, } diff --git a/server/datastore/inmem/inmem.go b/server/datastore/inmem/inmem.go index 8cf3e9edb5..fb2ab54f62 100644 --- a/server/datastore/inmem/inmem.go +++ b/server/datastore/inmem/inmem.go @@ -405,8 +405,8 @@ func (d *Datastore) createDevHosts() error { func (d *Datastore) createDevOrgInfo() error { devOrgInfo := &fleet.AppConfig{ - KolideServerURL: "http://localhost:8080", - OrgName: "Kolide", + ServerURL: "http://localhost:8080", + OrgName: "Test", OrgLogoURL: fmt.Sprintf("https://%s/assets/images/fleet-logo.svg", d.config.Server.Address), SMTPPort: 587, SMTPAuthenticationType: fleet.AuthTypeUserNamePassword, diff --git a/server/datastore/mysql/app_configs.go b/server/datastore/mysql/app_configs.go index e3ccf03fe6..c86ddf8af5 100644 --- a/server/datastore/mysql/app_configs.go +++ b/server/datastore/mysql/app_configs.go @@ -93,7 +93,7 @@ func (d *Datastore) SaveAppConfig(info *fleet.AppConfig) error { id, org_name, org_logo_url, - kolide_server_url, + server_url, smtp_configured, smtp_sender_address, smtp_server, @@ -125,7 +125,7 @@ func (d *Datastore) SaveAppConfig(info *fleet.AppConfig) error { ON DUPLICATE KEY UPDATE org_name = VALUES(org_name), org_logo_url = VALUES(org_logo_url), - kolide_server_url = VALUES(kolide_server_url), + server_url = VALUES(server_url), smtp_configured = VALUES(smtp_configured), smtp_sender_address = VALUES(smtp_sender_address), smtp_server = VALUES(smtp_server), @@ -157,7 +157,7 @@ func (d *Datastore) SaveAppConfig(info *fleet.AppConfig) error { _, err = d.db.Exec(insertStatement, info.OrgName, info.OrgLogoURL, - info.KolideServerURL, + info.ServerURL, info.SMTPConfigured, info.SMTPSenderAddress, info.SMTPServer, diff --git a/server/datastore/mysql/migrations/tables/20170519105647_AddNameToDecorators.go b/server/datastore/mysql/migrations/tables/20170519105647_AddNameToDecorators.go index ff4842b267..bc01c8f3e6 100644 --- a/server/datastore/mysql/migrations/tables/20170519105647_AddNameToDecorators.go +++ b/server/datastore/mysql/migrations/tables/20170519105647_AddNameToDecorators.go @@ -20,6 +20,6 @@ func Up_20170519105647(tx *sql.Tx) error { } func Down_20170519105647(tx *sql.Tx) error { - _, err := tx.Exec("ALTER TABLE `kolide`.`decorators` DROP COLUMN `name` ;") + _, err := tx.Exec("ALTER TABLE `decorators` DROP COLUMN `name` ;") return err } diff --git a/server/datastore/mysql/migrations/tables/20210606151329_MigrateNames.go b/server/datastore/mysql/migrations/tables/20210606151329_MigrateNames.go new file mode 100644 index 0000000000..ebc6678adb --- /dev/null +++ b/server/datastore/mysql/migrations/tables/20210606151329_MigrateNames.go @@ -0,0 +1,27 @@ +package tables + +import ( + "database/sql" + + "github.com/pkg/errors" +) + +func init() { + MigrationClient.AddMigration(Up_20210606151329, Down_20210606151329) +} + +func Up_20210606151329(tx *sql.Tx) error { + sql := ` + ALTER TABLE app_configs + CHANGE kolide_server_url server_url varchar(255) NOT NULL DEFAULT '' + ` + + if _, err := tx.Exec(sql); err != nil { + return errors.Wrap(err, "rename server_url") + } + return nil +} + +func Down_20210606151329(tx *sql.Tx) error { + return nil +} diff --git a/server/fleet/app.go b/server/fleet/app.go index f6ef16ef55..f7bf26bc83 100644 --- a/server/fleet/app.go +++ b/server/fleet/app.go @@ -106,10 +106,10 @@ func (m SMTPAuthMethod) String() string { // AppConfig holds configuration about the Fleet application. // AppConfig data can be managed by a Fleet API user. type AppConfig struct { - ID uint - OrgName string `db:"org_name"` - OrgLogoURL string `db:"org_logo_url"` - KolideServerURL string `db:"kolide_server_url"` + ID uint + OrgName string `db:"org_name"` + OrgLogoURL string `db:"org_logo_url"` + ServerURL string `db:"server_url"` // SMTPConfigured is a flag that indicates if smtp has been successfully // tested with the settings provided by an admin user. @@ -273,9 +273,9 @@ type OrgInfo struct { OrgLogoURL *string `json:"org_logo_url,omitempty"` } -// ServerSettings contains general settings about the kolide App. +// ServerSettings contains general settings about the Fleet application. type ServerSettings struct { - KolideServerURL *string `json:"kolide_server_url,omitempty"` + ServerURL *string `json:"server_url,omitempty"` LiveQueryDisabled *bool `json:"live_query_disabled,omitempty"` } diff --git a/server/fleet/queries_test.go b/server/fleet/queries_test.go index 19788d71d9..bde1953352 100644 --- a/server/fleet/queries_test.go +++ b/server/fleet/queries_test.go @@ -23,10 +23,9 @@ apiVersion: k8s.fleet.com/v1alpha1 kind: OsqueryQuery spec: name: osquery_version - description: The version of the Launcher and Osquery process - query: select launcher.version, osquery.version from kolide_launcher_info + description: The osquery version info + query: select * from osquery_info support: - launcher: 0.3.0 osquery: 2.9.0 --- apiVersion: k8s.fleet.com/v1alpha1 @@ -46,17 +45,17 @@ spec: `, []*Query{ - &Query{ + { Name: "osquery_version", - Description: "The version of the Launcher and Osquery process", - Query: "select launcher.version, osquery.version from kolide_launcher_info", + Description: "The osquery version info", + Query: "select * from osquery_info", }, - &Query{ + { Name: "osquery_schedule", Description: "Report performance stats for each file in the query schedule.", Query: "select name, interval, executions, output_size, wall_time, (user_time", }, - &Query{ + { Name: "foobar", Description: "froobing", Query: "select fizz from frog", diff --git a/server/fleet/users.go b/server/fleet/users.go index f488e7481c..5d2b7caa9a 100644 --- a/server/fleet/users.go +++ b/server/fleet/users.go @@ -93,7 +93,7 @@ type UserService interface { ChangeUserEmail(ctx context.Context, token string) (string, error) } -// User is the model struct which represents a kolide user +// User is the model struct that represents a Fleet user. type User struct { UpdateCreateTimestamps ID uint `json:"id"` diff --git a/server/mail/mail_test.go b/server/mail/mail_test.go index becd85541a..a8219a0245 100644 --- a/server/mail/mail_test.go +++ b/server/mail/mail_test.go @@ -56,7 +56,7 @@ func testSMTPPlainAuth(t *testing.T, mailer fleet.MailService) { SMTPEnableStartTLS: true, SMTPPort: 1025, SMTPServer: "localhost", - SMTPSenderAddress: "kolide@fleet.com", + SMTPSenderAddress: "test@example.com", }, Mailer: &SMTPTestMailer{ BaseURL: "https://localhost:8080", @@ -82,7 +82,7 @@ func testSMTPSkipVerify(t *testing.T, mailer fleet.MailService) { SMTPEnableStartTLS: true, SMTPPort: 1025, SMTPServer: "localhost", - SMTPSenderAddress: "kolide@fleet.com", + SMTPSenderAddress: "test@example.com", }, Mailer: &SMTPTestMailer{ BaseURL: "https://localhost:8080", @@ -104,7 +104,7 @@ func testSMTPNoAuth(t *testing.T, mailer fleet.MailService) { SMTPVerifySSLCerts: true, SMTPPort: 1025, SMTPServer: "localhost", - SMTPSenderAddress: "kolide@fleet.com", + SMTPSenderAddress: "test@example.com", }, Mailer: &SMTPTestMailer{ BaseURL: "https://localhost:8080", @@ -126,7 +126,7 @@ func testMailTest(t *testing.T, mailer fleet.MailService) { SMTPVerifySSLCerts: true, SMTPPort: 1025, SMTPServer: "localhost", - SMTPSenderAddress: "kolide@fleet.com", + SMTPSenderAddress: "test@example.com", }, Mailer: &SMTPTestMailer{ BaseURL: "https://localhost:8080", diff --git a/server/service/client_setup.go b/server/service/client_setup.go index 2a0b14d52d..83388d4f9c 100644 --- a/server/service/client_setup.go +++ b/server/service/client_setup.go @@ -20,7 +20,7 @@ func (c *Client) Setup(email, username, password, org string) (string, error) { OrgInfo: &fleet.OrgInfo{ OrgName: &org, }, - KolideServerURL: &c.addr, + ServerURL: &c.addr, } response, err := c.Do("POST", "/api/v1/setup", "", params) diff --git a/server/service/endpoint_appconfig.go b/server/service/endpoint_appconfig.go index 23fcffe5a1..b55cfd78f4 100644 --- a/server/service/endpoint_appconfig.go +++ b/server/service/endpoint_appconfig.go @@ -71,7 +71,7 @@ func makeGetAppConfigEndpoint(svc fleet.Service) endpoint.Endpoint { OrgLogoURL: &config.OrgLogoURL, }, ServerSettings: &fleet.ServerSettings{ - KolideServerURL: &config.KolideServerURL, + ServerURL: &config.ServerURL, LiveQueryDisabled: &config.LiveQueryDisabled, }, SMTPSettings: smtpSettings, @@ -99,7 +99,7 @@ func makeModifyAppConfigEndpoint(svc fleet.Service) endpoint.Endpoint { OrgLogoURL: &config.OrgLogoURL, }, ServerSettings: &fleet.ServerSettings{ - KolideServerURL: &config.KolideServerURL, + ServerURL: &config.ServerURL, LiveQueryDisabled: &config.LiveQueryDisabled, }, SMTPSettings: smtpSettingsFromAppConfig(config), diff --git a/server/service/endpoint_sessions.go b/server/service/endpoint_sessions.go index eb3a3c2c92..79ba8b595e 100644 --- a/server/service/endpoint_sessions.go +++ b/server/service/endpoint_sessions.go @@ -21,8 +21,8 @@ type loginRequest struct { type loginResponse struct { User *fleet.User `json:"user,omitempty"` - Token string `json:"token,omitempty"` - Err error `json:"error,omitempty"` + Token string `json:"token,omitempty"` + Err error `json:"error,omitempty"` } func (r loginResponse) error() error { return r.Err } @@ -248,7 +248,7 @@ func makeCallbackSSOEndpoint(svc fleet.Service, urlPrefix string) endpoint.Endpo type ssoSettingsResponse struct { Settings *fleet.SSOSettings `json:"settings,omitempty"` - Err error `json:"error,omitempty"` + Err error `json:"error,omitempty"` } func (r ssoSettingsResponse) error() error { return r.Err } diff --git a/server/service/endpoint_setup.go b/server/service/endpoint_setup.go index 90323a63cf..a10dedb128 100644 --- a/server/service/endpoint_setup.go +++ b/server/service/endpoint_setup.go @@ -12,14 +12,14 @@ import ( type setupRequest struct { Admin *fleet.UserPayload `json:"admin"` OrgInfo *fleet.OrgInfo `json:"org_info"` - KolideServerURL *string `json:"kolide_server_url,omitempty"` + ServerURL *string `json:"server_url,omitempty"` EnrollSecret *string `json:"osquery_enroll_secret,omitempty"` } type setupResponse struct { Admin *fleet.User `json:"admin,omitempty"` OrgInfo *fleet.OrgInfo `json:"org_info,omitempty"` - KolideServerURL *string `json:"kolide_server_url"` + ServerURL *string `json:"server_url"` EnrollSecret *string `json:"osquery_enroll_secret"` Token *string `json:"token,omitempty"` Err error `json:"error,omitempty"` @@ -40,8 +40,8 @@ func makeSetupEndpoint(svc fleet.Service) endpoint.Endpoint { configPayload.OrgInfo = req.OrgInfo } configPayload.ServerSettings = &fleet.ServerSettings{} - if req.KolideServerURL != nil { - configPayload.ServerSettings.KolideServerURL = req.KolideServerURL + if req.ServerURL != nil { + configPayload.ServerSettings.ServerURL = req.ServerURL } config, err = svc.NewAppConfig(ctx, configPayload) if err != nil { @@ -84,7 +84,7 @@ func makeSetupEndpoint(svc fleet.Service) endpoint.Endpoint { OrgName: &config.OrgName, OrgLogoURL: &config.OrgLogoURL, }, - KolideServerURL: &config.KolideServerURL, + ServerURL: &config.ServerURL, Token: token, }, nil } diff --git a/server/service/endpoint_test.go b/server/service/endpoint_test.go index aceafb533d..18b3b69d9f 100644 --- a/server/service/endpoint_test.go +++ b/server/service/endpoint_test.go @@ -41,7 +41,7 @@ func setupEndpointTest(t *testing.T) *testResource { require.Nil(t, test.ds.MigrateData()) devOrgInfo := &fleet.AppConfig{ - OrgName: "Kolide", + OrgName: "Example", OrgLogoURL: "http://foo.bar/image.png", SMTPPort: 465, SMTPAuthenticationType: fleet.AuthTypeUserNamePassword, diff --git a/server/service/service_appconfig.go b/server/service/service_appconfig.go index 3b192c3012..c5f8e4f5f7 100644 --- a/server/service/service_appconfig.go +++ b/server/service/service_appconfig.go @@ -82,7 +82,7 @@ func (svc *Service) sendTestEmail(ctx context.Context, config *fleet.AppConfig) Subject: "Hello from Fleet", To: []string{vc.User.Email}, Mailer: &mail.SMTPTestMailer{ - BaseURL: template.URL(config.KolideServerURL + svc.config.Server.URLPrefix), + BaseURL: template.URL(config.ServerURL + svc.config.Server.URLPrefix), AssetURL: getAssetURL(), }, Config: config, @@ -135,8 +135,8 @@ func appConfigFromAppConfigPayload(p fleet.AppConfigPayload, config fleet.AppCon if p.OrgInfo != nil && p.OrgInfo.OrgName != nil { config.OrgName = *p.OrgInfo.OrgName } - if p.ServerSettings != nil && p.ServerSettings.KolideServerURL != nil { - config.KolideServerURL = cleanupURL(*p.ServerSettings.KolideServerURL) + if p.ServerSettings != nil && p.ServerSettings.ServerURL != nil { + config.ServerURL = cleanupURL(*p.ServerSettings.ServerURL) } if p.ServerSettings != nil && p.ServerSettings.LiveQueryDisabled != nil { config.LiveQueryDisabled = *p.ServerSettings.LiveQueryDisabled diff --git a/server/service/service_appconfig_test.go b/server/service/service_appconfig_test.go index f11878866e..ccc90d2596 100644 --- a/server/service/service_appconfig_test.go +++ b/server/service/service_appconfig_test.go @@ -49,7 +49,7 @@ func TestCreateAppConfig(t *testing.T) { OrgName: ptr.String("Acme"), }, ServerSettings: &fleet.ServerSettings{ - KolideServerURL: ptr.String("https://acme.co:8080/"), + ServerURL: ptr.String("https://acme.co:8080/"), LiveQueryDisabled: ptr.Bool(true), }, }, @@ -76,7 +76,7 @@ func TestCreateAppConfig(t *testing.T) { payload := tt.configPayload assert.Equal(t, *payload.OrgInfo.OrgLogoURL, result.OrgLogoURL) assert.Equal(t, *payload.OrgInfo.OrgName, result.OrgName) - assert.Equal(t, "https://acme.co:8080", result.KolideServerURL) + assert.Equal(t, "https://acme.co:8080", result.ServerURL) assert.Equal(t, *payload.ServerSettings.LiveQueryDisabled, result.LiveQueryDisabled) // Ensure enroll secret was set diff --git a/server/service/service_certificate.go b/server/service/service_certificate.go index e47aea4da2..4378494884 100644 --- a/server/service/service_certificate.go +++ b/server/service/service_certificate.go @@ -20,7 +20,7 @@ func (svc *Service) CertificateChain(ctx context.Context) ([]byte, error) { return nil, err } - u, err := url.Parse(config.KolideServerURL) + u, err := url.Parse(config.ServerURL) if err != nil { return nil, errors.Wrap(err, "parsing serverURL") } diff --git a/server/service/service_invites.go b/server/service/service_invites.go index 1b083894e9..4810571c3c 100644 --- a/server/service/service_invites.go +++ b/server/service/service_invites.go @@ -75,7 +75,7 @@ func (svc Service) InviteNewUser(ctx context.Context, payload fleet.InvitePayloa Config: config, Mailer: &mail.InviteMailer{ Invite: invite, - BaseURL: template.URL(config.KolideServerURL + svc.config.Server.URLPrefix), + BaseURL: template.URL(config.ServerURL + svc.config.Server.URLPrefix), AssetURL: getAssetURL(), OrgName: config.OrgName, InvitedByUsername: invitedBy, diff --git a/server/service/service_invites_test.go b/server/service/service_invites_test.go index 91df6a3d78..822c32e75a 100644 --- a/server/service/service_invites_test.go +++ b/server/service/service_invites_test.go @@ -19,7 +19,7 @@ func TestInviteNewUserMock(t *testing.T) { ms := new(mock.Store) ms.UserByEmailFunc = mock.UserWithEmailNotFound() ms.AppConfigFunc = mock.ReturnFakeAppConfig(&fleet.AppConfig{ - KolideServerURL: "https://acme.co", + ServerURL: "https://acme.co", }) ms.NewInviteFunc = func(i *fleet.Invite) (*fleet.Invite, error) { return i, nil diff --git a/server/service/service_sessions.go b/server/service/service_sessions.go index 81b231635f..9f1b25db66 100644 --- a/server/service/service_sessions.go +++ b/server/service/service_sessions.go @@ -51,7 +51,7 @@ func (svc *Service) InitiateSSO(ctx context.Context, redirectURL string) (string settings := sso.Settings{ Metadata: metadata, // Construct call back url to send to idp - AssertionConsumerServiceURL: appConfig.KolideServerURL + svc.config.Server.URLPrefix + "/api/v1/fleet/sso/callback", + AssertionConsumerServiceURL: appConfig.ServerURL + svc.config.Server.URLPrefix + "/api/v1/fleet/sso/callback", SessionStore: svc.ssoSessionStore, OriginalURL: redirectURL, } @@ -59,9 +59,9 @@ func (svc *Service) InitiateSSO(ctx context.Context, redirectURL string) (string // If issuer is not explicitly set, default to host name. var issuer string if appConfig.EntityID == "" { - u, err := url.Parse(appConfig.KolideServerURL) + u, err := url.Parse(appConfig.ServerURL) if err != nil { - return "", errors.Wrap(err, "parsing kolide server url") + return "", errors.Wrap(err, "parse server url") } issuer = u.Hostname() } else { diff --git a/server/service/service_users.go b/server/service/service_users.go index 0a448d2fd2..54d2960a31 100644 --- a/server/service/service_users.go +++ b/server/service/service_users.go @@ -187,7 +187,7 @@ func (svc *Service) modifyEmailAddress(ctx context.Context, user *fleet.User, em Config: config, Mailer: &mail.ChangeEmailMailer{ Token: token, - BaseURL: template.URL(config.KolideServerURL + svc.config.Server.URLPrefix), + BaseURL: template.URL(config.ServerURL + svc.config.Server.URLPrefix), AssetURL: getAssetURL(), }, } @@ -448,7 +448,7 @@ func (svc *Service) RequestPasswordReset(ctx context.Context, email string) erro To: []string{user.Email}, Config: config, Mailer: &mail.PasswordResetMailer{ - BaseURL: template.URL(config.KolideServerURL + svc.config.Server.URLPrefix), + BaseURL: template.URL(config.ServerURL + svc.config.Server.URLPrefix), AssetURL: getAssetURL(), Token: token, }, diff --git a/server/service/util_test.go b/server/service/util_test.go index 855f040a85..896194dad8 100644 --- a/server/service/util_test.go +++ b/server/service/util_test.go @@ -35,9 +35,9 @@ func createTestAppConfig(t *testing.T, ds fleet.Datastore) *fleet.AppConfig { config := &fleet.AppConfig{ OrgName: "Tyrell Corp", OrgLogoURL: "https://tyrell.com/image.png", - KolideServerURL: "https://fleet.tyrell.com", + ServerURL: "https://fleet.tyrell.com", SMTPConfigured: true, - SMTPSenderAddress: "kolide@tyrell.com", + SMTPSenderAddress: "test@example.com", SMTPServer: "smtp.tyrell.com", SMTPPort: 587, SMTPAuthenticationType: fleet.AuthTypeUserNamePassword, diff --git a/server/service/validation_app_config_test.go b/server/service/validation_app_config_test.go index d657edd869..88ec503dca 100644 --- a/server/service/validation_app_config_test.go +++ b/server/service/validation_app_config_test.go @@ -20,7 +20,7 @@ func TestNeedFieldsPresent(t *testing.T) { invalid := &fleet.InvalidArgumentError{} config := fleet.AppConfig{ EnableSSO: true, - EntityID: "kolide", + EntityID: "fleet", IssuerURI: "http://issuer.idp.com", MetadataURL: "http://isser.metadata.com", IDPName: "onelogin", @@ -34,7 +34,7 @@ func TestMissingMetadata(t *testing.T) { invalid := &fleet.InvalidArgumentError{} config := fleet.AppConfig{ EnableSSO: true, - EntityID: "kolide", + EntityID: "fleet", IssuerURI: "http://issuer.idp.com", IDPName: "onelogin", } @@ -52,7 +52,7 @@ func appConfigPayloadFromAppConfig(config *fleet.AppConfig) *fleet.AppConfigPayl OrgName: &config.OrgName, }, ServerSettings: &fleet.ServerSettings{ - KolideServerURL: &config.KolideServerURL, + ServerURL: &config.ServerURL, LiveQueryDisabled: &config.LiveQueryDisabled, }, SMTPSettings: smtpSettingsFromAppConfig(config), diff --git a/server/service/validation_setup.go b/server/service/validation_setup.go index d191a64281..a3dde6b8e3 100644 --- a/server/service/validation_setup.go +++ b/server/service/validation_setup.go @@ -12,12 +12,12 @@ func (mw validationMiddleware) NewAppConfig(ctx context.Context, payload fleet.A invalid := &fleet.InvalidArgumentError{} var serverURLString string if payload.ServerSettings == nil { - invalid.Append("kolide_server_url", "missing required argument") + invalid.Append("server_url", "missing required argument") } else { - serverURLString = cleanupURL(*payload.ServerSettings.KolideServerURL) + serverURLString = cleanupURL(*payload.ServerSettings.ServerURL) } - if err := validateKolideServerURL(serverURLString); err != nil { - invalid.Append("kolide_server_url", err.Error()) + if err := validateServerURL(serverURLString); err != nil { + invalid.Append("server_url", err.Error()) } if invalid.HasErrors() { return nil, invalid @@ -25,7 +25,7 @@ func (mw validationMiddleware) NewAppConfig(ctx context.Context, payload fleet.A return mw.Service.NewAppConfig(ctx, payload) } -func validateKolideServerURL(urlString string) error { +func validateServerURL(urlString string) error { serverURL, err := url.Parse(urlString) if err != nil { return err diff --git a/server/sso/authorization_request.go b/server/sso/authorization_request.go index 55bda1800c..780bd89fa7 100644 --- a/server/sso/authorization_request.go +++ b/server/sso/authorization_request.go @@ -57,7 +57,7 @@ func CreateAuthorizationRequest(settings *Settings, issuer string, options ...fu Destination: destinationURL, IssueInstant: time.Now().UTC().Format("2006-01-02T15:04:05Z"), Version: samlVersion, - ProviderName: "Kolide", + ProviderName: "Fleet", Issuer: Issuer{ XMLName: xml.Name{ Local: "saml:Issuer", diff --git a/server/sso/settings_test.go b/server/sso/settings_test.go index 13adbc324b..59aa21924b 100644 --- a/server/sso/settings_test.go +++ b/server/sso/settings_test.go @@ -37,7 +37,7 @@ rICQDchR6/cxoQCkoyf+/YTpY492MafV urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified - + ` @@ -52,7 +52,7 @@ func TestParseMetadata(t *testing.T) { require.Len(t, settings.IDPSSODescriptor.KeyDescriptors, 1) assert.True(t, settings.IDPSSODescriptor.KeyDescriptors[0].KeyInfo.X509Data.X509Certificates[0].Data != "") require.Len(t, settings.IDPSSODescriptor.SingleSignOnService, 2) - assert.Equal(t, "https://dev-132038.oktapreview.com/app/kolidedev132038_kolide_1/exka4zkf6dxm8pF220h7/sso/saml", + assert.Equal(t, "https://dev-132038.oktapreview.com/app/dev132038_1/exka4zkf6dxm8pF220h7/sso/saml", settings.IDPSSODescriptor.SingleSignOnService[0].Location) assert.Equal(t, "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", settings.IDPSSODescriptor.SingleSignOnService[0].Binding) } @@ -68,7 +68,7 @@ func TestGetMetadata(t *testing.T) { require.Len(t, settings.IDPSSODescriptor.KeyDescriptors, 1) assert.True(t, settings.IDPSSODescriptor.KeyDescriptors[0].KeyInfo.X509Data.X509Certificates[0].Data != "") require.Len(t, settings.IDPSSODescriptor.SingleSignOnService, 2) - assert.Equal(t, "https://dev-132038.oktapreview.com/app/kolidedev132038_kolide_1/exka4zkf6dxm8pF220h7/sso/saml", + assert.Equal(t, "https://dev-132038.oktapreview.com/app/dev132038_1/exka4zkf6dxm8pF220h7/sso/saml", settings.IDPSSODescriptor.SingleSignOnService[0].Location) assert.Equal(t, "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", settings.IDPSSODescriptor.SingleSignOnService[0].Binding) } diff --git a/server/sso/types.go b/server/sso/types.go index 707430c885..02fad65ef2 100644 --- a/server/sso/types.go +++ b/server/sso/types.go @@ -23,7 +23,7 @@ type AuthnRequest struct { Signature *Signature `xml:"Signature,omitempty"` } -// Response is submitted to the service provider (Kolide) from the IDP via a callback. +// Response is submitted to the service provider (Fleet) from the IDP via a callback. // It will contain information about a authenticated user that can in turn // be used to generate a session token. // See http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf Section 3.3.3. diff --git a/server/sso/validate_test.go b/server/sso/validate_test.go index 66a296c583..c41fd5eccf 100644 --- a/server/sso/validate_test.go +++ b/server/sso/validate_test.go @@ -16,7 +16,7 @@ func testMetadata() Metadata { var metadata Metadata if err := xml.Unmarshal([]byte(` - + @@ -26,8 +26,8 @@ func testMetadata() Metadata { urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified - - + + `), &metadata); err != nil { diff --git a/server/websocket/websocket.go b/server/websocket/websocket.go index 46073d5541..20b34711e2 100644 --- a/server/websocket/websocket.go +++ b/server/websocket/websocket.go @@ -30,7 +30,7 @@ type JSONMessage struct { } // Conn is a wrapper for a standard websocket connection with utility methods -// added for interacting with Kolide specific message types. +// added for interacting with Fleet specific message types. type Conn struct { sockjs.Session } @@ -82,7 +82,7 @@ func (c *Conn) ReadJSONMessage() (*JSONMessage, error) { return msg, nil } -// authData defines the data used to authenticate a Kolide frontend client over +// authData defines the data used to authenticate a Fleet frontend client over // a websocket connection. type authData struct { Token token.Token `json:"token"`