Skip to content

Commit

Permalink
Update deployment section of the README
Browse files Browse the repository at this point in the history
  • Loading branch information
robinje committed Aug 27, 2024
1 parent de29fa8 commit d720c0e
Showing 1 changed file with 44 additions and 13 deletions.
57 changes: 44 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,55 @@ The current implementation includes an SSH server for secure authentication and

Deploying the server involves several steps, from setting up your environment to running the server. Follow these steps to ensure a smooth deployment process:

1. **Install Go**: The server is written in Go, so you need to have Go installed on your system. Download it from the [Go website](https://golang.org/).
1. **Install Python**: The server and utility scripts are now written in Python. Install Python 3.7 or later from the [Python website](https://www.python.org/).

2. **Set Up AWS Account**: An AWS account is required for deploying certain components of the server, such as the authentication system. Sign up for an account [here](https://aws.amazon.com/) if you don't already have one.
2. **Set Up AWS Account**: An AWS account is required for deploying the server components, including DynamoDB and Cognito. Sign up for an account [here](https://aws.amazon.com/) if you don't already have one.

3. **Configure AWS Credentials**: Ensure you have AWS credentials configured on your machine. These credentials should have sufficient permissions to create a Cognito user pool and the necessary IAM policies and roles. You can configure your credentials by using the AWS CLI and running `aws configure`.
3. **Configure AWS Credentials**: Ensure you have AWS credentials configured on your machine. These credentials should have sufficient permissions to create DynamoDB tables, a Cognito user pool, and the necessary IAM policies and roles. You can configure your credentials by using the AWS CLI and running `aws configure`.

4. **Deploy Cognito and IAM Resources**:
4. **Install Required Python Packages**: Install the necessary Python packages by running:
```
pip install boto3 pyyaml
```

5. **Deploy AWS Resources**:
- Navigate to the `scripts` directory within the project.
- Run the `deploy_cognito.py` script using the command `python deploy_cognito.py`. This script will create the Cognito instance along with the required IAM policies and roles. It will also generate the `config.json` file needed to run the server. Ensure you have Python installed on your machine to execute this script.

5. **Install Go Dependencies**: Before starting the server, you need to install the necessary Go dependencies. In the root directory of the project, run `go mod download` to fetch all required packages.

6. **Initalize the Database**: The server uses a BoltDB database for the world data. You can initialize the database by running the `data_loader.go` script located in the `database` directory. Run the script using the command `go run .`. The output will be the `test_data.bolt` file, which contains the initial world data. Copy this file to the `mud` directory.

7. **Start the Server**: Finally, you can start the server by running `go run .` from the root directory of the project. This command compiles and runs the Go application, starting up your MUD server.

Ensure all steps are completed without errors before trying to connect to the server. If you encounter any issues during deployment, refer to the specific tool's documentation for troubleshooting advice.
- Run the `deploy.py` script using the command:
```
python deploy.py
```
This script will create the Cognito user pool, DynamoDB tables, and CodeBuild project. It will also generate the `config.yml` file needed to run the server.
6. **Initialize the Database**:
- Navigate to the directory containing the `data_loader.py` script.
- Run the script using the command:
```
python data_loader.py -r rooms.json -a archetypes.json -p prototypes.json
```
This will load the initial world data into your DynamoDB tables.
7. **Start the Server**: Start the server by running the main Python script from the root directory of the project:
```
python main.py
```
8. **Verify Deployment**: You can verify the deployment by using the viewer script:
```
python viewer.py --region your-aws-region
```
This will display the contents of your DynamoDB tables.
Ensure all steps are completed without errors before trying to connect to the server. If you encounter any issues during deployment, refer to the AWS documentation or the specific tool's documentation for troubleshooting advice.
## Additional Tools
- **Create Item**: To add new items to rooms, use the `create_item.py` script:
```
python create_item.py
```
Follow the prompts to select a room and an item prototype, and the script will create a new item in the specified room.
Remember to keep your AWS credentials secure and never commit them to version control. It's recommended to use AWS IAM roles and policies to manage permissions securely.advice.
## License
Expand Down

0 comments on commit d720c0e

Please sign in to comment.