diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index f0ea3c1..99f1b77 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -7,6 +7,7 @@ ### Getting Started * [Installation](./getting-started/installation.md) +* [Authenticating with Screeps](./getting-started/authenticating.md) * [Deploying](./getting-started/deploying.md) ### In-Depth diff --git a/docs/getting-started/authenticating.md b/docs/getting-started/authenticating.md new file mode 100644 index 0000000..9da0251 --- /dev/null +++ b/docs/getting-started/authenticating.md @@ -0,0 +1,43 @@ +# Authenticating with Screeps + +Screeps has recently introduced a [token-based auth system](http://blog.screeps.com/2017/12/auth-tokens/), and the old authentication system will be deprecated by 01 February 2018. The starter kit has been updated to support this new authentication process. + +## Migrating to the new auth system + +If you have an existing copy of your starter kit, follow these steps: + +* Remove the `"username"` and `"password"` keys from your `screeps.json` file, and replace them with `"token"`. +* Upgrade `rollup-plugin-screeps` to version 0.1.1. +* Follow the authentication steps as defined below. + +## Seting up Screeps authentication + +The authentication token is pulled by the starter kit from a file named `screeps.json`. A sample config file (`screeps.sample.json`) is provided within the project, to use it, simply make a copy and rename it to `screeps.json`. + +```bash +cp screeps.sample.json screeps.json +``` + +> **IMPORTANT:** The `screeps.json` file contains your Screeps credentials. If you use any source control, **DO NOT** check in this file into your repository. + +## Generating an auth token + +To generate an authentication token, click **[your username] > Manage account**. You should see the **Auth tokens** in the options now, click it. + +![authenticating-1](img/authenticating-1.png) + +On the next screen, we'll create a full access token. We pick the **Full access** option, then click the **Generate Token** button. + +![authenticating-2](img/authenticating-2.png) + +Your generated token should now be shown on your screen. Copy it to your clipboard. + +![authenticating-3](img/authenticating-3.png) + +> **Note:** This token will be displayed **only once**! Make sure to never lose it. However, if you did lose it, simply remove said token from your account, and create a new one. + +Now, paste it to your `screeps.json` file. + +![authenticating-4](img/authenticating-4.png) + +Congratulations, you've successfully authenticated! Next up, we'll configure our environment and [run our first code deploy](./deploying.md). diff --git a/docs/getting-started/deploying.md b/docs/getting-started/deploying.md index 941a6b8..073cd49 100644 --- a/docs/getting-started/deploying.md +++ b/docs/getting-started/deploying.md @@ -2,17 +2,11 @@ ## Building your configuration file -The starter kit builds your code using `rollup`, which uses a `screeps.json` file as its configuration file. A sample config file is provided within the project, to use it, simply make a copy and rename it to `screeps.json`. +The starter kit builds your code using `rollup`, which uses a `screeps.json` file we built on the previous section as its configuration file. -```bash -cp screeps.sample.json screeps.json -``` +The `screeps.json` file is a JSON configuration file separated into multiple environments. We're going to focus on the `main` environment to get you started. If you'd like to deploy to a different branch, be sure to change the `branch` key to the branch you'd like to deploy to. -> **IMPORTANT:** The `screeps.json` file contains your Screeps credentials. If you use any source control, **DO NOT** check in this file into your repository. - -The `screeps.json` file is a JSON configuration file separated into multiple environments. We're going to focus on the `main` environment to get you starter. Fill in your Screeps credentials accordingly, along with your target branch. - -![deploying-1](img/deploying-1.png) +![authenticating-4](img/authenticating-4.png) > **Note:** You don't have to manually create the target branch in your Screeps client if it doesn't exist yet. `rollup-plugin-screeps` will do it for you. diff --git a/docs/getting-started/img/authenticating-1.png b/docs/getting-started/img/authenticating-1.png new file mode 100644 index 0000000..9c18b26 Binary files /dev/null and b/docs/getting-started/img/authenticating-1.png differ diff --git a/docs/getting-started/img/authenticating-2.png b/docs/getting-started/img/authenticating-2.png new file mode 100644 index 0000000..a47e05a Binary files /dev/null and b/docs/getting-started/img/authenticating-2.png differ diff --git a/docs/getting-started/img/authenticating-3.png b/docs/getting-started/img/authenticating-3.png new file mode 100644 index 0000000..1bacad9 Binary files /dev/null and b/docs/getting-started/img/authenticating-3.png differ diff --git a/docs/getting-started/img/authenticating-4.png b/docs/getting-started/img/authenticating-4.png new file mode 100644 index 0000000..dda8c2e Binary files /dev/null and b/docs/getting-started/img/authenticating-4.png differ diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 4575607..9f9540a 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -22,4 +22,4 @@ Or if you're running `yarn`: yarn ``` -Next up, we'll configure our environment and [run our first code deploy](./deploying.md). +Once that's all done, let's [authenticate with the Screeps server](./authenticating.md). diff --git a/screeps.sample.json b/screeps.sample.json index 94be95b..14bff62 100644 --- a/screeps.sample.json +++ b/screeps.sample.json @@ -1,7 +1,6 @@ { "main": { - "email": "you@provider.tld", - "password": "Password", + "token": "YOUR_TOKEN", "protocol": "https", "hostname": "screeps.com", "port": 443, @@ -9,8 +8,7 @@ "branch": "main" }, "sim": { - "email": "you@provider.tld", - "password": "Password", + "token": "YOUR_TOKEN", "protocol": "https", "hostname": "screeps.com", "port": 443,