daylightingsociety / deadmanswitch Goto Github PK
View Code? Open in Web Editor NEWdead man's switch implemented in electron
dead man's switch implemented in electron
rn we're using ethereal.email, and we should actually send emails.
that means we need an smtp server to connect to. we can use a gmail, but it'll get shut down as a bot.
we can ask each user to make an account, but gmail takes too long to sign up for.
this is really a question of finding an smtp provider that suits our needs, and until we have that, or a solution that circumvents that, we can't move forward with this.
there's code in index.js to do this with the old gui, but we have to hook it back up to the right divs (#12) and make sure it works with bootstrap
rn we don't actually have a key part of our functionality, which is canceling the sending of an email.
documentation on how to do this is given here
as with a lot of our issues, this is two parts. one is the backend js, one is the frontend. i think this will require new structure on both sides. we should display to the user emails which they have queued, and allow them to cancel them. that means new gui stuff (maybe a tab or something?). backend shouldn't be too bad, just a new object or two with some accompany methods i think. regardless, this should probably be done after the other issues, as it adds a lot of new stuff.
we should be able to use the user's computer as an smtp client and send it from there instead of hooking into some other provider like gmail.
i think nodemailer's smtp-connection would be the best choice in this case.
it would be useful for development to load credentials from a file on the local machine.
it could be done with a plain json file, or maybe as an object that's included somehow? i'm not too sure which is easier with javascript.
riseup is a cool tech collective that offers easy smtp access. ideally, we'll direct the user to their page and the user will register an account. then they'll select riseup from the dropdown of smtp providers, enter their credentials/config, and off they go.
this is mainly just telling the user about riseup, but we'll need to add the same kind of stuff as #7
i think it would be good to add little pop-up tooltips next to fields to give a little info. stuff like the from field is what we use to sign in to your chosen provider (unless it's custom, in which case we provide a username).
this would also be a good way to inform users about mail.com and easy smtp setup. maybe a tooltip on the dropdown? all of this info should be in the documentation, too.
we'll need a better gui if this is gonna be usable. that's mainly html/css.
it's gonna expand as we add functionality, so the most useful contribution rn would be a framework or overall design direction that presents what we currently have (time/date, email info) in some cohesive manner. then we can just extend it from there in the same spirit.
we could also use any of a number of frameworks, which is probably the easier/better way to do it.
easy way is to use bootstrap or something, hard way is to write the css yourself.
nodemailer supports the sendmail() utility, letting a user send smtp from their own pc/ip.
to add support for this we need to setup new config options and some user control
we'll send the setting of x provider vs sendmail over ipc from the render process
we should let users enter a domain name/IP address + port for their own smtp servers.
this is similar to #7, but instead of using a dropdown and selecting between preset configs for the transporter object, we're gonna need to send the info over ipc to the main process like the email text etc.
the <input type="datetime-local">
is easy to implement, but unintuitive and ugly.
a better way is to have text inputs or dropdowns or some nice looking easy thing
that will be css and html, and a little bit of javascript to send the new info to the main process.
the new gui broke our javascript, so we have to hook it all back up with getElementById or querySelector
nodemailer hooks right into an smtp server, so we should have a dropdown or something that fills out server info for common providers. smtp.gmail.com is an example.
this is gonna be adding some html and js to the front end, as well as moving stuff around in main.js to configure the transporter object with info passed over IPC, instead of defaulting to ethereal with a global transporter object like what we're currently doing.
it would be better to have one channel and one callback, as opposed to adding new channels and listeners for every new object we're trying to send.
probably just add a 'type' field to the object you're sending from the renderer and that do logic on the other end to call the appropriate function.
maybe even take advantage of javascript being dumb and do the thing where you can call strings as functions! bc why not
rn all the default configs are sitting in index.js and it makes it less readable.
we should move them to a separate file (it could just be json, or maybe js and use export or smth).
we need to make sure to only trigger the backend js if all the forms are filled out. rn we should just check that they're all filled out.
bootstrap can do this when paired with js in the browser. in fact, the template i used had this by default but i pulled it out.
it disappears when you change the provider in the dropdown, but it should be hidden on load.
this should be done with a jquery solution
rn the form is going red and giving the user information correctly, but we're still sending an object to the main process. i need to prevent that for meaningful validation.
rn when an email fails for any reason, the app crashes. we need error handling to prevent this. rn i think it's fine to just print info to the console, but once we have a gui we'll want to give that info to the user.
rn we're sending the Date object over ipc but the app will need a full gui
to implement this you need to add some html and write some code in index.js and main.js
just add a few fields and a new ipcRenderer/ipcMain listener
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.