Skip to content

Commit

Permalink
Transition to docusaurus (#317)
Browse files Browse the repository at this point in the history
* Transferred files to tmp folder

* Transferred files to public-site folder

* Fixed name

* Fixed name

* Fixed name

* Corrected config

* Added search, changed port

* Updated search

* Re-arranged files

* Re-arranged files

* Re-arranged files

* Fixed configs

* Fixed styles

* Removed outdated files. Fixed main page

* Added team cards

* Fixed community folder. Added Makefile

* Style

* Style

* Style

* Style

* Style

* Docker ignore

* Fixing broken links

* Fixing broken links

* Fixing broken links

* Restored ext dns info

* Cleaned cache

* Turn off cache

* Turn on cache

* Set new npm

* build with acr

* removed demo files

* Fixed favicon and style. Fixed LInk to radix-concept

* Fixed favicon and style. Fixed LInk to radix-concept

* Fixing underline

* Fixing underline

* Added sidebars

* Added sidebars

* Reduced size of photos

* Fixed <>

* Fixed tips

* Removed web-share

* Fixed ref

* Added what's new

* Fixed brocken links

* Fixed style

* Fixed style

* Rearranged pages for radix-config, private link and code integration

* Rearranged main menu

* Fixed link

* Changed page title

* Fixed font
  • Loading branch information
satr authored Mar 1, 2024
1 parent 52f7061 commit 6dcd1b4
Show file tree
Hide file tree
Showing 308 changed files with 16,587 additions and 4,591 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ build
.jekyll-cache/
.jekyll-metadata
**/.DS_Store
**/node_modules
12 changes: 6 additions & 6 deletions examples/radix-app/docs/workshop.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- markdownlint-disable MD014 MD007 MD034-->
<!-- markdownlint-disable MD014 MD007 MD034-->

# 1. Omnia Radix example application

Expand Down Expand Up @@ -40,12 +40,12 @@ An OpenAPI specification has been agreed on with the API team, so we'll begin wi
Important to know:

1. The difference between ```platform user``` and ```application user```
1. Important terminology: ```application```, ```environments```,```components```, and ```replicas``` [Important Radix Concepts](https://www.radix.equinor.com/docs/topic-concepts/)
1. ```radixconfig.yaml``` - lives on the `main` branch and is your infrastrucure as code - drive your app in Radix.
1. Important terminology: ```application```, ```environments```,```components```, and ```replicas``` [Important Radix Concepts](https://www.radix.equinor.com/start/radix-concepts//)
1. ```radixconfig.yaml``` - lives on the `main` branch and is your infrastructure as code - drive your app in Radix.

### 2.1.4. Explore radixconfig.yaml

1. Reading about radixconfig.yaml in [docs](https://www.radix.equinor.com/docs/reference-radix-config)
1. Reading about radixconfig.yaml in [docs](https://www.radix.equinor.com/docs/radix-config)
1. Exploring the config file for the example app [./radixconfig.yaml](../radixconfig.yaml)

### 2.1.5. Creating the application on Radix
Expand All @@ -59,7 +59,7 @@ Important to know:

Scenario

The UI is comming along nicely, and your team has started on the API. Next step is to integrate the API with the UI, so users can also start testing the logic behind password generation.
The UI is coming along nicely, and your team has started on the API. Next step is to integrate the API with the UI, so users can also start testing the logic behind password generation.

### 2.2.1. Exploring the `server` app

Expand Down Expand Up @@ -167,5 +167,5 @@ It makes sense to examing existing issues and perhaps discuss on Slack prior to

## 4 Next steps

- The application is currently hosted under a *.radix.equinor.com domain. This is OK for now, but it has been identified that for the future we'll want our own *.equinor.com domain as is possible in [Radix](https://www.radix.equinor.com/docs/reference-radix-config/#dnsexternalalias).
- The application is currently hosted under a *.radix.equinor.com domain. This is OK for now, but it has been identified that for the future we'll want our own *.equinor.com domain as is possible in [Radix](https://www.radix.equinor.com/docs/radix-config/index.md#dnsexternalalias).
- Move your own apps into Radix
4 changes: 2 additions & 2 deletions examples/radix-example-oauth-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ To generate a **role**, in the APIs Azure AD app, go to "Manifest" and update th
]
```

To grant a AD user or group a **role**, in the APIs Azure AD app, go to "Overview" and click the link for "Manage application in local directory". This will open Enterprise application overview of the app we're working on. Go to "Users and Groups" -> "Add User" -> select an AD group your part of (e.g. `Radix Playground Users`) and grant it the **role** "Admin".
To grant a AD user or group a **role**, in the APIs Azure AD app, go to "Overview" and click the link for "Manage application in local directory". This will open Enterprise application overview of the app we're working on. Go to "Users and Groups" -&gt; "Add User" -&gt; select an AD group your part of (e.g. `Radix Playground Users`) and grant it the **role** "Admin".

Important: Users who are not part of the AD group you granted the Radix role to, will still be able to authenticate, get a valid access token, and get access to the Client. It's up to the API to authorize based on the **role**. This enable the possibility to limit API calls based on which **role** a user has.

Expand Down Expand Up @@ -91,7 +91,7 @@ The main endpoint (which is routed through `auth-proxy`) will be available at ht

You will need to change the value for the `OAUTH2_PROXY_CLIENT_ID`, `OAUTH2_PROXY_SCOPE` and `API_RESOURCE_ID` environment variables in `radixconfig.yaml`. You can then [set up the application](https://www.radix.equinor.com/guides/configure-an-app/#registering-the-application) in Radix.

The two [secrets](https://www.radix.equinor.com/docs/topic-concepts/#secret) that must be configured in the Radix Web Console are `OAUTH2_PROXY_CLIENT_SECRET` and `OAUTH2_PROXY_COOKIE_SECRET`. Note that the **cookie secret** does not need to match the one used locally.
The two [secrets](https://www.radix.equinor.com/start/radix-concepts/#secret) that must be configured in the Radix Web Console are `OAUTH2_PROXY_CLIENT_SECRET` and `OAUTH2_PROXY_COOKIE_SECRET`. Note that the **cookie secret** does not need to match the one used locally.

The application should then build and deploy, and it will be availble at `https://<app-name>.app.radix.equinor.com/`. The `auth-proxy` component will be exposed via this endpoint.

Expand Down
7 changes: 7 additions & 0 deletions public-site/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
README.md
dev.Dockerfile
Dockerfile
docker-compose.yml
.dockerignore
build
20 changes: 20 additions & 0 deletions public-site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
**/node_modules

# Production
**/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
4 changes: 0 additions & 4 deletions public-site/.markdownlint.json

This file was deleted.

8 changes: 5 additions & 3 deletions public-site/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM docker.io/node:21-alpine3.18 as builder
FROM docker.io/node:20.11.1-alpine3.19 as builder

WORKDIR /site
COPY ./docs .
COPY . .
RUN npm install -g [email protected]
RUN npm install
RUN npm run build

FROM docker.io/nginxinc/nginx-unprivileged:1.25.2-alpine
WORKDIR /site
COPY --from=builder /site/src/.vuepress/dist /site
COPY --from=builder /site/build /site
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 8080
USER 101
43 changes: 43 additions & 0 deletions public-site/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.PHONY: lint
lint:
npm run "lint"
npm run "lint-ts"


.PHONY: lint-strict
lint-strict:
npm run "lint-strict"

.PHONY: run
run:
npm run start

.PHONY: build-dist run-dist run-dist-rebuilt

build-dist:
npm run build

run-dist:
npm run serve

run-dist-rebuilt: build-dist run-dist

.PHONY: run-docker-dev
run-docker-dev:
docker compose -f docker-compose.yml up

.PHONY: build-docker
build-docker:
docker build . -t public-site

.PHONY: run-docker
run-docker:
docker run -it -p 8080:8080 public-site

.PHONY: run-docker-rebuilt
run-docker-rebuilt: build-docker run-docker

.PHONY: down
down:
docker compose down

39 changes: 26 additions & 13 deletions public-site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This builds a Docker image `radix-public-site`, runs it in the container
`radix-public-site_container`, mounts the local directory into `/site` in the
container.

You can see the site on <http://localhost:8081>
You can see the site on &lt;http://localhost:8081&gt;

Stop the server with Ctrl+C, but also run `docker-compose down` to clean up the
Docker state.
Expand Down Expand Up @@ -53,19 +53,32 @@ But the interesting bits are the actual content:
- `/references/`: Reference documentation for end-users.
- `/other/`: Documentation not directly related to any specific category.

## CSS
## ducusaurus
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

Vuepress is using [Stylus](https://stylus-lang.com/).
[Create an application](https://docusaurus.io/docs/installation)
```bash
npx create-docusaurus@latest public-site classic --typescript
```

The `/.vuepress/styles/index.styl` file includes all stylesheet files (organised under
`/.vuepress/public/assets/styles/`) as well as style overrides for the Vuepress generator.
## docusaurus development

The `/.vuepress/styles/pallete.styl` file is used to override certain style variables used for by the different Vuepress components. This file should not contain CSS styles.
`npm start`
Starts the development server.

You can read more about Vuepress Styling here:
`npm run build`
Bundles your website into static files for production.

- [index.styl](https://vuepress.vuejs.org/config/#index-styl)
- [palette.styl](https://vuepress.vuejs.org/config/#palette-styl)
`npm run serve`
Serves the built website locally.

`npm run deploy`
Publishes the website to GitHub pages.

We recommend that you begin by typing:

`cd public-site`
`npm start`

## Production build

Expand All @@ -75,10 +88,10 @@ build image locally:
docker build -t radix-public-site-prod .
docker run --name radix-public-site-prod_container --rm -p 8080:8080 radix-public-site-prod

The web server will be available on <http://localhost:8080>
The web server will be available on &lt;http://localhost:8080&gt;

# Credits

trees by Made x Made from the Noun Project: <https://thenounproject.com/term/trees/1723897/>
pot plant by Made x Made from the Noun Project: <https://thenounproject.com/term/pot-plant/1724797/>
Tumbleweed by Megan Sorenson from the Noun Project: <https://thenounproject.com/term/tumbleweed/1390797/>
trees by Made x Made from the Noun Project: &lt;https://thenounproject.com/term/trees/1723897/&gt;
pot plant by Made x Made from the Noun Project: &lt;https://thenounproject.com/term/pot-plant/1724797/&gt;
Tumbleweed by Megan Sorenson from the Noun Project: &lt;https://thenounproject.com/term/tumbleweed/1390797/&gt;
3 changes: 3 additions & 0 deletions public-site/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
6 changes: 3 additions & 3 deletions public-site/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM docker.io/node:21-alpine3.18
FROM docker.io/node:21-alpine3.18 as builder

WORKDIR /site
COPY ./docs/package.json ./docs/package-lock.json /site/
COPY . .
RUN npm install
COPY ./docs .
RUN npm run build

CMD npm run dev
2 changes: 1 addition & 1 deletion public-site/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
networks:
- radix-public-site
ports:
- "8081:8080"
- "8081:3000"

networks:
radix-public-site:
Expand Down
4 changes: 0 additions & 4 deletions public-site/docs/.gitignore

This file was deleted.

37 changes: 37 additions & 0 deletions public-site/docs/community/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Community
displayed_sidebar: communitySidebar
---
import RadixTeam from '../../src/components/RadixTeam/index.tsx'

# Community

Radix aims to be _the_ platform to build and deploy code within Equinor. It can only be that if it helps Equinor developers — that's you — succeed.

Of course, Radix is developed and maintained by Equinor developers as well. That means we want to work together to build the best platform we can. If you have problems or suggestions, we want to hear from you! It helps.

:::tip Hello
We are based in Forus Øst in Stavanger. If you see us on the corridor, say hello!
:::

![radix team](/images/Toppbilde.jpg)

## On Slack

If you'd like to discuss the platform, features or improvements, head on to the main [Omnia Radix channel](https://equinor.slack.com/messages/C8U7XGGAJ). Stuck? App not building? Don't understand the docs? the place to ask is in [the support channel](https://equinor.slack.com/messages/CBKM6N2JY).

Let us together build the Radix community!..

## On GitHub

If you think you found a bug, or you have a concrete proposal, [log an issue](https://github.com/equinor/radix/issues) on GitHub. We have multiple repositories, but all issues are tracked in **radix repo**.

## Release register

New features are publicly announced in the [Omnia Radix Slack channel](https://equinor.slack.com/messages/C8U7XGGAJ), and added to the release register page.

Check out what's new in the [Release register](/docs/docs/topic-releases/index.md)

## The Radix team

<RadixTeam />
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
title: Docs
displayed_sidebar: docsSidebar
---

## The basics

- Understanding [Radix concepts](topic-concepts/)
- Understanding [Radix concepts](/docs/start/radix-concepts/index.md)
- The application [runtime environment](topic-runtime-env)
- [Domain names](topic-domain-names) for your components

Expand All @@ -22,5 +23,6 @@ title: Docs

## Reference

- [The `radixconfig.yaml` file](../references/reference-radix-config/)
- [Private Link](../references/reference-private-link/)
- [The `radixconfig.yaml` file](/docs/radix-config/index.md)
- [Code editor integration](/docs/docs/topic-code-editor-integration/index.md)
- [Private Link](/docs/docs/topic-private-link/index.md)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Code Editor Integrations

# Overview

The [OpenAPI 3.0 Schema](https://swagger.io/docs/specification/data-models/) for [radixconfig.yaml](../reference-radix-config/) is available at [https://raw.githubusercontent.com/equinor/radix-operator/release/json-schema/radixapplication.json](https://raw.githubusercontent.com/equinor/radix-operator/release/json-schema/radixapplication.json). This schema is an [extended subset](https://swagger.io/docs/specification/data-models/keywords/) of the [JSON Schema Specification](https://json-schema.org/).
The [OpenAPI 3.0 Schema](https://swagger.io/docs/specification/data-models/) for [radixconfig.yaml](/docs/radix-config/index.md) is available at [https://raw.githubusercontent.com/equinor/radix-operator/release/json-schema/radixapplication.json](https://raw.githubusercontent.com/equinor/radix-operator/release/json-schema/radixapplication.json). This schema is an [extended subset](https://swagger.io/docs/specification/data-models/keywords/) of the [JSON Schema Specification](https://json-schema.org/).

The schema can be used in code editors to provide auto completion and schema validation when editing a `radixconfig.yaml` file.

Expand Down Expand Up @@ -34,7 +34,7 @@ Read more about schema associations [here](https://github.com/redhat-developer/y

Jetbrains IDEs have built-in support for JSON schemas.

1. Open the **Settings** dialog (`Ctrl+Alt+S`) and go **Languages & Frameworks** > **Schemas and DTDs** > **JSON Schema Mappings**.
1. Open the **Settings** dialog (`Ctrl+Alt+S`) and go **Languages & Frameworks** &gt; **Schemas and DTDs** &gt; **JSON Schema Mappings**.
1. Click `+` on the toolbar.
1. Insert `https://raw.githubusercontent.com/equinor/radix-operator/release/json-schema/radixapplication.json` in **Schema file or URL** and select `JSON Schema version 7` in **Schema version**. Specify a name of the schema in the **Name** field.
1. Click `+` in the mappings section and select **Add file** from the drop down list. Insert `radixconfig.yaml` in the **File** field.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ Other resources could be the official [Docker documentation](https://docs.docker

Application hosted on Radix must be run with non-root privileges in the container. A security policy enabled in the Radix platform will prevent the application from running if it is not configured to run as non-root. Here's an sample on how you can run change a Docker container to run as a non-root user, the principle is that you create a dedicated user and group on the image and use this user to run the process.

> If this is not configured, your deployment will not start.
:::tip
If this is not configured, your deployment will not start.
:::

If your base image is a unprivileged image, you'll need to find the ID of the running user, and use that id in your Dockerfile.

**USER <USER_ID>** specifies which user to run as, this **must** be the ID of the user, not the name. This will ensure that Kubernetes can verify that the container is running as a non-root user.
**USER [USER_ID]** specifies which user to run as, this **must** be the ID of the user, not the name. This will ensure that Kubernetes can verify that the container is running as a non-root user.

This is a sample on how it can be done for **node alpine based images**.

Expand All @@ -41,11 +43,13 @@ EXPOSE 8001

The ID of the group and user can be anything in the range 1000-65535.

`groupadd` command follows the syntax `groupadd -S -g <GROUP_ID> <GROUP-NAME>`
`groupadd` command follows the syntax `groupadd -S -g [GROUP_ID] [GROUP-NAME]`

`useradd` command follows the syntax `useradd -S -u <USER_ID> -g <GROUP_NAME> <USER_NAME>`
`useradd` command follows the syntax `useradd -S -u [USER_ID] -g [GROUP_NAME] [USER_NAME]`

> Be aware - [the syntax for add user and group](../../guides/docker-useradd/) can be different for the distribution of images
:::tip
Be aware - [the syntax for add user and group](/docs/guides/docker-useradd/) can be different for the distribution of images
:::

There are many great articles on securing docker images. See [Snyk](https://res.cloudinary.com/snyk/image/upload/v1551798390/Docker_Image_Security_Best_Practices_.pdf).

Expand Down
Loading

0 comments on commit 6dcd1b4

Please sign in to comment.