* website: bump hugo, updated templates
For some reason, the "and" trick to step around undefined values no longer
worked. So now, we're wrapping {{ if }} conditionals instead: the outer one
checks that the value is defined, the inner one asserts something on its
value.
* live-blocks/preprocess: add wrapper div, remove newline
Somewhere between 0.55 and the most recent version, Hugo stopped emitting
that div on purpose for languages it didn't know.
Since we depend on it for further processing, we're adding it back.
Also, a trailing newline for code elements was introduced, and that broke
our codemirrors integration -- every code entry would be folllowed by an
empty line. Now, we're removing that in the same preprocess step.
* website: fix info|danger blocks
* website/config: trust markdown to include html
Fixes#3787.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
* website/scripts/load-docs.sh: less verbose output
1. Less output: the tag semver ordering isn't something we work
on daily, so let's silence that.
2. Use 'git archive' and tar, not a checkout:
this way, we don't mess up the working directory or reflog. It
should also be faster, since we don't end up writing all the
vendor files, binary blobs, etc to disk.
3. Make the 'latest' symlink relative.
* scripts/live-blocks/inject: run preprocess with max allowed args
Before, when attempting to do this, I had used
find ... -exec npm run preprocess {} +
and find had determined what the maximum number of allowed command
line args were, and executed that call in batches of those. `npm`,
however, would have prepended the call with its own args, thereby
exceeding the limit.
As a way out, we had used `xargs -n200`, to preprocess the files
in batches of 200 at a time.
Now, we're telling `find` the exact command needed, bypassing the
package.json helper definition.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Changing 4.0.0 -> 4.0.1 of rollup-postcss-plugin, `npm install` reports:
added 6 packages, removed 187 packages, changed 37 packages, and audited 482 packages in 4s
Not bad for a patch release. I think all traces of nth-check 1.x.y in
live-blocks should be gone now.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
With more and more version appearing, the argument count passed to the
`npm run` call through the shell glob had increased, too -- to a point
where execution was impossible because it had reached a hard limit.
The obvious fix would have been to use `find [...] -exec cmd {} +` or
`find [...] -print0 | xargs -0 cmd`, however, since the npm call builds
another command line that's executed, we'd step over that limit again.
So instead, we'll now run the npm script on batches of 200 files. It's
below the maximum (unclear what it is, I haven't dug that deep), and
still fast enough (running it file-by-file takes 15+minutes).
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
golint is deprecated. The author of the code no longer supports the
codebase. golangci-lint is faster than golint, and is in use by other
opa repositories (e.g. Gatekeeper).
This commit changes tools.go to reference golangci (so it ends up in
vendor) and modifies check-lint to use golangci instead.
Breaking API Changes:
- plugins/rest/rest.go: Fix typo "AllowInsureTLS" -> "AllowInsecureTLS"
- storage/errors.go: Removed unused IndexingNotSupportedErr
Signed-off-by: Will Beason <willbeason@google.com>
Should fix annoying dependabot warning.
Live blocks functionality tested with make serve-local and
remotely using Netlify. Both seems to work as before.
Signed-off-by: Anders Eknert <anders@eknert.com>
Using `npm audit fix` update dependencies of the live-blocks tooling.
This corrects all severe ones that can be corrected without pulling
library versions that include breaking changes.
Signed-off-by: Patrick East <east.patrick@gmail.com>
There is a known security issue with the older version. Updating to
the latest mitigates the risk.
Signed-off-by: Patrick East <east.patrick@gmail.com>
This was changed as part of the homepage rework but ended up being
both unused and broken.. so reverting it back to the way it was
before.
The live blocks on the home page are not interactive, so this works
out fine as-is. In the future we may need to revisit.
Signed-off-by: Patrick East <east.patrick@gmail.com>
The playground changed to just return a null result rather than
returning a 4xx error for the response. We need to catch this case
and raise the expected OPAError in the live blocks scripts to keep
the UI behavior the same.
Signed-off-by: Patrick East <east.patrick@gmail.com>
This changes to no longer download the `edge` release binary (we still
publish one for anyone who wants to use the current master). This way
for PR's and for development we are going to process the `edge`
documentation with the version of OPA that is the current HEAD. For
the live site this will always be the current master branch.
Signed-off-by: Patrick East <east.patrick@gmail.com>
As of now the "edge" docs have a newer standardized format for output.
The preprocessing step for live-blocks needed to be updated to handle
parsing it.
Signed-off-by: Patrick East <east.patrick@gmail.com>
This commit updates the introduction page to focus on Rego and
integrating with OPA (whereas the old introduction content focused on
high-level concepts like policy-decoupling, the data document, etc.)
The new introduction content provides a concise overview of OPA and
then launches into an tour of Rego (by example) that shows the core
concepts in the language. The content ends with an overview of
different ways you can interact with OPA.
The old introduction content has been moved into the Philosophy page
and the How Does OPA Work? page has been removed/replaced by the new
introduction page.
With these changes we can update the frontpage with links to core OPA
introduction and then different use cases (e.g., Kubernetes, Envoy,
etc.)
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Instead of using url rewriting tricks we will just copy the latest
docs as part of the build process for a "latest" version.
In the version selector code we need to handle this to hide the
version, but overall it simplifies the template code.. so thats nice.
Best part, and main reason for doing this, is that the pretty url
feature will now work on the `/docs/latest/*` urls. It will fix some
weirdness with the relative url links we use in the markdown content
and remove a duplicate search result.
Signed-off-by: Patrick East <east.patrick@gmail.com>
This should fix the critical vulnerability found by scanners in the
eslint-utils package by removing the lint script.
We can re-visit this again in the future when someone can spend more
time to fix it.
Signed-off-by: Patrick East <east.patrick@gmail.com>
This commit adds a postprocessor to the docs build that enables
examples to be edited and have the results show up live. See the
additions to `docs/README.md` for more about what writing these
blocks looks like or the netlify PR preview
(e.g. at `docs/edge/how-do-i-write-policies/`)
to see them in action (you'll need to disable CORS for live output).
Signed-off-by: David Boles <me@davidbol.es>