Skip to content
Vladimir edited this page May 13, 2016 · 64 revisions

Installing Acralyzer

Components

Acralyzer is built with 2 components:

  • a storage database (acra-storage)
  • an analysis web application (Acralyzer)

These 2 components are GPLv3 licensed open source CouchApp projects.

CouchApps are web applications made of HTML/Javascript files and served directly by a CouchDB.

This allows you to deploy Acralyzer with simple command line instructions to a single CouchDB instance.

CouchDB is all you need to have Acralyzer running. No server-side PHP/Java/Ruby/Python is involved.

NOTE: If you want to use the replication method below, make sure you're running at least CouchDB 1.2.0 to prevent errors during replication.

CouchDB admin with Futon

Futon is the CouchDB admin application. It is usually available at the URL http://your.couchdb.instance/_utils.

Some hosting services such as Cloudant host Futon on a different URL. For Cloudant, you have to connect to the Cloudant dashboard and select a database. A View in Futon button is available.

Turn off Admin Party

This does not apply to Cloudant where Admin Party is not activated on fresh instances.

You can read a more detailed description of the security model of CouchDB adapted to Acralyzer.

Unless you don't care about your whole database being writable/destroyable by anyone, you should turn the 'Admin Party' mode off by creating an admin user. You can do this by clicking 'Fix it' button in bottom right corner at Futon.

After this is done, only your admin users can create/delete database and update application design documents.

EASY WAY - replication of remote CouchApps

NOTE: only works with CouchDB >= 1.2.0

Acralyzer can now be installed in a few steps just by replicating 2 remote couchapps.

If you prefer the old complicated way of installing Acralyzer from its sources, please refer to the manual setup.

In Futon, once logged in as an admin, select the replicator item in the right menu:

Fill the form with the following:

You can use whatever name you want instead of 'myapp' but you MUST prefix it with acra-. This naming convention allows Acralyzer to discover all acra-storage instances available on your couchdb.

  • Click on Replicate and accept the creation of the new database.

Once again for the acralyzer couchapp:

You can now go to the Acralyzer user interface using the link http://acme.yourhost.com/acralyzer/_design/acralyzer/index.html.

Create a 'reporter' user

Cloudant - create and configure an API KEY

If you're not using Cloudant hosting, use Acralyzer to create your reporter user.

Cloudant provides its own security layer over CouchDB with finer control on individual rights. Its main advantage being that it enables the creation of write-only users.

In your Cloudant Dashboard, select your acra-storage instance and go to the permissions tab:

Click the Generate API key button on the right to get your API key credentials. They simply are a pair of random generated login/password. Take note of these.

On the left panel you should now see the login name of your API key in the 'Logged in users' permissions list. Just check the 'Write' permission.

You're done, you just have to configure your application to send reports to your acra-storage.

All other CouchDB versions

Let's suppose that you installed the Acralyzer couchapp in an acralyzer database on your host http://acme.yourhost.com.

The URL of your acralyser user interface is : http://acme.yourhost.com/acralyzer/_design/acralyzer/index.html.

You can go to the Admin tab and create a reporter user using the following form:

Once created, Acralyzer provides ACRA parameters to be configured in your application:

You'll use these parameters when configuring your application to send reports to your acra-storage.

But hold on a second, you need to...

Secure access to your storage database

Skip this if you're installing on Cloudant.

You can set who is allowed to read the content of one database in Futon:

  • From your Futon root, select your acra-[yourApp] database

  • Click on Security

  • set ["reader"] in the Members Roles input and click Update

    The acralyzer database can (and should) stay readable to anyone. This will let you access to the app and login without having first to login in Futon. All your sensitive data is stored in the acra-storage instance and is readable only to admins or users with the "reader" role.

If your host is Cloudant, you can set the database to be readable to everyone from the Permissions tab of your dashboard.

Configure your application to send reports to your acra-storage

You need ACRA v4.5.x to send reports to Acralyzer. Get it here: https://oss.sonatype.org/content/groups/public/ch/acra/acra/4.5.0/acra-4.5.0.zip (also available in Maven Central repository.)

In your Android Application class, update your ACRA configuration to look like the following:

@ReportsCrashes(
        formKey = "",
        formUri = "https://[your.couchdb.host]/acra-[yourappname]/_design/acra-storage/_update/report",
        reportType = org.acra.sender.HttpSender.Type.JSON,
        httpMethod = org.acra.sender.HttpSender.Method.PUT,
        formUriBasicAuthLogin="[reporteruser]",
        formUriBasicAuthPassword="[reporterpassword]",
        // Your usual ACRA configuration
        mode = ReportingInteractionMode.TOAST,
        resToastText = R.string.crash_toast_text,
        ...
        )
public class [YourApplication] extends Application {
    
  @Override
  public final void onCreate() {
    super.onCreate();
    ACRA.init(this);
  }
    ...

Please note that if you prefer using the customReportContent field to reduce the amount of data transmitted by ACRA or add specific fields not included by default, you must include the following fields:

  • APP_VERSION_CODE
  • APP_VERSION_NAME
  • ANDROID_VERSION
  • PACKAGE_NAME
  • REPORT_ID
  • BUILD
  • STACK_TRACE

Handling more Android apps

You can create several acra-[yourappname] databases to handle reports from different apps.

All you have to do is couchapp push the acra-storage instance and setup its users.

Acralyzer discovers automatically all acra-* databases as application crashes reports repositories.