The technology & security foundations of PiCockpit

I was asked to elaborate a bit about the security & technology foundations of PiCockpit. The parts which are involved PiCockpit consists of several parts: picockpit-client picockpit-frontend picockpit-backend picockpit-api (“papi”) the database the MQTT server the picockpit Package repository The MQTT server Data between the picockpit-frontend and picockpit-client is exchanged using the MQTT server (called…

Weiterlesen

How to set unique object ids in embedded documents across a MongoDB collection

MongoDB’s updateMany can be used to update all documents which are matched. Problem If, however, you want to set unique new ObjectIDs in your update, you would find that MongoDB sets the same ObjectID for every entry: db.getCollection(‘mypis_collectedpis’).updateMany({}, {$set:      {apps: {         “com.picockpit/core”: {             meta: {                 version: “2.0”,                 name: “PiCockpit Core”,                 image: “”,                 description: “PiCockpit.com…

Weiterlesen

mongo_orm Exception: missing bson key: publish_acl (Exception)

When you extend your field definitions in the mongo_orm document classes, specifically with embedded documents, you might run into the following runtime (!) error: Exception: missing bson key: <name> (Exception) This is not an error in your code – your code is raising, because the database structure is not as it expects it to be!…

Weiterlesen

mongo_orm custom name for collection

mongo_orm will automatically determine the name for your collection by using the Module and Class name, and appending an “s”. In cases where you want to name your collection, you can simply do this: class PapiTest < Mongo::ORM::Document     collection_name “Buster”     field test : String end get “/” do     pt = PapiTest.new     pt.test = “I want…

Weiterlesen