vfaergestad / mattermost-logger

Bot for logging Mattermost messages from specified channels.
MIT License
4 stars 0 forks source link

fix: Logger creates directory if output file does not exist #2

Closed vfaergestad closed 4 weeks ago

vfaergestad commented 4 weeks ago

In the case that the specified output_file does not exist, the application creates a directory with the output_file name instead of a file. If a file with the name already exist, it uses that file as intented.

Todo:

vfaergestad commented 4 weeks ago

Troubleshooting made me release that it is not the application itself that causes this, but docker, since it does not happen when using the binary.

vfaergestad commented 4 weeks ago

Solved by specifying a folder for the output_file to be in in both config.json and docker-compose.yml, for example:

{
"mattermost_domain": "your-mattermost-domain.com",
"mattermost_port": 443,
"use_tls": true,
"auth_token": "your_access_token",
"channel_ids": [
  "channel_id_1",
  "channel_id_2"
],
"output_file": "out/messages.json",
"insecure_skip_tls_verify": false,
"log_level": "INFO"
}
services:
  mattermost-logger:
    image: ghcr.io/vfaergestad/mattermost-logger:latest
    container_name: mattermost-logger
    volumes:
      - ./config.json:/app/config.json
      - ./out:/app/out

I think I should update the readme with these suggestions instead.