1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

Merge branch 'master' into feat/splash

This commit is contained in:
Fredrik Strand Oseberg 2021-11-23 19:54:13 +01:00 committed by GitHub
commit 786fbb0034
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 106 additions and 61 deletions

17
.github/workflows/build_doc_prs.yaml vendored Normal file
View File

@ -0,0 +1,17 @@
name: PR -> Build Docs
on:
pull_request:
paths:
- website/**
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup git config
run: |
# Build the site
cd website && yarn && yarn build

View File

@ -137,7 +137,7 @@
"del-cli": "4.0.1",
"eslint": "8.3.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-airbnb-typescript": "15.0.0",
"eslint-config-airbnb-typescript": "16.0.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-prettier": "4.0.0",

View File

@ -57,11 +57,13 @@ docker run -p 4242:4242 \
-e DATABASE_HOST=postgres -e DATABASE_NAME=unleash \
-e DATABASE_USERNAME=unleash_user -e DATABASE_PASSWORD=some_password \
-e DATABASE_SSL=false \
--network unleash unleashorg/unleash-server
--network unleash --pull=always unleashorg/unleash-server
```
### Option 2 - use Docker-compose {#option-two---use-docker-compose}
**Steps:**
1. Clone the [unleash-docker](https://github.com/Unleash/unleash-docker) repository.
2. Run `docker-compose build` in repository root folder.
3. Run `docker-compose up` in repository root folder.
@ -95,7 +97,7 @@ docker run -p 4242:4242 \
port: 4242,
},
})
.then(unleash => {
.then((unleash) => {
console.log(
`Unleash started on http://localhost:${unleash.app.get('port')}`,
);

View File

@ -198,27 +198,42 @@ unleash.on('synchronized', () => {
## I want to run Unleash locally
### Run Unleash with Docker
### Run Unleash with Docker {#run-unleash-with-docker}
The easiest way to run unleash locally is using [docker](https://www.docker.com/).
:::tip
Each container that runs in your local Docker instance must have a unique name. If you've run these commands before, you can either start the containers again (`docker start ${CONTAINER_NAME}`) or remove them (`docker rm ${CONTAINER_NAME}`) and run the commands again.
:::
1. Create a network by running `docker network create unleash`
2. Start a postgres database:
```sh
docker run -e POSTGRES_PASSWORD=some_password \
-e POSTGRES_USER=unleash_user -e POSTGRES_DB=unleash \
--network unleash --name postgres postgres
docker run \
-e POSTGRES_USER=unleash_user \
-e POSTGRES_PASSWORD=some_password \
-e POSTGRES_DB=unleash \
--network unleash \
--name postgres \
postgres
```
3. Start Unleash via docker:
```sh
docker run -p 4242:4242 \
-e DATABASE_HOST=postgres -e DATABASE_NAME=unleash \
-e DATABASE_USERNAME=unleash_user -e DATABASE_PASSWORD=some_password \
docker run \
-p 4242:4242 \
-e DATABASE_HOST=postgres \
-e DATABASE_NAME=unleash \
-e DATABASE_USERNAME=unleash_user \
-e DATABASE_PASSWORD=some_password \
-e DATABASE_SSL=false \
--network unleash unleashorg/unleash-server
--network unleash \
--name unleash \
--pull=always unleashorg/unleash-server
```
[Click here to see all options to get started locally.](deploy/getting-started.md)
@ -232,6 +247,58 @@ username: admin
password: unleash4all
```
### Run Unleash and the Unleash proxy with Docker
Follow steps outlined in the [Run Unleash with Docker](#run-unleash-with-docker) section to get the Unleash instance up and running. Once you have done that you need to first get an API key from your Unleash instance and then use that API key when starting the Unleash proxy.
1. Get an API key.
To get an API key, access your Unleash instance in a web browser. First, navigate to the API access screen.
[![The Unleash UI showing a dropdown menu under the Configure menu
entry. The dropdown menu's API Access option is highlighted and
you're told to navigate there.]](/img/api_access_navigation.png 'Navigate to the API access page.')
Next, create an API key with these details
- **name:** proxy-key (this can be whatever you want)
- **token type:** client
- **project:** all
- **environment:** select your preferred environment (this option is only available in Unleash 4.3 and later)
Copy the API key to your clipboard. You'll need it in the next step.
:::note
Depending on whether you have the environments feature enabled or not, the API key will look a little different. If you don't have environments enabled, it'll just be a 64 character long hexadecimal string (for instance `be44368985f7fb3237c584ef86f3d6bdada42ddbd63a019d26955178`). If you do have environments enabled, the key will be prefixed with the project and the environment that the key is valid for. It'll use the format `<project>:<environment>.<key>`, e.g. `demo-app:production.be44368985f7fb3237c584ef86f3d6bdada42ddbd63a019d26955178`.
Regardless of which format your string uses, do not modify it.
:::
2. Start the Unleash proxy
Start a container with the Unleash proxy by running the following command. Replace `${API_KEY}` with the key you created in the following step.
```sh
docker run \
-e UNLEASH_PROXY_SECRETS=some-secret \
-e UNLEASH_URL='http://unleash:4242/api/' \
-e UNLEASH_API_TOKEN='${API_KEY}' \
-p 3000:3000 \
--network unleash \
--name unleash-proxy \
--pull=always unleashorg/unleash-proxy
```
3. Test the proxy
To make sure the proxy is running successfully, you can test it by running the following command:
```curl
curl http://localhost:3000/proxy -H "Authorization: some-secret"
```
### Create your first toggle
In order to create a toggle through the UI, [you can follow this guide](create-feature-toggle.md). Once you have created your feature toggle, you are ready to connect your application using an SDK.

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -2335,29 +2335,6 @@ errorhandler@^1.5.1:
accepts "~1.3.7"
escape-html "~1.0.3"
es-abstract@^1.18.2:
version "1.18.5"
resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.5.tgz"
integrity sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==
dependencies:
call-bind "^1.0.2"
es-to-primitive "^1.2.1"
function-bind "^1.1.1"
get-intrinsic "^1.1.1"
has "^1.0.3"
has-symbols "^1.0.2"
internal-slot "^1.0.3"
is-callable "^1.2.3"
is-negative-zero "^2.0.1"
is-regex "^1.1.3"
is-string "^1.0.6"
object-inspect "^1.11.0"
object-keys "^1.1.1"
object.assign "^4.1.2"
string.prototype.trimend "^1.0.4"
string.prototype.trimstart "^1.0.4"
unbox-primitive "^1.0.1"
es-abstract@^1.19.0, es-abstract@^1.19.1:
version "1.19.1"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3"
@ -2466,7 +2443,7 @@ escodegen@^2.0.0:
optionalDependencies:
source-map "~0.6.1"
eslint-config-airbnb-base@15.0.0:
eslint-config-airbnb-base@15.0.0, eslint-config-airbnb-base@^15.0.0:
version "15.0.0"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236"
integrity sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==
@ -2476,21 +2453,12 @@ eslint-config-airbnb-base@15.0.0:
object.entries "^1.1.5"
semver "^6.3.0"
eslint-config-airbnb-base@^14.2.1:
version "14.2.1"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e"
integrity sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==
eslint-config-airbnb-typescript@16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-16.0.0.tgz#75007e27d5a7fb75530721f48197817c1d2ad4d1"
integrity sha512-qDOyD0YYZo5Us1YvOnWig2Ly/+IlQKmMZpnqKnJgVtHdK8SkjaSyVBHKbD41dEaQxk8vRVGBC94PuR2ceSwbLQ==
dependencies:
confusing-browser-globals "^1.0.10"
object.assign "^4.1.2"
object.entries "^1.1.2"
eslint-config-airbnb-typescript@15.0.0:
version "15.0.0"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-15.0.0.tgz#c88007b3cca5dd0f47125420ca5e8f6efac418fd"
integrity sha512-DTWGwqytbTnB8kSKtmkrGkRf3xwTs2l15shSH0w/3Img47AQwCCrIA/ON/Uj0XXBxP31LHyEItPXeuH3mqCNLA==
dependencies:
eslint-config-airbnb-base "^14.2.1"
eslint-config-airbnb-base "^15.0.0"
eslint-config-prettier@8.3.0:
version "8.3.0"
@ -3635,7 +3603,7 @@ is-buffer@^1.1.5:
resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
is-callable@^1.1.4, is-callable@^1.2.3, is-callable@^1.2.4:
is-callable@^1.1.4, is-callable@^1.2.4:
version "1.2.4"
resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz"
integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==
@ -3824,7 +3792,7 @@ is-promise@^2.2.2:
resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz"
integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==
is-regex@^1.1.3, is-regex@^1.1.4:
is-regex@^1.1.4:
version "1.1.4"
resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz"
integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==
@ -3854,7 +3822,7 @@ is-stream@^2.0.0:
resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz"
integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==
is-string@^1.0.5, is-string@^1.0.6, is-string@^1.0.7:
is-string@^1.0.5, is-string@^1.0.7:
version "1.0.7"
resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz"
integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==
@ -5274,15 +5242,6 @@ object.defaults@^1.1.0:
for-own "^1.0.0"
isobject "^3.0.0"
object.entries@^1.1.2:
version "1.1.4"
resolved "https://registry.npmjs.org/object.entries/-/object.entries-1.1.4.tgz"
integrity sha512-h4LWKWE+wKQGhtMjZEBud7uLGhqyLwj8fpHOarZhD2uY3C9cRtk57VQ89ke3moByLXMedqs3XCHzyb4AmA2DjA==
dependencies:
call-bind "^1.0.2"
define-properties "^1.1.3"
es-abstract "^1.18.2"
object.entries@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861"