profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/CubicrootXYZ/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Cubicroot CubicrootXYZ cubicroot.xyz Doing amazing stuff in the internet.

CubicrootXYZ/matrix-reminder-and-calendar-bot 2

A matrix bot that handles reminders and knows your agenda

CubicrootXYZ/Directory-Monitoring-Pushnotification 1

Notifies you via Pushover if there is a new file in a directory. Used to alert motion detected by motion eye.

CubicrootXYZ/PDF-Multiaddress 1

This tool takes a PDF DIN-Letter and inserts multiple addresses, so you never need to address all your letters by hand.

bahnpreise-info/mono 0

Preise im Bahnverkehr anschauen und vergleichen.

CubicrootXYZ/alertmanager_gotify_bridge 0

A bridge between Prometheus AlertManager and a Gotify server

CubicrootXYZ/Automate-Redmine 0

simple script to automate some routines in redmine

CubicrootXYZ/Bahnpreise-Analystics 0

Tools zum Analysieren der Daten von bahnpreise.info

CubicrootXYZ/Buspreise 0

Buspreise is a python library to check the prices from long-distance bus in germany and parts of the eu.

CubicrootXYZ/Cryptpad-Style 0

Style for Cryptpad

push eventCubicrootXYZ/matrix-reminder-and-calendar-bot

Cubicroot

commit sha c34ebdab2484cbb3b8c395ac07694cdab5b9a6e4

add docu template

view details

push time in 6 hours

push eventCubicrootXYZ/matrix-reminder-and-calendar-bot

Cubicroot

commit sha b743846fb23dd24722440a1b31154decaa39852c

Improve installation instructions

view details

push time in 6 hours

issue commentCubicrootXYZ/matrix-reminder-and-calendar-bot

Bug: User not removed after removing from config

This issue is resolved with v1.0.1

CubicrootXYZ

comment created time in 6 hours

issue closedCubicrootXYZ/matrix-reminder-and-calendar-bot

Bug: User not removed after removing from config

Description of the bug After removing a user from the config file it still is present in the application itself.

To Reproduce

  1. Add user to config file
  2. Write the bot => works
  3. Remove user from config file
  4. Write the bot => works

Expected behavior Bot does not answer the removed user

Additional context Removed users are not removed from the database.

closed time in 6 hours

CubicrootXYZ

issue closedCubicrootXYZ/matrix-reminder-and-calendar-bot

Bug: Reminders for deleted users still are tried to send

Description of the bug Reminders for deleted users still are tried to send out but fail as the room identifier is empty.

To Reproduce Steps to reproduce the behavior:

  1. Add user
  2. Add reminder for that user
  3. Remove user
  4. Reminder still gets send

Expected behavior Reminders from deleted users are never tried to send.

Additional context

Failed to send reminder XXX with: failed to PUT /_matrix/client/r0/rooms//send/m.room.message/YYY: M_FORBIDDEN (HTTP 403): Unknown room

closed time in 6 hours

CubicrootXYZ

issue commentCubicrootXYZ/matrix-reminder-and-calendar-bot

Bug: Reminders for deleted users still are tried to send

This issue is resolved with https://github.com/CubicrootXYZ/matrix-reminder-and-calendar-bot/releases/tag/1.0.1

CubicrootXYZ

comment created time in 6 hours

release CubicrootXYZ/matrix-reminder-and-calendar-bot

1.0.1

released time in 6 hours

created tagCubicrootXYZ/matrix-reminder-and-calendar-bot

tag1.0.1

A matrix bot that handles reminders and knows your agenda

created time in 6 hours

push eventCubicrootXYZ/matrix-reminder-and-calendar-bot

Cubicroot

commit sha 5a6ef43891282949918b221a8a6bf4e17d05a983

fix sql statement

view details

push time in 6 hours

push eventCubicrootXYZ/matrix-reminder-and-calendar-bot

Cubicroot

commit sha d23a08c7613ed6352f3e9f4a9ee57ceeac17afe5

handle deleted users

view details

push time in 7 hours

startedorganicmaps/organicmaps

started time in 7 hours

issue openedCubicrootXYZ/matrix-reminder-and-calendar-bot

Bug: Reminders for deleted users still are tried to send

Description of the bug Reminders for deleted users still are tried to send out but fail as the room identifier is empty.

To Reproduce Steps to reproduce the behavior:

  1. Add user
  2. Add reminder for that user
  3. Remove user
  4. Reminder still gets send

Expected behavior Reminders from deleted users are never tried to send.

Additional context

Failed to send reminder XXX with: failed to PUT /_matrix/client/r0/rooms//send/m.room.message/YYY: M_FORBIDDEN (HTTP 403): Unknown room

created time in 8 hours

issue commentCubicrootXYZ/matrix-reminder-and-calendar-bot

Bug: User not removed after removing from config

"Quick Fix" for everyone needing this now: remove the users manually by searching for them in the channels table.

CubicrootXYZ

comment created time in 8 hours

issue openedCubicrootXYZ/matrix-reminder-and-calendar-bot

Bug: User not removed after removing from config

Description of the bug After removing a user from the config file it still is present in the application itself.

To Reproduce

  1. Add user to config file
  2. Write the bot => works
  3. Remove user from config file
  4. Write the bot => works

Expected behavior Bot does not answer the removed user

Additional context Removed users are not removed from the database.

created time in 8 hours

issue commentCubicrootXYZ/matrix-reminder-and-calendar-bot

Feature: Provide a detailed description for Docker Installation

Hey, thanks for reaching out.

Generally the procedure to setting up the bot should be:

  1. Write a config file according to your needs (see the example config config.example.yml)
  2. Start the docker container with the config file mounted in /run/config.yml

If anything is missing or wrong in the settings the logs should tell you.

If you still encounter issues please provide the latest logs from the startup and your config file (with sensitive data removed).

There indeed is room for improvements in the installation instructions. Any suggestions are welcome.

kojid0

comment created time in 8 hours

issue closedCubicrootXYZ/matrix-reminder-and-calendar-bot

Feature: Provide a working bot which can be found+invited by username

Using this bot needs the hardware to install it on + knowledge how to install this. It is not very user friendly. Having a working bot installation that can be found and added to a room via search would be more user friendly.

closed time in 8 hours

kojid0

issue commentCubicrootXYZ/matrix-reminder-and-calendar-bot

Feature: Provide a working bot which can be found+invited by username

Hey,

thanks for your message. This bot currently needs manual adjustments in it's configuration file for each user it should interact with. I designed this as a security feature to not open an attack surface to read or write reminders from other users. The bots architecture is meant to be installed by each user separately.

I do currently not plan to change this behaviour. However I am always open for new features through a pull request.

Operate an open for everyone bot as a service will cost me additional time, resources and money to do so. I am not willing to invest this and be responsible for one single large bot instance where dozens or even hundreds of users depend on.

kojid0

comment created time in 8 hours

startedCodeWithSwastik/vscode-ext

started time in 2 days

Pull request review commentpushbits/server

Tests for /api

+package api++import (+	"encoding/json"+	"io/ioutil"+	"strconv"+	"testing"++	"github.com/pushbits/server/internal/model"+	"github.com/pushbits/server/tests"+	"github.com/stretchr/testify/assert"+)++func TestApi_CreateUser(t *testing.T) {+	assert := assert.New(t)++	testCases := make([]tests.Request, 0)++	// Add all test users+	for _, user := range TestUsers {+		createUser := &model.CreateUser{}+		createUser.ExternalUser.Name = user.Name+		createUser.ExternalUser.MatrixID = "@" + user.Name + ":matrix.org"+		createUser.ExternalUser.IsAdmin = user.IsAdmin+		createUser.UserCredentials.Password = TestConfig.Admin.Password++		testCase := tests.Request{+			Name:         "Already existing user " + user.Name,+			Method:       "POST",+			Endpoint:     "/user",+			Data:         createUser,+			Headers:      map[string]string{"Content-Type": "application/json"},+			ShouldStatus: 400,+		}+		testCases = append(testCases, testCase)++	}++	testCases = append(testCases, tests.Request{Name: "No data", Method: "POST", Endpoint: "/user", Data: "", ShouldStatus: 400})+	testCases = append(testCases, tests.Request{Name: "Missing data urlencoded", Method: "POST", Endpoint: "/user", Data: "name=superuser&id=1&lol=5", ShouldStatus: 400})+	testCases = append(testCases, tests.Request{Name: "Valid user urlencoded", Method: "POST", Endpoint: "/user", Data: "name=testuser1&matrix_id=%40testuser1%3Amatrix.org&is_admin=false&password=abcde", Headers: map[string]string{"Content-Type": "application/x-www-form-urlencoded"}, ShouldStatus: 200})+	testCases = append(testCases, tests.Request{Name: "Valid user JSON encoded", Method: "POST", Endpoint: "/user", Data: `{"name": "testuser2", "matrix_id": "@testuser2@matrix.org", "is_admin": true, "password": "cdefg"}`, Headers: map[string]string{"Content-Type": "application/json"}, ShouldStatus: 200})++	for _, req := range testCases {+		w, c, err := req.GetRequest()+		if err != nil {+			t.Fatalf(err.Error())+		}++		TestUserHandler.CreateUser(c)++		assert.Equalf(w.Code, req.ShouldStatus, "(Test case: \"%s\") should return status code %v but is %v.", req.Name, req.ShouldStatus, w.Code)+	}+}++func TestApi_GetUsers(t *testing.T) {+	assert := assert.New(t)++	request := tests.Request{+		Method:   "GET",+		Endpoint: "/user",+	}++	w, c, err := request.GetRequest()+	if err != nil {+		t.Fatalf((err.Error()))+	}++	TestUserHandler.GetUsers(c)+	assert.Equalf(w.Code, 200, "Response code should be 200 but is %d", w.Code)++	// Get users from body+	users := make([]model.ExternalUser, 0)+	usersRaw, err := ioutil.ReadAll(w.Body)+	assert.NoErrorf(err, "Failed to parse response body")+	err = json.Unmarshal(usersRaw, &users)+	assert.NoErrorf(err, "Can not unmarshal users")

Yes.

CubicrootXYZ

comment created time in 4 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentpushbits/server

Tests for /api

+package api++import (+	"encoding/json"+	"io/ioutil"+	"testing"++	"github.com/gin-gonic/gin"+	"github.com/pushbits/server/internal/model"+	"github.com/pushbits/server/tests"+	"github.com/stretchr/testify/assert"+)++func TestApi_CreateNotification(t *testing.T) {+	assert := assert.New(t)+	gin.SetMode(gin.TestMode)++	testApplication := model.Application{+		ID:       1,+		Token:    "123456",+		UserID:   1,+		Name:     "Test Application",+		MatrixID: "@testuser:test.de",+	}++	testCases := make([]tests.Request, 0)+	testCases = append(testCases, tests.Request{Name: "Valid with message", Method: "POST", Endpoint: "/message?token=123456&message=testmessage", ShouldStatus: 200, ShouldReturn: model.Notification{Message: "testmessage", Title: "Test Application"}})+	testCases = append(testCases, tests.Request{Name: "Valid with message and title", Method: "POST", Endpoint: "/message?token=123456&message=testmessage&title=abcdefghijklmnop", ShouldStatus: 200, ShouldReturn: model.Notification{Message: "testmessage", Title: "abcdefghijklmnop"}})+	testCases = append(testCases, tests.Request{Name: "Valid with message, title and priority", Method: "POST", Endpoint: "/message?token=123456&message=testmessage&title=abcdefghijklmnop&priority=3", ShouldStatus: 200, ShouldReturn: model.Notification{Message: "testmessage", Title: "abcdefghijklmnop", Priority: 3}})+	testCases = append(testCases, tests.Request{Name: "Invalid with wrong field message2", Method: "POST", Endpoint: "/message?token=123456&message2=testmessage", ShouldStatus: 400})+	testCases = append(testCases, tests.Request{Name: "No form data", Method: "POST", Endpoint: "/message", ShouldStatus: 400})++	for _, req := range testCases {+		var notification model.Notification+		w, c, err := req.GetRequest()+		if err != nil {+			t.Fatalf(err.Error())+		}++		c.Set("app", &testApplication)+		TestNotificationHandler.CreateNotification(c)++		// Parse body only for successful requests+		if req.ShouldStatus >= 200 && req.ShouldStatus < 300 {+			body, err := ioutil.ReadAll(w.Body)+			assert.NoErrorf(err, "Can not read request body")+			if err != nil {+				continue+			}+			err = json.Unmarshal(body, &notification)+			assert.NoErrorf(err, "Can not unmarshal request body")+			if err != nil {+				continue+			}++			shouldNotification, ok := req.ShouldReturn.(model.Notification)+			assert.Truef(ok, "(Test case %s) Type mismatch can not test further", req.Name)++			assert.Greaterf(len(notification.ID), 1, "(Test case %s) Notification id is not set correctly with \"%s\"", req.Name, notification.ID)++			assert.Equalf(shouldNotification.Message, notification.Message, "(Test case %s) Notification message should be %s but is %s", req.Name, shouldNotification.Message, notification.Message)+			assert.Equalf(shouldNotification.Title, notification.Title, "(Test case %s) Notification title should be %s but is %s", req.Name, shouldNotification.Title, notification.Title)+			assert.Equalf(shouldNotification.Priority, notification.Priority, "(Test case %s) Notification priority should be %s but is %s", req.Name, shouldNotification.Priority, notification.Priority)+		}++		assert.Equalf(w.Code, req.ShouldStatus, "(Test case: \"%s\") should return status code %v but is %v.", req.Name, req.ShouldStatus, w.Code)+	}++}++func TestApi_DeleteNotification(t *testing.T) {+	assert := assert.New(t)+	gin.SetMode(gin.TestMode)++	testApplication := model.Application{+		ID:       1,+		Token:    "123456",+		UserID:   1,+		Name:     "Test Application",+		MatrixID: "@testuser:test.de",+	}++	testCases := make(map[interface{}]tests.Request)+	testCases["1"] = tests.Request{Name: "Valid numeric string", Method: "DELETE", Endpoint: "/message?token=123456&message=testmessage", ShouldStatus: 200}+	testCases["abcde"] = tests.Request{Name: "Valid string", Method: "DELETE", Endpoint: "/message?token=123456&message=testmessage", ShouldStatus: 200}+	testCases[123456] = tests.Request{Name: "Valid int", Method: "DELETE", Endpoint: "/message?token=123456&message=testmessage", ShouldStatus: 200}++	for id, req := range testCases {+		w, c, err := req.GetRequest()+		if err != nil {+			t.Fatalf(err.Error())+		}++		c.Set("app", &testApplication)+		c.Set("messageid", id)+		TestNotificationHandler.CreateNotification(c)

Yes. Changed that.

CubicrootXYZ

comment created time in 4 days

Pull request review commentpushbits/server

Tests for /api

+package api++import (+	"encoding/json"+	"io/ioutil"+	"strconv"+	"testing"++	"github.com/pushbits/server/internal/model"+	"github.com/pushbits/server/tests"+	"github.com/stretchr/testify/assert"+)++func TestApi_CreateUser(t *testing.T) {+	assert := assert.New(t)++	testCases := make([]tests.Request, 0)++	// Add all test users+	for _, user := range TestUsers {+		createUser := &model.CreateUser{}+		createUser.ExternalUser.Name = user.Name+		createUser.ExternalUser.MatrixID = "@" + user.Name + ":matrix.org"+		createUser.ExternalUser.IsAdmin = user.IsAdmin+		createUser.UserCredentials.Password = TestConfig.Admin.Password++		testCase := tests.Request{+			Name:         "Already existing user " + user.Name,+			Method:       "POST",+			Endpoint:     "/user",+			Data:         createUser,+			Headers:      map[string]string{"Content-Type": "application/json"},+			ShouldStatus: 400,+		}+		testCases = append(testCases, testCase)++	}++	testCases = append(testCases, tests.Request{Name: "No data", Method: "POST", Endpoint: "/user", Data: "", ShouldStatus: 400})+	testCases = append(testCases, tests.Request{Name: "Missing data urlencoded", Method: "POST", Endpoint: "/user", Data: "name=superuser&id=1&lol=5", ShouldStatus: 400})+	testCases = append(testCases, tests.Request{Name: "Valid user urlencoded", Method: "POST", Endpoint: "/user", Data: "name=testuser1&matrix_id=%40testuser1%3Amatrix.org&is_admin=false&password=abcde", Headers: map[string]string{"Content-Type": "application/x-www-form-urlencoded"}, ShouldStatus: 200})+	testCases = append(testCases, tests.Request{Name: "Valid user JSON encoded", Method: "POST", Endpoint: "/user", Data: `{"name": "testuser2", "matrix_id": "@testuser2@matrix.org", "is_admin": true, "password": "cdefg"}`, Headers: map[string]string{"Content-Type": "application/json"}, ShouldStatus: 200})++	for _, req := range testCases {+		w, c, err := req.GetRequest()+		if err != nil {+			t.Fatalf(err.Error())+		}++		TestUserHandler.CreateUser(c)++		assert.Equalf(w.Code, req.ShouldStatus, "(Test case: \"%s\") should return status code %v but is %v.", req.Name, req.ShouldStatus, w.Code)+	}+}++func TestApi_GetUsers(t *testing.T) {+	assert := assert.New(t)++	request := tests.Request{+		Method:   "GET",+		Endpoint: "/user",+	}++	w, c, err := request.GetRequest()+	if err != nil {+		t.Fatalf((err.Error()))+	}++	TestUserHandler.GetUsers(c)+	assert.Equalf(w.Code, 200, "Response code should be 200 but is %d", w.Code)++	// Get users from body+	users := make([]model.ExternalUser, 0)+	usersRaw, err := ioutil.ReadAll(w.Body)+	assert.NoErrorf(err, "Failed to parse response body")+	err = json.Unmarshal(usersRaw, &users)+	assert.NoErrorf(err, "Can not unmarshal users")

good catch, did not think about such cases. I went through all tests and corrected it to require where needed.

CubicrootXYZ

comment created time in 4 days

PullRequestReviewEvent

push eventCubicrootXYZ/pushbits-server

Cubicroot

commit sha 125e9ddd532589039300d004eeb1901f59901019

use require to stop failing tests

view details

push time in 4 days

startedgolangci/golangci-lint

started time in 4 days

startedfzipp/gocyclo

started time in 4 days

pull request commentpushbits/server

Support additional authentication methods - Oauth

We should add ~state~ and challenge parameters to further secure the authentication and add a config option to restrict the redirect url.

Edit: state is already implemented - challenge not. Redirects are bound to the given redirect url in the config => enable multiple clients for multiple redirect urls.

Implemented multiple clients as the clients are restricted to the redirect url that is given in the config file. With this I also came across the issue that clients were not deleted in the database when removing from the config file. This is solved now too.

CubicrootXYZ

comment created time in 7 days

push eventCubicrootXYZ/pushbits-server

Cubicroot

commit sha bed622ee2766a2f4a068ce762998768df66adafa

allow multiple oauth clients

view details

push time in 7 days