"Fossies" - the Fresh Open Source Software Archive

Member "wire-server-2021-10-01/deploy/services-demo/README.md" (4 Oct 2021, 8166 Bytes) of package /linux/misc/wire-server-2021-10-01.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

How to run wire-server with "fake" AWS dependencies in demo mode

This document assumes that you have already compiled all services (i.e., you read all of the README.md from the top level folder and ran make services there) and now you want to see how it all fits together.

Use 2 different terminals and run:

# On terminal 1, start the dependencies. Note that you should turn up the max memory
# limit of docker. More on https://github.com/wireapp/wire-server/issues/326
# On terminal 2, start the services
deploy/services-demo/demo.sh  # if all services have been compiled natively
deploy/services-demo/demo.sh docker # in case Docker images were built instead

Structure of the services-demo folder

conf                                 <- folder with configuration for all services
  └── nginz
        ├── nginx.conf               <- main nginx configuration
        ├── ...                      <- other nginx config files
        ├── upstreams                <- nginx upstream configuration
  ├── <service>.demo.yaml            <- service configuration file (brig, cannon, cargohold, galley, gundeck, proxy)
resources                            <- folder which contains secrets or other resources used by services
  ├── templates                      <- email/sms/call templates used by brig
  ├── turn                           <- list of TURN servers available and a secret (autogenerated by demo.sh, used by brig and TURN server)
  ├── zauth                          <- public/private keys used for authentication (autogenerated by demo.sh, used by brig and nginz)
  ├── nexmo-credentials.yaml         <- dummy credentials for the nexmo API (used by brig)
  ├── proxy.config                   <- dummy credentials for multiple proxied services (used by proxy)
  ├── twilio-credentials.yaml        <- dummy credentials for the twilio API (used by brig)
├── create_test_user.sh              <- bash script that creates a user and prints the credentials created
├── demo.sh                          <- bash script that generates needed secrets and starts all services
└── README.md                        <- this file

Why do you describe this as a demo?

It is however very straightforward to setup all the necessary dependencies to run wire-server and it is what we use in our integration tests as well (as can be seen in our integration bash script).

Common problems

nginx: [alert] could not open error log file: open() "/var/log/nginz/error.log" failed (2: No such file or directory)

This is not really an issue and nginz is fine. nginz has a LOG_PATHcheck the Makefile defined which it always tries to write to during startup, even if you have defined a different path on your nginx.conf. You can safely ignore this warning or recompile nginz with a LOG_PATH which is writable on your system.

Is there a way to look at some API endpoints?

Yes. If all has been set up correctly, you should be able to navigate to where you should be faced with a login screen that looks like

login screen

In order to view the API, you need to create a regular user. For that purpose, you can then run the script ./create_test_user.sh and use the credentials that you see on the screen to log in.

This is fantastic, all services up & running... what now, can I run some kind of smoketests?

Yes. You need to specify an email address that the smoketests can log in to via IMAP for it to read and act upon registration/activation emails. Have a look at what the configuration for the api-smoketest should be. Once you have the correct mailboxes.json, this should just work from the top level directory (note the sender-email must match brig's sender-email).

If you wish to send verification SMS/calls (to support registration using phone numbers), you need to create an account and configure Twilio: you need to specify the sid and token from the Twilio account in the "wire-server/blob/develop/deploy/services-demo/resources/twilio-credentials.yaml". And specify your Twilio number in smsSender in file "wire-server/deploy/services-demo/conf/brig.demo.yaml" at emailSMS.general.smsSender.

Note: This demo setup comes bundled with a postfix email sending docker image; however due to the minimal setup, emails will likely land in the Spam/Junk folder of the target email address, if you configure a common email provider. To get the smoketester to check the Spam folder as well, use e.g. (in the case of gmail) --mailbox-folder INBOX --mailbox-folder '[Gmail]/Spam'.

Configure an email inbox for the smoketester:

# from the root of wire-server directory
cp tools/api-simulations/mailboxes.example.json mailboxes.json

Now adjust mailboxes.json and use credentials for an email account you own.

Next, from the wire-server directory, after having compiled everything with 'make install':

./dist/api-smoketest \
    --api-host= \
    --api-port=8080 \
    --api-websocket-host= \
    --api-websocket-port=8081 \
    --mailbox-config=mailboxes.json \
    --sender-email=backend-demo@mail.wiredemo.example.com \
    --mailbox-folder INBOX \
    --mailbox-folder '[Gmail]/Spam' \