beabee-communityrm / beabee-deploy

A self hosting guide for beabee
GNU Affero General Public License v3.0
4 stars 0 forks source link

Bacl screen and console errors on Join page #16

Closed gammaw closed 6 months ago

gammaw commented 7 months ago

We managed to install a test instance, we can log in with the user that was created during the setup phase, but the Join page gives us a "black screen" and following errors in the Console. Any idea what's going wrong?

image

JumpLink commented 7 months ago

The fact that you have come this far is already a great success, we definitely need to improve the documentation. But maybe we can use this to do just that 😁

Spontaneously I would assume that not all environment variables are set correctly. I am no longer at the PC, when I get back to it I can describe my local setup and my .env here. It would certainly be helpful if you could do the same. Also feel free to mention what is unclear in the documentation. 👍

JumpLink commented 7 months ago

@gammaw I have a supplementary question, have you already got the system running locally or have you already done that and are now trying to host it on a server?

JumpLink commented 7 months ago

After trying to figure out our own setup (we use Portainer with multiple internal networks), I realised that I don't have it all figured out (that's what @wpf500 was responsible for so far, maybe he can help) and that it's very customised to our own needs. I could share our docker-compose.yml here, but I don't think that would be much help. So I would recommend the following to get started:

The docker-compose.yml from the backend is intended for local development and not for production systems. For example, maildev is used to simulate a mail server without sending out real emails. But maybe you already have a service here that you want to use for it. Therefore, adapt the docker-compose.yml piece by piece to make it ready for productive use.

I'm sorry that this is still so cumbersome at the moment, but improvements in this area are on our roadmap. It would certainly help others if you could share your working setup here. If there are any further questions or problems, please feel free to ask them as well.

wpf500 commented 7 months ago

Hi @gammaw! This usually happens because the join form options haven't been configured. Did you run the following step during setup?

docker compose run --rm run node built/tools/configure

It's exciting that you are trying out the self-hosted version of beabee :smile:. I hope we can help you get it set up, and like @JumpLink says, apologies for the currently quite cumbersome process!

wpf500 commented 7 months ago

It might also help if you can share the response you get from http://<your url>/api/1.0/content/join

It will look something like this:

{
  "initialAmount": 36,
  "initialPeriod": "annually",
  "minMonthlyAmount": 1,
  "periods": [
    {
      "name": "monthly",
      "presetAmounts": [
        1,
        4,
        10
      ]
    },
    {
      "name": "annually",
      "presetAmounts": [
        36,
        60,
        120
      ]
    }
  ],
  "paymentMethods": [
    "s_card",
    "s_sepa",
    "s_bacs",
    "s_paypal",
    "gc_direct-debit"
  ],
  "showAbsorbFee": true,
  "showNoContribution": false,
  "stripeCountry": "eu",
  "stripePublicKey": "pk_test_51IgYEbIkc8OogYsiBdbHiPd2GNbR9Qsk2YC1nO5rtfHnqiIMXE63nGBgto3MDLqd5jqOygyhQkXfDVJDk8XRBo4J00aJgOSLOE",
  "subtitle": "<p>No no no</p>",
  "title": "Hello there"
}
tuz666 commented 7 months ago

Hi @JumpLink and @wpf500 ,

No worries about the documentation, it made us this far so it wasn't that bad, and many thanks for the quick response and your support! :)

Let me describe our current state:

I am no longer at the PC, when I get back to it I can describe my local setup and my .env here. It would certainly be helpful if you could do the same

I think these were the important changes in the .env which we did:

BEABEE_AUDIENCE=http://<our_hostname>
BEABEE_COOKIE_DOMAIN=<our_hostname>
BEABEE_COOKIE_SECURE=false
BEABEE_DATABASE_URL=<our_db_connection_uri>

We also had to do two changes in the docker-compose.yaml, first we added a PG DB as a service and we made the x-app to depends_on this db. (Unfortunately running the DB locally on the server caused a connectivity issue during the migration, that's why we made this change)

x-app: &app
  depends_on:
    - db
  image: beabee/beabee:release
  restart: always
  env_file:
    - .env
  logging:
    driver: syslog
    options:
      tag: docker/{{.Name}}

And another minor change was done in the update.sh script, from the following line we removed the --no-deps option (this was also required for a successful migration as I remember): docker-compose run --rm --no-deps run npm run typeorm migration:run

I have a supplementary question, have you already got the system running locally or have you already done that and are now trying to host it on a server?

We haven't tried running the system locally we thought that we will follow the instructions given in this repo and try to set up on a server to see how it works.

This usually happens because the join form options haven't been configured. Did you run the following step during setup? docker compose run --rm run node built/tools/configure

Yes, we ran those two commands, this was the first one which asked for the Email Domain and the Payment Method, right?

It might also help if you can share the response you get from http:///api/1.0/content/join

This was the response for us, I suppose this looks fine, except I didn't configure the Strip public key yet.

{
  "initialAmount": 5,
  "initialPeriod": "monthly",
  "minMonthlyAmount": 1,
  "periods": [
    {
      "name": "monthly",
      "presetAmounts": [
        3,
        5,
        10
      ]
    },
    {
      "name": "annually",
      "presetAmounts": [
        36,
        60,
        120
      ]
    }
  ],
  "paymentMethods": [],
  "showAbsorbFee": true,
  "showNoContribution": false,
  "stripeCountry": "eu",
  "stripePublicKey": "pk_live_???",
  "subtitle": "<p><br></p>",
  "title": "Join now!"
}

I didn't have time yet to go through those steps you mentioned @JumpLink , but thanks for that as well, I will give that a try too and update you guys with the results!

JumpLink commented 7 months ago

@tuz666 Since @wpf500 has an assumption as to what the problem is, you probably don't need my steps 👍

EDIT @will Sorry for wrong tagging, but funny profile ;)

wpf500 commented 7 months ago

@tuz666 I think what might be happening is that the join form wants at least one payment method to be enabled, even if the backend isn't configured yet.

Could you try running docker compose run --rm run node built/tools/configure again and selecting at least one of the payment methods to see if that fixes it? If that is the case then we should probably enforce selecting one of those options in the script.

Interesting what you are saying about the database. At the moment the instructions assume the database is outside of the Docker Compose stack so will always be available. Ideally it's better to not edit the docker-compose.yml file because if we update it it's easier for you just git pull the changes. You can add a docker-compose.override.yml files to make your own changes to the stack (Docker Compose automatically reads both), you can find out more about the merging logic here: https://docs.docker.com/compose/multiple-compose-files/merge/#merging-rules

tuz666 commented 6 months ago

@wpf500, you are right!

At first blink I thought it's a single select dialog, but I've just realized that I have to choose all the desired options beforehand.

Thanks for the quick help! ::)

wpf500 commented 6 months ago

@tuz666 great, thanks for reporting back. I'll update the configure script to require at least one payment option so this is slightly smoother for the next person!