# README
- Marrano BOT
A marrano bot
** Usage
#+BEGIN_SRC 2024/01/10 17:19:18 INFO starting marrano-bot version=0.10.0 Usage of ./marrano-bot: -c, --config string bot configuration path (default "./marrano-bot.toml") -D, --dump dump configuration object -E, --export export database data as csv (defaults to stdout) --export-dir string folder to write database exported data csv files -h, --help this message -I, --init initialize the database -v, --verbose set verbose output #+END_SRC
** Options
#+BEGIN_SRC toml database = "marrano-bot.sqlite" port = 6446
[telegram] name = "marrano-bot" token = "123456789-bot" domain = "bot.marrani.lol" #+END_SRC
**** config.toml
databasethe database filenameportport to listen to (the web server listens to loopback, hardcoded)telegram.namecolloquial name of the bot, update only when updating the subscriptiontelegram.tokentelegram bot token secrettelegram.domaindomain name to register for webhooks
**** envars
DATABASEenvar can be used to override the config optiondatabaseTELEGRAM_TOKENenvar can be used to override the config optiontelegram.token
** Building
This project is using [[https://clojure.org/reference/deps_and_cli][clj]] to manage it's dependencies and build process:
#+BEGIN_SRC
go build
-tags "sqlite_foreign_keys"
-v ./cmd/marrano-bot
#+END_SRC
Or using the makefile
#+BEGIN_SRC make #+END_SRC
Or building the nix derivation producing ./results/bin/marrano-bot
#+BEGIN_SRC nix build .#default #+END_SRC
** NixOS flake usage
flake outputs: #+BEGIN_SRC ├───checks │ ├───aarch64-linux │ │ ├───editorconfig: derivation 'check-editorconfig' │ │ ├───formatting: derivation 'check-formatting' │ │ └───packages-default: derivation 'marrano-bot' │ └───x86_64-linux │ ├───editorconfig: derivation 'check-editorconfig' │ ├───formatting: derivation 'check-formatting' │ └───packages-default: derivation 'marrano-bot' ├───devShells │ ├───aarch64-linux │ │ └───default: development environment 'nix-shell' │ └───x86_64-linux │ └───default: development environment 'nix-shell' ├───formatter │ ├───aarch64-linux: package 'formatter' │ └───x86_64-linux: package 'formatter' ├───nixosModules │ └───default: NixOS module ├───overlays │ └───default: Nixpkgs overlay └───packages ├───aarch64-linux │ └───default: package 'marrano-bot' └───x86_64-linux └───default: package 'marrano-bot' #+END_SRC
#+BEGIN_SRC nix { description = "my flake";
outputs = { nixpkgs, marrano-bot, ... }: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; overlays = [ ]; }; in { nixosConfigurations.my-machine = pkgs.lib.nixosSystem { inherit system; modules = [ inputs.ragenix.nixosModules.default inputs.marrano-bot.nixosModules.default ./configuration.nix ];
age.secrets.marrano-bot.file = ./secrets/marrano-bot.age;
services.marrano-bot = {
enable = true;
hostName = "bot.example-bot-farm.lol";
logLevel = "debug";
};
};
};
inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; ragenix.url = "github:yaxitech/ragenix"; ragenix.inputs.nixpkgs.follows = "nixpkgs"; marrano-bot.url = "github:moolite/bot"; marrano-bot.inputs.nixpkgs.follows = "nixpkgs"; }; } #+END_SRC
- License
Copyright © 2023 Lorenzo Giuliani
Release under MPL-2.0, see attached [[LICENSE]] file.