Simple CLI App for creating recurring google calendar events

Kronus

A CLI App to help you stay in touch with the people that matter by leveraging the google calender API. You can create touchbase events for contacts in any group, up to a Max of 7 contacts.

The application is a tool to generate recurring google calender events for each of your contacts,
to remind you to reach out and see how they are doing :)

Usage:
  kronus [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  touchbase   Deletes all exisiting events and creates new ones based on configs

Flags:
      --config string   config file (default is $HOME/.kronus.yaml)
  -h, --help            help for kronus
  -t, --toggle          Help message for toggle

How to use it

  • To install, run:
    go get -u github.com/Daskott/kronus
    
  • In terminal run kronus touchbase --group=family to create re-curring event on google calendar
    • Supported touchbase flags include:
      Flags:
        -c, --count int          How many times you want to touchbase with members of a group (default 4)
        -f, --freq int           How often you want to touchbase i.e. 0 - weekly, 1 - bi-weekly, or 2 - monthly (default 1)
        -g, --group string       Group to create touchbase events for
        -h, --help               help for touchbase
        -t, --time-slot string   Time slot in the day allocated for touching base (default "18:00-18:30")
      

Configuration

The config file is created in $HOME/.kronus.yaml if you've run the App at least once.

You can also create the config file manually in the default path if you choose. Or a new path & tell kronus where to find it using the --config flag.

Update config to include your timezone, contacts & groups.

env: production
settings:
  # Update the timezone to match yours e.g.
  # America/New_York
  # America/Vancouver
  # America/Los_Angeles
  # Go to http://www.timezoneconverter.com/cgi-bin/findzone to see others.
  timezone: "America/Toronto"
  
  # Leave as is, to avoid unexpected behaviour. 
  touchbase-recurrence: "RRULE:FREQ=WEEKLY;"

# Here you update your contact list with their names.
# e.g.
contacts:
  - name: Smally
  - name: Dad

# Here you add the different groups you'd like to have for your
# contacts. And populate each group with 
# each contact's id(i.e. index of their record in contacts)
# e.g. 
groups:
  friends:
    - 0
    - 1
  family:
    - 0

# This section is automatically updated by the CLI App to manage
# events created by kronus
events:

Development

  • Checkout repo:
    git clone https://github.com/Daskott/kronus.git
    
  • To run rootCmd:
    go run main.go
    
  • To run touchbaseCmd:
    go run main.go touchbase
    
  • To run tests:
    go test ./...
    

Todo:

  • Write tests
  • Add support for --version flag
  • Ability to change event title
  • Add flag to make deletion of previous events optional
  • Support import of contacts from google csv
  • Ability to set client_id & client_secret via CLI
  • Ability to add/update contacts via CLI
  • Ability to add/update contacts via CLI
  • Ability to configure start date of touchbase events
  • List events via CLI
Owner
Comments
  • Add ability to create probe via sms

    Add ability to create probe via sms

    Resolves #13 This PR does the following:

    • Adds EnqueueIn & PerformIn functions to workerPool to add the ability to set dynamic probes
    • Added support for probe & help command via sms
    • Cleaned up sms handler for webhook
    • Added & updated tests
  • Add tests for probeScheduler

    Add tests for probeScheduler

    Resolves #24

    This includes:

    • Tests for the whole probeScheduler.ScheduleProbes() workflow:
      • It tests that initial probes are scheduled & triggered
      • It tests that followup/emergency probes are also scheduled & triggered if necessary
    • Refactors
      • NewProbeScheduler now accepts followProbesCronSchedule - to set how often the followup probe task is run
      • NewWorkerAdapter now accepts useCronParserWithSeconds - to determine wether or not to accept cron expressions with 6(with seconds)/ 5 fields.
      • Use queue not stack for processing jobs
    • Other
      • Better error handling for scheduling user probes
      • Remove --test flag
  • Replace unique constraint with user email & phone_number unique indexes

    Replace unique constraint with user email & phone_number unique indexes

    Resolves #9. Allow different users to have the same contact record in their contacts, but prevent duplicate contact email/phone_number within the same user contacts list.

    The added indexes i.e idx_user_id_email & idx_user_id_phone_number also make it more efficient to query for user contacts.

  • Release version 0.3.4

    Release version 0.3.4

    What the release should contain

    • [x] https://github.com/Daskott/kronus/issues/8
    • [x] https://github.com/Daskott/kronus/issues/9
    • [x] https://github.com/Daskott/kronus/issues/10
    • [x] https://github.com/Daskott/kronus/issues/18
    • [x] https://github.com/Daskott/kronus/issues/20
    • [x] https://github.com/Daskott/kronus/issues/21
    • [x] Increase version of pkg & publish
  • Add initial tests for server

    Add initial tests for server

    Start with probeScheduler

    TODO:

    • --test mode should use in:memory db for test
    • Test that ScheduleProbes:
      • Loads crons for probes where users have their probe_settings set to active
      • Loads crons for probe followups i.e. ENQUEUE_FOLLOWUP_PROBES_HANDLER
    • Test that the probes are executed when they are suppose to be ?
      • Perhaps this should not be a probeScheduler test, but a wokerPool test ?
  • Fix dev mode failure to create db directory for server

    Fix dev mode failure to create db directory for server

    Screen Shot 2022-01-01 at 1 03 46 PM

    This is probably the culprit > https://github.com/Daskott/kronus/blob/main/server/helpers.go#L234-L257. Folder is not created, if it doesn't exist in dev mode

  • Ability to create probe via sms

    Ability to create probe via sms

    A user can text the server something like:

    probe 15m

    And a probe will sent to the user in 15m, with 0 retries. Can be done through scheduled jobs.

    TODO:

    • user.probe_settings should have max_retries & wait_time_in_minutes(i.e. time to wait for a reply after which the probe is retried or is marked as unavailable)
    • When creating a probe use the users user.probe_settings to set max_retries & wait_time_in_minutes - they should also be fields in probe.
    • Add scheduledAt column to jobs table.
    • When user sends sms command, create a job added to the scheduled queue & set scheduledAt(i.e. when the job should be run)
    • Create a new worker that only pulls jobs from the scheduled queue & move them to the enqueued queue if scheduledAt <= time.Now()
    • The scheduled job should have ["probe_max_retries"] arg set to 0. So after the user's dynamic probe triggers, if they don't reply, immediately mark as unavailable & contact emergency contact.

    Enhancement:

    • Move this logic into a database query: https://github.com/Daskott/kronus/blob/14355ab79354d04d9125192aa7e4e627f634b893/server/pbscheduler/pbscheduler.go#L126-L138

    Note:

    • Perhaps multiple retries & shorter wait times for dynamic probes
    • The ability to do this via text should be deprecated at some point, but the feature can still be used in a diff interface
  • Add/Update endpoints for kronus server

    Add/Update endpoints for kronus server

    • [x] POST /users - return user_id/info on user creation
    • [x] Return 400 for bad request(e.g db errors like duplicate data or failed constraints) instead of 500
    • [x] GET /probes - should work without status filter
    • [x] GET /jobs - should work without status filter
    • [x] Support Pagination on all endpoints that require it
    • [x] GET /users/{id}/probes
    • [x] API versioing
    • [x] Update docs accordingly
  • Multiple people should be able to have the same contacts

    Multiple people should be able to have the same contacts

    Right now, email & phone_number column in contacts model is set to unique. This shouldn't be the case.

    • Option 1: Replace the constraints with user_id_phone_number & user_id_email
    • Option 2: Just remove the constraints
  • Add server

    Add server

    What does this PR do ?

    This PR adds a new cmd - server. Which adds "liveliness probe" (i.e. the service does routine checks with users to validate that they're okay & if not send a msg to their emergency contact) as a functionality.

    How was this accomplished ?

    • Add job worker to schedule & process jobs
    • Add support for encrypted sqlite db to store all generated data
    • Add google storage API to backup sqliteDB
    • Add twilio API to send probe messages
    • Add REST API endpoints to interact with resources i.e. users , contacts, probe_settings etc.
  • Enable use of service accounts & code cleanup

    Enable use of service accounts & code cleanup

    This PR contains:

    • Update to switch auth from oauth2 to service accounts
    • Add dev and test flag to have separate configs for each mode
    • Add Makefile to help with test & release process
  • Ability to add personal notes for recipients

    Ability to add personal notes for recipients

    User can add multiple notes. Each note has a trigger e.g. Send note to emergency contact after 1hour/30days of being unavailable.

    Use cases:

    • Send personal note to loved ones - doesn't contain any secrets
    • Share encrypted content(for which the recipient has the key) - which could have passwords etc
    • The note can contain information on what to do if user is no longer available 😢

    Investigation

    • Look into storing public key pair for users to handle encryption of personal messages ?
      • The server can store the public key & then make the user download the private key. I.e emergency contacts will need to have key pair generated for them. And the message will be encrypted using the recipients public key.
      • The author of the message will also have a copy encrypted with their public key so they can update the message whenever they want.
  • Support extensions for different types of probe messages

    Support extensions for different types of probe messages

    Note

    • Add extension_id to probe_settings where extensions could be none, joke, bible verse etc.
    • If extension is enabled, based on extension, get text & send back to user.

    E.g. joke - you get a joke with your probe, or custom-questions - you get a custom puzzle, if solved correctly, that means you're okay, math - get a random math problem each time to check if you're okay

  • Add location information for users to kronus server

    Add location information for users to kronus server

    Send link with probe, to get user location via browser & store location for each probe

    Benefits:

    • Simple

    Problems:

    • Information is not realtime
    • Requires very frequent probes to make information more useful
    • User experience is not great

    Constraints:

    • With the use of links, no need to receive Y/N response. Clicking on the link indicates you're okay & sends your location. However, we need to still be able to send Y/N response, for cases where the user has no internet or doesn't want to send location info.

    Questions:

    • Should the link have Y/N option ? Or should clicking the link prove you're okay ?

    Todo:

    • Move entire probe verification to web app. User gets' notified with link & they click to verify aliveness
    • Given the current constraints, make it as user friendly as possible.
      • Ask user on web_page to include location co-ordinates

    Later:

    • We could have a mobile app that auto transmits location on each probe
CLI and web app to convert HTML markup to go-app.dev's syntax.
CLI and web app to convert HTML markup to go-app.dev's syntax.

HTML to go-app Converter CLI and web app to convert HTML markup to go-app.dev's syntax. Installation CLI Static binaries are also available on GitHub

Dec 18, 2022
Simple CLI tool for creating gotd sessions.

Simple CLI tool for creating gotd sessions.

Sep 29, 2022
eksctl is a simple CLI tool for creating clusters on EKS
eksctl is a simple CLI tool for creating clusters on EKS

eksctl is a simple CLI tool for creating clusters on EKS - Amazon's new managed Kubernetes service for EC2. It is written in Go, and uses CloudFormation.

Jan 7, 2023
Creating a simple CLI tool in the Go Programming Language for personal learning and fun

Creating a simple CLI tool in the Go Programming Language for personal learning and fun Open to feedback :) Build docker dev environment docker build

Dec 12, 2021
GC2 is a Command and Control application that allows an attacker to execute commands on the target machine using Google Sheet and exfiltrate data using Google Drive.
GC2 is a Command and Control application that allows an attacker to execute commands on the target machine using Google Sheet and exfiltrate data using Google Drive.

GC2 GC2 (Google Command and Control) is a Command and Control application that allows an attacker to execute commands on the target machine using Goog

Dec 13, 2022
minectl 🗺 is a cli for creating Minecraft (java or bedrock) server on different cloud provider.

minectl ?? minectl️️ is a cli for creating Minecraft (java or bedrock) server on different cloud provider. It is a private side project of me, to lear

Jan 3, 2023
Interactive CLI helper for creating git branches with JIRA Links and some text

bb (better-branch) Interactive CLI helper for creating git branches with JIRA Links and some text Still in development? Yes How it works? This tiny ut

Aug 18, 2022
Dev-spaces - A CLI to help creating development environments using AWS Spot Instances

This is a CLI to help creating on-demand development spaces using EC2 Spot Intances.

Nov 9, 2022
simple cli app for search and watch anime

simple terminal app for search and watch movie or anime

Oct 30, 2021
A simple CLI app to update dynamic DNS settings for your CloudFlare account

Cloudflare Dynamic DNS Updater (Go) written by Darren Rambaud Why? A simple CLI app to update dynamic DNS settings for your CloudFlare account. Useful

Nov 28, 2021
A simple CLI app to take notes daily on markdown file
A simple CLI app to take notes daily on markdown file

A simple CLI app to take notes daily on markdown file

Jul 29, 2022
Go-ticket-booking-app - Simple CLI application which books tickets for a Go conference made to learn the fundamentals of Go programming language.

go-ticket-booking-app Simple CLI application which books ticket for a Go conference made to learn the fundamentals of Go programming language. Gorouti

Jan 2, 2022
Test-app-url-shortner - A sample url shortener app to test Keploy integration capabilities
Test-app-url-shortner - A sample url shortener app to test Keploy integration capabilities

test-app-url-shortner A sample url shortener app to test Keploy integration capa

Jan 23, 2022
Go-cent-app - CENT.APP GO Package

CENT.APP - GO Package Official documentation - https://cent.app/en/merchant/api

Dec 20, 2022
Go pkg and cli tool to sign Google Maps API URLs

gmapsign gmapsign is a Go pkg and cli tool to sign Google Maps API request URLs. This is required when using: A client ID with the web service APIs, M

Jul 4, 2022
A CLI tool which loads data from yaml files into the Google Cloud Spanner tables

splanter A CLI tool which loads data from yaml files into the Google Cloud Spanner tables (mainly for the development).

Oct 27, 2022
Google KMS backed Solana key management CLI tool

solana-kms solana-kms is a Google KMS backed Solana token management CLI utility. The main purpose of the tool is to ensure that the private key is ne

Jan 13, 2022
News-parser-cli - Simple CLI which allows you to receive news depending on the parameters passed to it
News-parser-cli - Simple CLI which allows you to receive news depending on the parameters passed to it

news-parser-cli Simple CLI which allows you to receive news depending on the par

Jan 4, 2022