-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
got rid of auth config and remote config since that will be on a per …
…remote basis, and refactor setting of user name and email with better error messages
- Loading branch information
Showing
32 changed files
with
368 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,6 @@ jobs: | |
cargo build | ||
mkdir /tmp/oxen_sync/ | ||
mkdir data/test/runs | ||
./target/debug/oxen set-default-host 0.0.0.0:3000 | ||
./target/debug/oxen-server add-user --email [email protected] --name Ox --output auth_config.toml | ||
cp auth_config.toml data/test/config/auth_config.toml | ||
./target/debug/oxen-server add-user --email [email protected] --name Ox --output user_config.toml | ||
cp user_config.toml data/test/config/user_config.toml | ||
./target/debug/oxen-server start & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,15 +24,15 @@ Build the binaries | |
|
||
Generate a config file and token to give user access to the server | ||
|
||
`./target/debug/oxen-server add-user --email [email protected] --name Ox --output auth_config.toml` | ||
`./target/debug/oxen-server add-user --email [email protected] --name Ox --output user_config.toml` | ||
|
||
Copy the config to the default locations | ||
|
||
`mkdir ~/.oxen` | ||
|
||
`mv auth_config.toml ~/.oxen/auth_config.toml` | ||
`mv user_config.toml ~/.oxen/user_config.toml` | ||
|
||
`cp ~/.oxen/auth_config.toml data/test/config/auth_config.toml` | ||
`cp ~/.oxen/user_config.toml data/test/config/user_config.toml` | ||
|
||
Run the server | ||
|
||
|
@@ -79,7 +79,7 @@ Server defaults to localhost 3000 | |
|
||
`set SERVER 0.0.0.0:3000` | ||
|
||
You can grab your auth token from the config file above (~/.oxen/auth_config.toml) | ||
You can grab your auth token from the config file above (~/.oxen/user_config.toml) | ||
|
||
`set TOKEN <YOUR_TOKEN>` | ||
|
||
|
This file was deleted.
Oops, something went wrong.
7 changes: 2 additions & 5 deletions
7
data/test/config/auth_config.toml → data/test/config/user_config.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
host = "0.0.0.0:3000" | ||
|
||
[user] | ||
id = "8dbce3c3-8e8d-46f6-8d1c-784552dc8631" | ||
email = "[email protected]" | ||
name = "Oxen" | ||
token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjhkYmNlM2MzLThlOGQtNDZmNi04ZDFjLTc4NDU1MmRjODYzMSIsIm5hbWUiOiJncmVnIiwiZW1haWwiOiJnQG94ZW4uYWkifQ.xGLwbZtnIapddbHLRfaUlxA6HaFS92UZmOtiRp1GWaE" | ||
email = "[email protected]" | ||
name = "greg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,8 +158,8 @@ If you would like to see the API with `curl` on the command line you can run the | |
In order to get a valid auth token you can run add a user to the server via | ||
|
||
```shell | ||
$ ./target/debug/oxen-server add-user --email [email protected] --name Ox --output auth_config.toml | ||
$ cat auth_config.toml | grep token | ||
$ ./target/debug/oxen-server add-user --email [email protected] --name Ox --output user_config.toml | ||
$ cat user_config.toml | grep token | ||
``` | ||
|
||
For more information on server setup look at the [Server Setup Documentation](../examples/0_ServerSetup.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,15 @@ Build the Oxen Server and Oxen CLI binaries | |
|
||
`cargo build` | ||
|
||
The default host for a dev server is `0.0.0.0:3000`, this can always be changed with the `set-default-host` command. | ||
|
||
`./target/debug/oxen set-default-host 0.0.0.0:3000` | ||
|
||
Generate a config file that contains an access token to give it to the user to access to the server | ||
|
||
`./target/debug/oxen-server add-user --email [email protected] --name Ox --output auth_config.toml` | ||
`./target/debug/oxen-server add-user --email [email protected] --name Ox --output user_config.toml` | ||
|
||
The user who needs access should copy the config to the ~/.oxen directory, which is where the Oxen CLI looks for it. If the user has not done this step, they will not have access to the server. | ||
|
||
`mkdir ~/.oxen` | ||
|
||
`mv auth_config.toml ~/.oxen/auth_config.toml` | ||
`mv user_config.toml ~/.oxen/user_config.toml` | ||
|
||
Run the server | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,6 @@ ln -s /path/to/release/build/oxen /usr/local/bin/oxen | |
|
||
# Run the server with a user | ||
mkdir -p /home/ubuntu/Data/sync/ | ||
sudo env SYNC_DIR=/home/ubuntu/Data/sync/ ./target/release/oxen-server add-user --email [email protected] --name Ox --output auth_config.toml | ||
sudo env SYNC_DIR=/home/ubuntu/Data/sync/ ./target/release/oxen-server add-user --email [email protected] --name Ox --output user_config.toml | ||
sudo env SYNC_DIR=/home/ubuntu/Data/sync/ ./target/release/oxen-server start -p 80 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.