Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document origin configuration and improve user guide. #106

Merged
merged 14 commits into from
Mar 13, 2018

Conversation

dvlato
Copy link
Contributor

@dvlato dvlato commented Mar 8, 2018

Changes to the user guide:

-Included a section regarding the origin configuration.
-Status codes extracted to their own page.
-Rest of sections reviewed.

Copy link
Contributor

@mikkokar mikkokar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some feedback from the sick bed 🤒. Overall good work but asking to clarify few details, etc. Apologies for the brief comments. I am using a mobile interface.

The build system requires Apache Maven. The Styx team uses Maven version 3.2.1
for automated continuous integration builds. On Mac OSX, a version installed
by HomeBrew is satisfactory.
Running Styx requires Java 1.8. It can be run with 1.8.0_45 or later versions. Earlier maintenance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the remark about maven being removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the instructions were considering that we were downloading an already compiled binary, but here we were explaining how to build the app instead of how to run it.

Probably we can also add instructions to build from source code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Makes sense.

@@ -90,7 +86,7 @@ configuration.
By default, the logback file is loaded from *$STYX_HOME/conf/logback.xml*. You can specify an alternative
logging configuration file using {-l} or {--logback} command line options:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some old formatting isssues with the page, such as -l and —logback above. Please address them too now as you are changing this file. Need to have a consistent formatting for this and the other pages.

@@ -9,25 +9,26 @@ Styx supports three load balancing strategies:
Styx also provides a mechanism to bypass the load balancer and force
the origin at source.

##Load balancing strategies
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This heading is not correctly rendered.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh thanks! It's rendering fine inside IntelliJ, let me see if I can fix that...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. This is still not rendering correctly. Please address this.

originsFile=${STYX_HOME}/conf/env-development/origins.yaml
originsFile=classpath:/conf/origins.yaml
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is a great overall addition to our documentation. Thanks for putting it together.

However the above description about originsFile is slightly incomplete.

The origins file is actually specified in the services/ section, under backendServiceRegistry, see: https://github.com/dvlato/styx/blob/5e18c02bdcf7e39e462f5c1232fe851fc3c1ed67/distribution/conf/default.yml#L59.

Note that this behaviour also depends on the advanced routing settings.

The reason the above works is because of Styx configuration overrides.


Styx supports a YAML file-based configuration. The YAML file can be specified using the system property `YAML_CONFIG_LOCATION=your/file/path`.
By default, the file is read from the classpath at `classpath:conf/environment/styx-config.yaml`.
Additionally, all these properties can be overwritten using environment variables with the same name as the property.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is badly outdated information. The preferred (and only?) way is to pass the configuration file as a command line argument to the startup script. Please update accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, specifying the configuration file with "CONFIG_FILE" (as the quickstart explains) also work. I hadn't noticed it wasn't the same property.

Should I remove the reference to "CONFIG_FILE" from both documents?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell YAML_CONFIG_LOCATION is not used by Styx at all, so it should not appear in the documentation.

TLS can be enabled independently for each network interface. You can
enable it independently for proxy server port, and for each of the
back-end services. Styx will convert between the protocols where
TLS can be enabled independently for each network resource. You can
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage of term “network resource” is rether confusing. What we are trying to say is that the Styx server port and each app can have their TLS settings configured separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.
The document used to say "for each network interface" which, to me, would mean that you can bind to different network cards / ip addresses. I don't see any part of the code that allows for this. If it's some feature we have lost or I've missed it, please tell me so.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. The original use of "network interface" was also a poor choice of words. But it reads much better now for what I can see 👍

@@ -108,50 +107,54 @@ be specified as separate backends.

### Backend Application Attributes:

- trustAllCerts - Whether (true) or not (false) to authenticate server side.

- trustAllCerts - Turns off (true) or on (true) client-side TLS authentication. When `trustAllCerts` is false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“Client-side TLS authentication” is potentially confusing. It can lead readers to think about TLS client authentication which is a completely different matter. Please paraphrase and remove “client side” etc from the description.

- *trustStorePath* - Styx can load the relevant secure material from Java truststore.
This attribute specifies a path to the keystore file containing relevant trust material.
- *trustStorePath* - Styx can load the list of trusted certificates from a Java JKS keystore.
This attribute specifies a path to the truststore file containing the trusted certificates.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By convention this file where trust material is stored is called truststore which technically is just a java keystore file. In this regard the description feels bit more confusing than it was before.

- A path in the filesystem by default.
- A resource in the classpath by using the prefix *classpath:*.

###Examples:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This heading doesn't render correctly. I believe you need to add a whitespace character between the ### marks and the heading text.

TLS can be enabled independently for each network interface. You can
enable it independently for proxy server port, and for each of the
back-end services. Styx will convert between the protocols where
TLS can be enabled independently for each network resource. You can
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. The original use of "network interface" was also a poor choice of words. But it reads much better now for what I can see 👍

Copy link
Contributor

@mikkokar mikkokar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work so far David. Few additional changes still requested.

@@ -108,50 +107,55 @@ be specified as separate backends.

### Backend Application Attributes:

- trustAllCerts - Whether (true) or not (false) to authenticate server side.

- *trustAllCerts* - When `trustAllCerts` is false,origin servers need to provide a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A missing whitespace between comma and "origin".

- *trustStorePath* - Styx can load the relevant secure material from Java truststore.
This attribute specifies a path to the keystore file containing relevant trust material.
- *trustStorePath* - Styx can load the list of trusted certificates from a Java JKS truststore.
This attribute specifies a path to the truststore file containing the trusted certificates.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the "file containing the trusted certificates." part. That is, just leave: "Styx can load the list of trusted certificates from a Java truststore. This attribute specifies a path to the truststore."

@@ -1,14 +1,17 @@
## Configuring Styx environment
## Configuring Styx

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. I believe this file has incorrect information about load balancer configurations. In particular:

    loadBalancing:
      # Load balancer strategy type. Allowed values: "LEAST\_RESPONSE\_TIME", "ROUND\_ROBIN", and "ADAPTIVE". Defaults to "ROUND_ROBIN".
      strategy: "ADAPTIVE"

I believe you'd have to supply the full class name using the factory. See the load balancer config page for an example.

@@ -21,38 +21,42 @@ An example configuration block looks like this:
connectionExpirationSeconds: 1000 # default value 0


Connection pool size is given by *maxConnectionsPerHost* setting.
The pool initially has no established TCP connections.
##General settings.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rendering issue above.

This is useful when an origin host is specified as a DNS domain name, and you want to ensure that domain names are re-resolved periodically.
If the value of the setting is non-positive, connections will not expire.
Connection age is checked on each incoming request, so connections may live longer than their expiration time if they do not serve any requests.

##Connection pending settings.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rendering issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants