Skip to main content

# Damster

> _Damster_ Builder of dams for logging purposes

Damster is a collection of scripts to collect metrics and reports from Atlassian tools.

This is a WIP, starting with some reports from Bamboo and Confluence:

* Bamboo
* **builds:** All builds for a specific time period
* **deployments:** All deployments for a specific time period
* **deployment-permissions:** Permissions per deployment project and environment
* Confluence
* **changes**: changes in Confluence content in the specific period

Most fo this reports will produce 3 files:
* `.json` contains the raw data used for the report.
* `.csv` contains the above data 'flattened' as csv
* `.html` is a more visual representation of the report

The output location for this files can be defined in the configuration:

```ini
[Reports]
destination_folder=C:\work\damster\globalitconfluence
```

# Usage

Create a virtualenv and install `damster`, either from source or from PyPi:

```bash
$ virtualenv .env
$ source .env/bin/activate
(.env) $ pip install damster # Install from PyPi
(.env) $ pip install -e ./path/to/damster # Install from source
```

For specific instructions on how to use a report, you can request help form the cli:

```bash
(.env) $ damster bamboo builds --help
Usage: damster bamboo builds [OPTIONS] FROM_DATE [TO_DATE]

Generate a builds report

Options:
--use-cache / --no-use-cache
--help Show this message and exit.

```

# Configuration

There are 3 levels of configuration files that can override settings from the previous level:

1. Package defaults, stored in `damster/deaults.cfg`. This file contains the whole set of available
settings and is a good default for your development install.
2. User settings, from `~/.config/damster.cfg` can be used to store user specific settings, like secrets, etc
3. Per-use settings, passes as an argument to damster in each call to the command line:

```bash
(.env) $ damster -c path/to/bamboo-prod.cfg bamboo builds
```

Some of the reports use the REST API for retrieving dat, while others will try to connect directly to the
database. For the REST API reports you will need to provide a user credentials with sufficient permissions,
while for the database reports you will need the credentials of a user with, at least, `SELECT` privileges
on the corresponding database.

## Database configuration

In order to use any of the queries that access directly to the database, you will need to provide a database
configuration section.

### Direct connection

Use this settings if you can connect directly to the DB port

```ini
[Confluence DB]
dbname=confluence
dbuser=confluence
password=password1
host=dbhost.example.com
port=5432
```

### Use SSH tunnel

Use this configuration when you can not access the DB directly, for example, if your DB is an
RDS instance in AWS:

```

----------------------------------------------------------------------

|
-------------+ | +---------+ +--------+
LOCAL | | | APP | | RDS |
CLIENT | <== SSH ======> | SERVER | <== Sec ==> | SERVER |
-------------+ | +---------+ Group +--------+
|
AWS (only access to port 22 on app.server)

----------------------------------------------------------------------
```

Example configuration for the above case:

```ini
[Confluence DB]
dbname=confluence
dbuser=confluence
password=password1
ssh_gateway=app.server
host=rds.server
port=5432
```

Additionally, you may also need an SSH section, if the defaults (below) do not work for your case:

```ini
[SSH]
; All below values are optional. Examples are the default values
;ssh_username: current_user
;ssh_private_key: id_rsa
;port: 22
;local_bind_port: 6543
```

Don't forget to instruct `damster` to use the ssh gateway by adding the `-S` flag:

```bash
(.env) $ damster -c myconfig.cfg confluence changes -S
```


Metadata

Release files for damster 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for damster 0.2.1
File Size Uploaded Provenance Actions
damster-0.2.1.tar.gz 20.8 kB Without provenance Details for damster-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for damster 0.2.1
File Interpreter ABI Platform Actions
damster-0.2.1-py3-none-any.whl Python 3 none any Details for damster-0.2.1-py3-none-any.whl

Total release size: 44.7 kB

Release files / damster-0.2.1.tar.gz

Download URL damster-0.2.1.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
27d18fa2f9d9db6fedce5173112722dd0f2e9712cb660f06ac9f9b3ef0e97704
BLAKE2b-256 checksum
How to use checksums
3e3155b90b8162aef263bc5ec5f8efbd116179b5ee3495c94e984ecfc24e7855
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / damster-0.2.1-py3-none-any.whl

Download URL damster-0.2.1-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af6d529600047ec0cf854564649b3ba108a4dec6a20a8169348d40ccf437518a
BLAKE2b-256 checksum
How to use checksums
ff8b5f0d28b064442825041e5fbb2c9fa6191ce2cc8487bee3cbcedf34de44c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for damster 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page