From 54c832592d6cef0ce56d15c871040693e9cd0234 Mon Sep 17 00:00:00 2001 From: Jess Robinson Date: Sat, 28 May 2022 13:09:35 +0100 Subject: [PATCH 1/2] Update README / example config for current state + bot --- README.md | 43 +++++++++++++++++++++++++++++++---- accesssystem_api.conf.example | 16 +++++++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3a17b59..48d64e2 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ Technologies * Barclayscrape - Pull current transactions from a Barclays bank account +* Telegram::Bot::Brain - A Mojo based module to create a Telegram bot. + INSTALL ------- @@ -52,26 +54,59 @@ INSTALL * Checkout this git repo, cd into the repo directory. -* Install dependencies for this system: carton install --cached +* Install dependencies for this system: carton install --deployment + +CONFIGURATION +------------- + +Create a file *accesssystem_api.conf*, using *accesssystem_api.conf.example* as a template. This is an Apache style config file. + +Main things to add/edit: +* dsn, user, password - Database connection string, see (https://metacpan.org/pod/DBI)[DBI docs] for details. +* cc - for emails, add yours here for testing emails (else they are CC'd to info@swindon-makerspace.org) +* namespace - if running this not in a / path, add the proxied path here +* OneAll - logins for the /profile etc pages, details from your oneall account RUN --- -This respository contains two pieces of software, the first is a thin layer over (https://metacpan.org/pod/RapidApp)[RadpiApp]. To run this, use the script: +This respository contains two main pieces of software, the first is a thin layer over (https://metacpan.org/pod/RapidApp)[RadpiApp]. To run this, use the script: -carton exec perl script/accesssystem_server.pl --port 3001 +CATALYST_HOME=$PWD carton exec perl script/accesssystem_server.pl --port 3001 Which will start a service on http://localhost:3001/admin To run the API, use the script: -carton exec perl script/accesssystem_api_server.pl --port 3000 +CATALYST_HOME=$PWD carton exec perl script/accesssystem_api_server.pl --port 3000 Which will start a service on http://localhost:3000/ NB: There is no index page on the API server, see below for details +Telegram bot +------------ + +To run the telegram bot, you will need to contact @BotFather on telegram and setup your own test bot, it will give you an API key. + +The bot does not require Catalyst or RapidApp, it does require two config files: + +* accesssystem_api.conf - the Model::AccessDB section +* keys.conf - create a keys.conf with the following: + + + api + + +Currently the bot requires a patch/branch of the Telegram::Bot::Brain code, checkout (or clone and checkout) the following repository/branch: + +git clone git@github.com:castaway/Telegram-Bot.git +cd Telegram-Bot +git checkout castaway/implement_callback_queries + +To run: BOT_HOME=$PWD carton exec perl -I /lib script/access_telegram.pl + API/UI ------ diff --git a/accesssystem_api.conf.example b/accesssystem_api.conf.example index 921a1b1..b59e6ff 100644 --- a/accesssystem_api.conf.example +++ b/accesssystem_api.conf.example @@ -1,11 +1,27 @@ dsn dbi:SQLite:db/test.db + # dsn dbi:Pg:database=mydb;host=localhost;port=1234 + # user XXX + # password YYY site_key 6LdHZx0TAAAAAMuUdG-NScgCCbJ_HMyL1bdeM9vp secret_key 6LdHZx0TAAAAAEAnQyttqqhDkEVXfUcsnDLPGmvi + + cc fred@bloggs.com + + + namespace accesssystem + + + subdomain + domain .api.oneall.com + public_key + private_key + callback_url /accesssystem/oneall_login_callback + From d3a4664a7a5ff2d9cb6aa686bfd96826dbd5fca4 Mon Sep 17 00:00:00 2001 From: Jess Robinson Date: Sun, 29 May 2022 12:28:32 +0100 Subject: [PATCH 2/2] Latest notes update --- NOTES.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/NOTES.txt b/NOTES.txt index 081f9de..733ee43 100644 --- a/NOTES.txt +++ b/NOTES.txt @@ -1,3 +1,46 @@ +*.05.2022: + +Telegram bot: + +* added commands for listing/creating inductions +* added commands for balance / paying for snacks etc + +TODO: +* Make /inductions list own inductions +* Use https://core.telegram.org/bots/api#forcereply to prompt for missing args (especially useful if command run from botfather prompt list) +* Add "inductors " (summary if no arg?) +* Make everything cope somehow with no args? + + +24.03.2022: + +Sendinblue / accesssystem: + +* Make sendinblue newsletter signup form? - https://help.sendinblue.com/hc/en-us/articles/360019485320 +* Import/link back to accesssystem!? (aka upgrade from subscriber to member) +* Export members from accessystem to sendinblue, when make changes, pay, sign up etc! + +* subscribe/ unsubscribe using topics (aka not from entire thing): +** unsub page (links to sub page) +https://help.sendinblue.com/hc/en-us/articles/208772629 + +* create one contact list per "topic" + +* ALL members (past/present/paying or not) now in "All People" +** to make sub lists https://help.sendinblue.com/hc/en-us/articles/208771609 + +04.09.2021: + +Rob McK + yearly payments + +1) patch that checks if balance >= year (dues+12+0.1), if so set payment amount to that, and expiry date to one year's time +2) create transaction/payment as before but with diff amount/time + +recalculate (after change to transactions+payments): +Rob paid 270 (year) in Dec 2019, so should have gotten date of Dec 2020, then another year in May 2020 (in 2 sep payments, accidentally) + +Adjusted to end Jan 2022 + 13.07.2018: