This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Piorjade's profile picture

doorOS3.0 [NOW WITH WINDOWS!; multitasking OS, appmanager, etc.]

Started by Piorjade, 03 June 2016 - 12:23 PM
Piorjade #1
Posted 03 June 2016 - 02:23 PM
doorOS3.0 (worst name ik..)

So basically I wanted to jump on that mainstream train and remake my shitty OS for the third time..
Please don't criticize this too hard, I know on my own that this is pretty bad (?).

Functions:
  • Basic multitasking (start an app and exit out with the delete key. If you press the Launch/Start/WhateverLanguageYouAreOn button again it will resume the last session. <— NOT ANYMORE: This system now uses windows, which are freely moveable/resizeable and minimizeable! (BTW minimized programs should continue running in the background just fine, tested with Firewolf and Shell!)
  • Taskmanager/ThatLittleTButtonAtTheBottomOfTheStartMenu (lists all suspended coroutines or all paused processes in short. Gives ability to kill process or resume it (like if you would just press the Run-button again))
  • Languages (languagefiles are stored in /doorOS/languages/ and are easy to make/to translate, literally just write the stuff written on the left in your language (yes, the files are just tables containing strings, which the OS calls))
  • Encrypted password storing (after "registering" your account, the program writes everything into a file, while the password is additionally encrypted with the EncryptionAPI) (btw… the key to decrypt your password is stored on my pastebin account, which means you have to always have a internet connection to properly login < now uses SHA-256 (look at the changelog for the pastebin link)
  • Software management (remove and install apps (you are only able to install apps, which are compiled with my MSIMaker )
Information on windows:
  • To move a window: drag the window with the M button on the top left
  • To resize a window: drag the bottom right corner of the window
  • Toolbar:
  • red = close
  • green = maximize
  • orange = minimize (still runs in the background (look at the taskmanager to open it again or to completely close it))
Code:
Look at this fancy GitHub Site :P/>



Missing Features:
  • (easy) installation of programs (you have to move your program to /doorOS/apps/MYAPP.app/PROGRAMRENAMEDTOSTARTUP) <– Added software management :)/>
  • additional program to make a project/program and compile it to a installer when finished (I'm looking at you, MSI-Maker)
  • QuestBrowser (by oeed) ONLY works if you put the "quest"-file to "/" and make a startupfile at "/doorOS/apps/whatever.app/startup", which redirects to "/quest" (shell.run("/quest")) – That's actually not my fault, try to download Quest, put it in a folder (not /) and try to run it…. It doesn't work for me atleast

Planned Features:
  • Homemade filebrowser (bruh this can't be that hard :)/> )
  • Shell as an app (is literally just one damn line :rolleyes:/> )
  • Settings
  • Maybe finally a shutdown and restart button ? :)/>
  • JUST A THOUGHT: maybe TRY to implement real windows, like in LiquidOS? (I mean I have some ideas (I won't look at other codes, because I really want to LEARN stuff) that could work…) Lol done :D/>
Changelog:

Spoiler
  • Updated passwordencryption (now uses SHA-256, idea by Luca_S (thx btw)), which means you should now not be able to decrypt it
  • Added Shell as app
  • Added shutdown and reboot button (to the top right corner)
  • Added Settings ("S" button to the right of the "T" button in the start menu)
  • Ability to change the username, password and wallpaper (by using NPaint btw)
  • Fixed crashing bug with the searchbar
  • Added Software manager (you are now able to remove installed apps and install apps by entering the path to the program, which MUST be compiled with my MSIMaker. It will automatically detect wether it's really a installable program or not and install it.)
  • Reworked whole app-starting system: Now uses windows!
  • Windows features: moveable, resizeable, quick switching between them (just click on another), minimizing (yes they should be able to run in the background), maximum size: 49x16 (for some apps sad, I will think of adding a fullscreen feature someday… but I'm lazy so this could need some time)
  • Edited the installer: it asks if you want to start the OS at boot or not… If not: it creates a file named "bootDoorOS" in "/" for you to easy start the OS up.


Bugs:

Spoiler
  • Critical: When having more than 1 task and deleting one on the list, every task under it gets deleted and launching other tasks causes the OS to break out of the loop (when I try to use table.remove() it just returns: os.lua: 209: table expected, got nil; I would really love it if someone helped me with that ^^ <——– FIXED :)/>

How to download: (and install automatically)
(Wow you actually want to test this? Thx :P/>)
pastebin run pfiSmK3K

Screenshots are attached… INFO: THESE MAY BE (VERY) OUTDATED!
Luca_S #2
Posted 03 June 2016 - 03:47 PM
Awesome UI, but your security is REALLY bad. How to access system:

1. Start computer up
2. Hold CTRL + T until it says "terminated"
3. Enter "lua"
4. Enter "usrData.Password"
5. Remember the output
6. Reboot
7. Log in with password

Conclusion: Make all variables you don't need to be global local and prevent termination.

If you would do above, you could still read out the password the following way:

1. Use a disk with empty startup
2. Insert into computer
3. Reboot/Start
4. Enter "lua" again
5. Enter the following lines:

os.loadAPI("/doorOS/API/encrypt")
a = fs.open("/doorOS/sys/usrData","r")
b = textutils.unserialize(a.readAll())
a.close()
c = b.Password
d = encrypt.decrypt(c,"z!8*-#9AMwn[[jZNkG}24&amp;[SXX")
d
And you got the password again.

Conclusion: Don't encrypt passwords, hash them! If you want an hashing algorithm that is good for this job, my friend Anavrins created one: http://www.computercraft.info/forums2/index.php?/topic/8169-sha-256-in-pure-lua/page__st__40__p__246117#entry246117

Hashing is one way, so you can't get the password back from the hash. For your purpose this would be the best:


os.laodAPI("hash")
local password = hash.digest(usrInput)
if password == storedPassword then
  --correct
else
  --incorrect
end
Before storing the password you would ofc apply hash.digest to it. But even more secure would be hashing with salt. So you just store a random string(Should be unique for each user, just use string.char(math.random(string.byte("A"),string.byte("z"))) a few times and combine these) and then append that salt to the password everytime you hash it.

I am happy to help you if you don't know how to implement it.
Piorjade #3
Posted 04 June 2016 - 11:08 PM
Wow I'm really happy to see someone who is interested in this / gives me feedback :)/>
Yes I know that the security is really bad, I already knew that it is that easy to get the password, but I also thought: "Hey if people WOULD use this on a server and they don't know LUA that well, they wouldn't know how to decrypt that".

But after I saw your reply I think of updating some things in this project :P/>

Thank you :)/>

Funfact: I tried to mix the UI of Windows with the UI of Ubuntu (cuz I love Linux :D/> )
Edited on 04 June 2016 - 09:10 PM
TheRockettek #4
Posted 26 June 2016 - 06:29 PM
but I also thought: "Hey if people WOULD use this on a server and they don't know LUA that well, they wouldn't know how to decrypt that".

Hint: if theres a server with computercraft on it, there will be a bunch of poeple who know how to use lua and common sence ;)/>
Piorjade #5
Posted 27 June 2016 - 06:47 PM
Yeah that's propably true but I think there are people who download CC to their server for their friends and install easy-to-use OSs (e.g. OneOS) just for fun :)/> Though I already replaced that with hashing :)/>

EDIT:

UPDATE:
  • Fixed critical bugs
  • Added software management (in the settings) (you are now able to remove installed apps and install apps by entering the path to the program, which MUST be compiled with my MSIMaker. It will automatically detect wether it's really a installable program or not and install it.)
Edited on 01 July 2016 - 04:38 PM
Piorjade #6
Posted 10 August 2016 - 12:16 AM
And here I am, back at it again with this motivation!

UPDATE:
  • Reworked whole app-starting system: Now uses windows!
  • Windows features: moveable, resizeable, quick switching between them (just click on another), minimizing (yes they should be able to run in the background), maximum size: 49x16 (for some apps sad, I will think of adding a fullscreen feature someday… but I'm lazy so this could need some time)
DoganLark #7
Posted 10 August 2016 - 12:09 PM
An installer would make this OS way better.
KingofGamesYami #8
Posted 10 August 2016 - 04:58 PM
An installer would make this OS way better.
How to download:
(Wow you actually want to test this? Thx :P/>/>)
pastebin run pfiSmK3K
Piorjade #9
Posted 10 August 2016 - 05:12 PM
Thanks for pointing that out to him :P/>

EDIT: Pointed the fact that the pastebin link is an installer a bit out.. :)/>
Edited on 10 August 2016 - 03:13 PM
Piorjade #10
Posted 10 August 2016 - 05:22 PM
Minor Update:
  • Edited the installer: it asks if you want to start the OS at boot or not… If not: it creates a file named "bootDoorOS" in "/" for you to easy start the OS up.
DoganLark #11
Posted 10 August 2016 - 05:38 PM
An installer would make this OS way better.
How to download:
(Wow you actually want to test this? Thx :P/>/>)
pastebin run pfiSmK3K
derp