scionaltera / agonyforge

Build modern MUDs with Agony Forge.

Home Page:https://www.agonyforge.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Finally compiled AF without warnings, but the docker container is not fully initializing.

BurnDivision opened this issue · comments

commented

I uploaded the logs from Docker here. https://logpaste.com/8xjM8Y5z

I do see a few error lines. There's a couple of retries/restarts by me in there.

I've gone through some hoops just to get to this point on Windows. I installed Azul Java because the latest Java doesn't compile this. I had a lot of fun getting WSL to install and update properly in order to even get Docker engine to initialize on my Windows.

I've done everything I can to get this far but I'm at a complete loss right now.

I think I see the problem. There's an aws-cli container that is supposed to run when everything first starts up. It creates the DynamoDB table in DynamoDBLocal before the MUD tries to write data into it, but in your log it looks like something bad is happening with the script it runs. The \r characters look like carriage returns that aren't supposed to be there. It could be a side effect of cloning the project in Windows maybe? I don't usually run this on Windows; I do most of my programming on my Mac, but I do have a Win11 machine and I have gotten it to work there before.

Just as an FYI, I use Corretto 17 for Java. I don't think I've done anything weird that wouldn't work on other JVMs but that's the one I know for sure that it works on.

Screen Shot 2023-08-22 at 8 56 47 PM

The good news is you can probably fix this pretty easily on your own. The script is located in /agonyforge-mud-models-dynamodb/src/main/bash/01-create-dynamodb-table.sh and if you convert it to "unix" format in your favorite text editor or with dos2unix or some similar utility to remove the carriage returns, I bet it will start to work.

If those carriage returns somehow snuck into the git repo we can definitely get them removed, but I suspect it was something your git client did to you when you cloned it. A good item for the documentation I haven't written yet... :)

commented

Well I did install and run dos2unix on that script. When I build and run the container, agonyforge-mud-1 and agonyforge-aws-cli-1 both exit.

https://logpaste.com/AHTHkkiL

https://logpaste.com/5M9FUAxe

Those are my logs from Docker.

Ok great, it looks like your DynamoDB table did get created by the script like it was supposed to. After that Spring blew up because it couldn't configure some of the objects it needs to start up. The next steps will require a little bit of AWS and OAuth know-how. Unfortunately you have to do this part in actual AWS because I have yet to find a local mock of Cognito that works. I did just recently run across one I hadn't seen before that looks promising though.

Of course please always check the pricing before creating any AWS resources. In most regions, assuming you don't somehow have tens of thousands of players Cognito will be free and Cloud Formation will be free. It's when you start setting up RabbitMQ and ECS that things begin costing money.

Here's what you need to do to set up OAuth so that people can log in with their Amazon accounts:

  1. Go to Amazon's developer site and set up a security profile if you don't have one already. This will give you the information for the Amazon (the store, not AWS) side of the authentication.
  2. Go to AWS and create a Cognito User Pool. You can use the Cloud Formation template to do it: /cloudformation/cognito.yaml. This will give you the AWS side which will let Amazon users authenticate with your User Pool.
  3. Copy mud.EXAMPLE.env to mud.env and update the values as indicated by the comments. You can leave the top two values as 'x'. It needs to have something there for the mocks to work but it doesn't have to be valid. It's the **** values in the bottom section that need to be replaced with real values.

If mud.env is in the root directory of the project Spring will see it and pick it up automatically when you run docker-compose up. Avoid pushing mud.env into git since it will have secrets in it.

So far I've only tested Agony Forge with Amazon as the OAuth provider but I have used Cognito before with Facebook and other OAuth providers on other projects, so it should definitely be possible. You'd copy the CognitoAmazonIdentityProvider section in the Cloud Formation and use it to create the other IdentityProviders.

commented

I've been trying with AWS and Cognito for the past couple of days in my free time. Unfortunately this is requiring more knowhow than I currently have. This looks promising, but I think it requires some more dumbing down and easier ease of access even for people like me. My current problem is mainly figuring out where to find all the info needed for the strings in the CloudFormation stack.

Got it. I can definitely put together a walkthrough that will help get the Cloud Formation template running and improve the comments in the template itself.