8go / 8go/matrix-eno-bot

Docker container is stuck at "Performing initial database setup..."

Đang mở
#33 12 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Shell
Star
101
Fork
17
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Running on debian bullseye amd64. When I start the container via "docker compose up" after building it I get this message over and over

```
matrix-eno-bot | 2022-10-07 17:31:20,115 | storage [INFO] Performing initial database setup...
matrix-eno-bot exited with code 1
```

Below are my configs:

commands.yaml

```
#
# ***** Initialization *****
# This is an example command dictionary configuration. Mind you, this is an
# example configuration meant to convey the structure of the configuration
# file. It will probably not work as is in your environment.
# So, copy this file to "commands.yaml". Then modify and adjust
# "commands.yaml" to suit your needs. E.g. On Linux you would do

# $ cp commands.yaml.example commands.yaml
# $ nano commands.yaml # adjust to your needs, especially the paths!

# ***** Paths *****

# The bot needs to find your commands. For that the bot uses the PATH
# variable. By adjusting the "paths" values below you can add additional
# paths to the system PATH variable. If the bot is using commands that
# are not already on the system PATH, you must add the additional command
# paths below.
# Furthermore, make sure the bot has read and execute access
# to the commands, otherwise they won't work.
# Here we show two example command paths. Adjust them as needed.
paths:
- /home/minnix/.local/lib/matrix-eno-bot/eno/scripts
- /home/minnix/.local/etc/matrix-eno-bot/bin

# ***** Commands *****

# Commands are a list of specifications for your bot commands.
# The children of the "commands" key are the command names.
# Command names are nick names like "alert" or "backup".
# Each command, listed by its name, has the following
# keys (or properties):
#
# cmd: string: name of the command, executable, or script.
# The bot will attempt to execute this command when
# triggered. The bot will call this "cmd" and pass
# the given arguments to it.
# Example: "date" (a command provided by the OS)
# help: string: help string explaining the command.
# This is useful when you forget how use the command.
# The help string provided will be listed and shown with
# the 'help' command of the bot.
# Example: "returns the current date of the server"
# regex: string: regex pattern whose matches are valid ways to call the
# command.
# If a bot message matches a regular expression, then the
# corresponding command will be executed.
# If a bot message matched multiple regular expressions,
# only the first matching command will be executed!
# It is recommended that the regular expressions are used
# such that they are mutually exclusive to avoid
# situation where one messages matches multiple regular
# expressions.
# When the "regex" matches the "cmd" will be triggered.
# Example: "^date$" (only the exact string of "date"
# will match)
# markdown_convert: true or false: Specifies whether the message reply has
# been formatted in markdown.
# The bot will convert this markdown-formatted input
# and convert it into an HTML-like format understood by
# Matrix, so that the bot reply shows up visually as
# nice as the markdown input.
# Defaults to true.
# Example: Your command output is a markdown formatted
# string such as "I *really* like it!" Set
# markdown_convert to true and the receiver gets the
# text "I really like it!" with the word "really"
# visually in italic. In short, use "true", whenever
# your command output is a markdown-formatted string;
# false otherwise.
# formatted: true or false: Specifies whether message reply will
# be sent as a formatted message.
# Defaults to true.
# code: true or false: Specifies whether message reply will
# be formatted as a code block with fixed-size font.
# If set to "true", "markdown_convert" will be ignored.
# Defaults to false.
# split: string: if this string is set, splits the message reply
# into multiple messages wherever the string specified in
# split occurs.
# Defaults to None, no message splitting by default.
# Example: "\n\n\n" (Wherever the command output contains
# two empty lines, the output will be split. Each piece
# will be sent as a separate reply message.
commands:

# There are 3 kinds of commands.
# a) built-in commands
# b) pre-packed commands provided by the matrix-eno-bot repo
# c) your custom commands that you can add
# To add your custom commands go to the end of file, you will
# find a "Custom commands" header there. Add them there.

# Built-in commands
# ---------------
# help : "help" is a reserved word, so don't use it as a custom command!
# reload : "reload" is a reserved word, so don't use it as a custom command!

# Pre-packed commands provided by the matrix-eno-bot repo
# -------------------------------------------------------

# alert if too many resources are used, best to use with cron
alert:
regex: "alert$|^alert .*$|^alarm$|^alarm .*|^alert.sh$"
cmd: alert.sh
help: shows if any CPU, RAM, or disk thresholds have been exceeded
markdown_convert: false
formatted: true
code: true
# perform a backup to disk
backup:
regex: "^backup$|^backup .*$|^backup.sh$"
cmd: backup.sh
help: performs backup on server
markdown_convert: false
formatted: true
code: true
# get BTC ticker
btc:
regex: "^btc$|^btc .*$|^bitcoin$|^btc.sh$"
cmd: btc.sh
help: gives Bitcoin BTC price info
markdown_convert: false
formatted: true
code: true
# get cheatsheets, see https://github.com/cheat/cheat
cheatsheet:
regex: "^cheat$|^cheatsheet$|^chuleta$|^cheat.sh$|^cheat .*$|^cheatsheet .*$|^chuleta .*$|^cheat.sh .*$"
cmd: cheat
help: get cheatsheets, see https://github.com/cheat/cheat
markdown_convert: false
formatted: true
code: true
# check status and look for updates
# see also: upgrade
check:
regex: "^check$|^chk$|^status$|^state$|^check .*$|^chk .*|^status .*$|^state .*$|^check.sh$|^check.sh .*"
cmd: check.sh
help: check status, health status, updates, etc.
markdown_convert: false
formatted: true
code: false
# CPU temperature, to monitor the CPU temperatures
cputemp:
regex: "^cpu$|^temp$|^temperature$|^celsius$|^cputemp.*$|^hot$|^chaud$"
cmd: cputemp.sh
help: give the current CPU temperatures
markdown_convert: false
formatted: true
code: false
# get date and time
datetime:
regex: "^date$|^time$|^tiempo$|^hora$|^temps$|^heure$|^heures$|^datum$|^zeit$|^datetime.sh$"
cmd: datetime.sh
help: give current date and time of server
markdown_convert: false
formatted: true
code: true
# duckduckgo
ddg:
regex: "^ddg$|^ddg .*$|^duck$|^duck .*$|^duckduckgo$|^duckduckgo .*$|^search$|^search .*|^ddg.sh$|^ddg.sh .*"
cmd: ddg.sh
help: search the web with DuckDuckGo search
markdown_convert: false
formatted: true
code: false
# disk space, monitor disk space
disks:
regex: "^disks$|^disk$|^full$|^space$|^disks.sh$"
cmd: disks.sh
help: see how full your disks or mountpoints are
markdown_convert: false
formatted: true
code: true
# echo, trivial example to have the bot respond
echo:
regex: "^echo$|^echo .*"
cmd: echo.py
help: bot echoes back your input
markdown_convert: false
formatted: true
code: false
# get ETH ticker
eth:
regex: "^eth$|^eth .*$|^ethereum$|^eth.sh$"
cmd: eth.sh
help: gives Ethereum price info
markdown_convert: false
formatted: true
code: true
# get firewall settings
firewall:
regex: "^firewall$|^fw$|^firewall .*$|^firewall.sh$"
cmd: firewall.sh
help: list the firewall settings and configuration
markdown_convert: false
formatted: true
code: true
# get a compliment, hello
hello:
regex: "^salut$|^ciao$|^hallo$|^hi$|^servus$|^hola$|^hello$|^hello .*$|^bonjour$|^bonne nuit$|^hello.sh$"
cmd: hello.sh
help: gives you a friendly compliment
markdown_convert: false
formatted: true
code: false
# Hacker News
hn:
regex: "^hn$|^hn .*$|^hn.sh$|^hn.sh .*"
cmd: hn.sh
help: read Hacker News, fetches front page headlines from Hacker News
markdown_convert: false
formatted: true
code: false
# Messari News
mn:
regex: "^mn$|^mn .*$|^mn.sh$|^mn.sh .*"
cmd: mn.sh
help: read Messari News, fetches the latest news articles from Messari
markdown_convert: false
formatted: true
code: false
split: "\n\n\n"
# message of the day
motd:
regex: "^motd|^motd .*|^motd.sh$"
cmd: motd.sh
help: gives you the Linux Message Of The Day
# platform info
platforminfo:
regex: "^platform$|^platform .*|^platforminfo.py$"
cmd: platforminfo.py
help: give hardware and operating system platform information
# ps, host status
ps:
regex: "^ps$|^ps .*|^ps.sh$"
cmd: ps.sh
help: print current CPU, RAM and Disk utilization of server
markdown_convert: false
formatted: true
code: true
# restart, reset
restart:
regex: "^restart$|^reset$|^restart .*$|^reset .*$|^restart.sh$|^restart.sh .*"
cmd: restart.sh
help: restart the bot itself, or Matrix services
markdown_convert: false
formatted: true
code: false
# RSS
rss:
regex: "^rss$|^feed$|^rss .*$|^feed .*$|^rss.sh$|^rss.sh .*"
cmd: rss.sh
help: read RSS feeds
markdown_convert: false
formatted: true
code: false
split: "\n\n\n"
# Stock-to-flow
s2f:
regex: "^s2f$|^mys2f.py.*|^flow$|^s2f|^flow .*$|^s2f .$|^s-to-f$|^stock-to-flow .*$|^eyf$|^eyf .*$|^e-y-f$"
cmd: s2f.sh
help: give Stock-to-flow info
markdown_convert: false
formatted: true
code: true
# tides
tides:
regex: "^tide$|^tides$|^marea|^mareas|^tide .*$|^tides .*$|^marea .*$|^mareas .*$|^gehzeiten .*$|^tides.sh$|^tides.sh .*"
cmd: tides.sh
help: give tidal forecast
markdown_convert: false
formatted: true
code: false
# top CPU, MEM consumers
top:
regex: "^top$|^top .*|^top.sh$|^top.sh .*"
cmd: top.sh
help: list 5 top CPU and RAM consuming processes
markdown_convert: false
formatted: true
code: true
# get TOTP 2FA pin
totp:
regex: "^otp$|^totp$|^otp .*$|^totp .*$"
cmd: totp.sh
help: get 2FA Two-factor-authentication TOTP PIN via bot message
markdown_convert: false
formatted: true
code: false
# twitter
twitter:
regex: "^tweet$|^twitter$|^tweet .*$|^twitter .*$|^twitter.sh$|^twitter.sh .*"
cmd: twitter.sh
help: read latest user tweets from Twitter
markdown_convert: false
formatted: true
code: false
# update components
update:
regex: "^update$|^upgrade$|^update .*$|^upgrade .*$|^update.sh$|^update.sh .*"
cmd: update.sh
help: update operating sytem
markdown_convert: false
formatted: true
code: false
# list matrix users by issuing a REST API query
users:
regex: "^usr$|^user$|^users$|^users .*$|^users.sh$"
cmd: users.sh
help: list registered Matrix users
markdown_convert: false
formatted: true
code: true
# wake up PC via wake-on-LAN
wake:
regex: "^wake$|^wakeup$|^wake .*$|^wakeup .*$|^wakelan .*$|^wake.sh$|^wake .*"
cmd: wake.sh
help: wake up another PC via LAN
markdown_convert: false
formatted: true
code: false
# waves and surf conditions
# see also: tides
waves:
regex: "^wave$|^waves$|^wave .*$|^waves .*$|^surf$|^surf .*$|^waves.sh$"
cmd: waves.sh
help: give waves and surf forecast
markdown_convert: false
formatted: true
code: true
# get weather forecast
weather:
regex: "^weather$|^tiempo$|^wetter$|^temps$|^weather .*$|^tiempo .*$|^eltiempo .*$|^wetter .*$|^temps .*$|^weather.sh$|^weather.sh .*"
cmd: weather.sh
help: give weather forecast
markdown_convert: false
formatted: true
code: true
# fetch web pages
web:
regex: "^www$|^web$|^web .*$|^www .*$|^browse$|^browse .*|^web.sh$|^web.sh .*"
cmd: web.sh
help: surf the web, get a web page (JavaScript pages not supported)
markdown_convert: false
formatted: true
code: false
# whoami
whoami:
regex: "^w$|^who$|^whoami$"
cmd: whoami.py
help: return information about the user, whose unix account is running the bot
markdown_convert: false
formatted: true
code: false

# Custom commands
# ---------------

# add your custom commands here

# End of commands configuration file

```

config.yaml

```
# Welcome to the sample config file
# Below you will find various config sections and options
# Default values are shown

# The string to prefix messages with to talk to the bot in group chats
# Changed from original "!c" to "1z! because on cell phone "!c" seems too
# complicated.
command_prefix: "1z"

# Options for connecting to the bot's Matrix account
matrix:
# The Matrix User ID of the bot account
user_id: "@lugbot:minnix.dev"
# Matrix account password
user_password: ""

# Matrix account access token
# To create a new Matrix device for the bot, use and set the `user_password`
# field. Once the device exists, you can optionally replace the
# `user_password` with the `access_token` field. Using the `access_token`
# field is slightly safer as it does not expose the password of the bot
# account. You can use only one or the other: either use the `user_password`
# or the `access_token` field. You can find the access token in the Matrix
# client where you have registered the bot account or you can find it in
# the bot log file. If the logging options are set accordingly the access
# token will be logged to the bot log file.
# Default: commented out
# access_token: "PutYourLongAccessTokenHere"

# The URL of the homeserver to connect to
homeserver_url: https://matrix.minnix.dev
# The device ID that is **non pre-existing** device
# If this device ID already exists, messages will be dropped
# silently in encrypted rooms
device_id: lugbot_serverid
# What to name the device? Often referred to as device name or display name.
device_name: lugbot
# Should the bot trust all the devices of its own Matrix account?
# Default: false
# If false, nothing is done. After login, no device will be automatically
# trusted.
# If true, once at startup, after logging in, the bot device will
# automatically establish trust to all other devices of the bot account.
trust_own_devices: false
# Do you want to change the device_name of the already existing bot?
# Default: false
# If false, nothing is done. After creation, device_name will be ignored.
# If true, device_name of bot will be changed to value given in device_name.
change_device_name: false
# encrytion is enabled by default

storage:
# The path to the database
database_filepath: "bot.db"
# The path to a directory for internal bot storage
# containing encryption keys, sync tokens, etc.
store_filepath: "./store"
# The path to the command dictionary configuration file
command_dict_filepath: "./commands.yaml"

# Logging setup
logging:
# Logging level
# Allowed levels are 'INFO', 'WARNING', 'ERROR', 'DEBUG'
# where DEBUG is most verbose
level: INFO
# Configure logging to a file
file_logging:
# Whether logging to a file is enabled
enabled: false
# The path to the file to log to. May be relative or absolute
filepath: bot.log
# Configure logging to the console output
console_logging:
# Whether logging to the console is enabled
enabled: true

```

docker-compose.yaml

```
version: '3'

services:
matrix-eno-bot:
container_name: matrix-eno-bot
image: 'matrix-eno-bot:latest'
build: '.'
restart: always
volumes:
- /home/minnix/lugbot/matrix-eno-bot/config.yaml:/bot/config.yaml
- /home/minnix/lugbot/matrix-eno-bot/commands.yaml:/bot/commands.yaml
- /home/minnix/lugbot/matrix-eno-bot/bot.db:/bot/bot.db
- /home/minnix/lugbot/matrix-eno-bot/store/:/bot/store/
stop_signal: SIGINT
```

Any help would be appreciated thanks.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.