Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
# Files to ignore by Docker when transfering context

**/.git
/docs/
/notebooks/

**/.DS_Store

# Back-up files
**/*~
**/*.swp

# Generic auto-generated build files
**/*.pyc
**/*.pyo
**/.ipynb_checkpoints/

# Specific auto-generated build files
/.eggs
/.tox
**/__pycache__
/api_client/python/build/
/cli_client/python/build/
/importer_client/python/build/
**/dependencies/
/*.egg-info

# Ignore frontend build related files
**/node_modules
/timesketch/static/dist
**/package-lock.json
**/yarn.lock

# Test files
**/.coverage
**/tests-coverage.txt

# Exclude Vagrant runtime files
/vagrant/.vagrant/
/vagrant/*.log

# Exclude .venv folder
/.venv/

# Exclude Visual Studio Code files
/.vscode/*

# Exclude JetBrains IDE files
/.idea/
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
**/docker/** text=auto eol=lf
requirements.txt text=auto eol=lf
requirements-dev.txt text=auto eol=lf

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ vagrant/*.log

# Exclude debugging profiles
profiles/

# Exclude Docker Compose .env file
.env
22 changes: 22 additions & 0 deletions contrib/docker/dev/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
GIFT_PPA_TRACK="stable"
GIFT_PPA_URL="https://ppa.launchpadcontent.net/gift/${GIFT_PPA_TRACK}/ubuntu"
NODE_VERSION="20.x"
NODE_PPA_URL="https://deb.nodesource.com/node_${NODE_VERSION}"
NODE_NPMRC=""
YARN_YARNRC=""
PYTHON_PIP_CONF=""

TIMESKETCH_BASE_IMAGE="ubuntu:24.04"
TIMESKETCH_CONF_DIR="/etc/timesketch"
TIMESKETCH_SECRET_KEY="L4np0jV3yAdAFdbVzWRMaBqiFMV8FKYd+Je1WKE40o8="
TIMESKETCH_USER="dev"
TIMESKETCH_PASSWORD="dev"
TIMESKETCH_USER_NAME="ubuntu"
TIMESKETCH_USER_UID="1000"
TIMESKETCH_USER_GID="1000"

POSTGRES_USER="timesketch"
POSTGRES_PASSWORD="password"
POSTGRES_DB="timesketch"

FRONTEND_VERSION="frontend-ng"
63 changes: 63 additions & 0 deletions contrib/docker/dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Docker Compose for development

## Prepare a .env file

Compose requires a `.env` file with top level environment variables to be set.
To create it, just copy the `.env.template` file as a base.

```bash
cp contrib/docker/dev/.env.template contrib/docker/dev/.env
```

Note the `.env` is ignored by Git: You can safely write sensitive data in it.

You can optionally edit the `.env` file.
This is useful if you need to build images with some company restrictions
(accessing remote Ubuntu, PyPI or Node repositories).

The default Timesketch user is `dev` and its password is `dev`.

## Build or rebuild images

To build images:

```bash
docker compose -f contrib/docker/dev/compose.yaml build
```

## Start services

To start all services:

```bash
docker compose -f contrib/docker/dev/compose.yaml up -d
```

On the first run, the _setup_ service will:

- Create the Timesketch user (defaults `dev` with password `dev`),
- Clone (fetch on subsequent runs) the
[SigmaHQ/sigma](https://github.com/SigmaHQ/sigma) repository,
- Import the sigma rules set in [sigma_rules.txt](timesketch/sigma_rules.txt)

Go to your browser:

- <http://127.0.0.1:5000/>: Frozen frontend (_dist_ compiled files), backend
with latest sources and live reload,
- <http://127.0.0.1:5001/>: Frontend and backend with latest sources and live
reload (slower to be available).
- <http://localhost:8844/>: Jupyter notebook with (password: `timesketch`).

## Stop services

To stop services and remove related containers:

```bash
docker compose -f contrib/docker/dev/compose.yaml down
```

To delete service data at once:

```bash
docker compose -f contrib/docker/dev/compose.yaml down -v
```
Loading