Skip to content

Commit adfbb16

Browse files
authored
Updated instructions
1 parent 3e9c4c2 commit adfbb16

File tree

1 file changed

+93
-18
lines changed

1 file changed

+93
-18
lines changed

README.md

Lines changed: 93 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,131 @@
1-
# potsi
1+
# Trusted Server
22

3-
# Installation
3+
:information_source: At this time, Trusted Server is designed to work with Fastly. Follow these steps to configure Fastly Compute and deploy it.
44

5-
## Pre-requisites
5+
## Fastly
6+
- Create account at Fastly if you don’t have one - manage.fastly.com
7+
- Log in to the Fastly control panel.
8+
- Go to Account > API tokens > Personal tokens.
9+
- Click Create token
10+
- Name the Token
11+
- Choose User Token
12+
- Choose Global API Access
13+
- Choose what makes sense for your Org in terms of Service Access
14+
- Copy key to a secure location because you will not be able to see it again
15+
16+
- Create new Compute Service
17+
- Click Compute and Create Service
18+
- Click “Create Empty Service” (below main options)
19+
- Add your domain of the website you’ll be testing or using and click update
20+
- Click on “Origins” section and add your ad-server / ssp partner information as hostnames (note after you save this information you can select port numbers and TLS on/off)
21+
- IMPORTANT: when you enter the FQDN or IP ADDR information and click Add you need to enter a “Name” in the first field that will be referenced in your code so something like “my_ad_partner_1”
22+
-
23+
24+
:warning: Fastly gives you a test domain to play on but obviously you’re free to create a CNAME to your domain when you’re ready. Note that Fastly compute ONLY accepts client traffic from TLS
25+
26+
## Installation
27+
28+
### Brew
29+
30+
:warning: Follow the prompts before and afterwards (to configure system path, etc)
31+
32+
#### Install Brew
633

7-
### asdf
834
```sh
9-
brew install asdf
35+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
1036
```
37+
### Fastly CLI
1138

12-
### Fastly
39+
#### Install Fastly CLI
1340
```sh
1441
brew install fastly/tap/fastly
1542
```
1643

17-
## rust
44+
#### Verify Installation and Version
45+
```sh
46+
fastly version
47+
```
48+
49+
#### Create profile and follow interactive prompt for pasting your API Token created earlier:
50+
```sh
51+
fastly profile create
52+
```
53+
54+
### Rust
55+
56+
#### Install Rust with asdf
1857
```sh
58+
brew install asdf
1959
asdf plugin add rust
2060
asdf install rust 1.83.0
2161
asdf reshim
2262
```
2363

24-
## viceroy (for running tests)
64+
#### Fix path for Bash
65+
66+
Edit ~/.bash_profile to add path for asdf shims:
2567
```sh
26-
cargo install viceroy
68+
export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
69+
```
70+
71+
#### Fix path for ZSH
72+
73+
Edit ~/.zshrc to add path for asdf shims:
74+
```sh
75+
export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
2776
```
2877

29-
## Build
78+
#### Other shells
79+
See https://asdf-vm.com/guide/getting-started.html#_2-configure-asdf
80+
81+
82+
### Configure Build and
83+
84+
#### Clone Project
85+
```sh
86+
git clone [email protected]:IABTechLab/trusted-server.git
87+
```
88+
89+
### Configure
90+
#### Edit configuration files
91+
:information_source: Note that you’ll have to edit the following files for your setup:
92+
93+
- fastly.toml (service ID, author, description)
94+
- Potsi.toml (KV store ID names)
95+
96+
### Build
3097

3198
```sh
3299
cargo build
33100
```
34101

35-
## Run
102+
### Deploy to Fastly
36103

37-
### Fastly
38-
- Review configuration for [local_server](fastly.toml#L16)
104+
```sh
105+
fastly compute publish
106+
```
39107

40-
- Run it with
108+
## Devleopment
41109

110+
#### Install viceroy for running tests
42111
```sh
43-
fastly -i compute serve
112+
cargo install viceroy
44113
```
45114

46-
## Test
115+
#### Run Fastly server locally
116+
Review configuration for [local_server](fastly.toml#L16)
117+
```sh
118+
fastly -i compute serve
47119
```
120+
121+
#### Tests
122+
```sh
48123
cargo test
49124
```
50125

51-
Note: if test fails `viceroy` will not display line number of the failed test. Rerun it with `cargo test_details`.
126+
:warning: if test fails `viceroy` will not display line number of the failed test. Rerun it with `cargo test_details`.
52127

53-
## Additional Rust Commands
128+
#### Additional Rust Commands
54129
- `cargo fmt`: Ensure uniform code formatting
55130
- `cargo clippy`: Ensure idiomatic code
56131
- `cargo check`: Ensure compilation succeeds on Linux, MacOS, Windows and WebAssembly

0 commit comments

Comments
 (0)