From 76a3313654fb52093605338327b39b440b2e0d92 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Sun, 21 May 2017 01:42:41 -0400 Subject: [PATCH] web running os --- sys/apps/.overview/Appstore | 8 -- sys/apps/.overview/Events | 8 -- sys/apps/.overview/Files | 8 -- sys/apps/.overview/Help | 8 -- sys/apps/.overview/Lua | 8 -- sys/apps/.overview/Network | 9 -- sys/apps/.overview/Peripherals | 8 -- sys/apps/.overview/Script | 9 -- sys/apps/.overview/System | 8 -- sys/apps/.overview/Tabs | 8 -- sys/apps/.overview/Turtles | 5 - sys/apps/.overview/adventure | 8 -- sys/apps/.overview/builder | 8 -- sys/apps/.overview/dj | 8 -- sys/apps/.overview/falling | 8 -- sys/apps/.overview/reboot | 8 -- sys/apps/.overview/recorder | 8 -- sys/apps/.overview/redirection | 8 -- sys/apps/.overview/shell | 8 -- sys/apps/.overview/shutdown | 8 -- sys/apps/.overview/simpleMiner | 8 -- sys/apps/.overview/storageActivity | 8 -- sys/apps/.overview/storageManager | 8 -- sys/apps/.overview/telnet | 8 -- sys/apps/.overview/update | 8 -- sys/apps/.overview/vnc | 8 -- sys/apps/.overview/worm | 8 -- sys/apps/Overview.lua | 20 ++- sys/etc/app.db | 217 +++++++++++++++++++++++++++++ sys/extensions/vfs.lua | 1 - sys/services/network.lua | 2 +- 31 files changed, 231 insertions(+), 224 deletions(-) delete mode 100644 sys/apps/.overview/Appstore delete mode 100644 sys/apps/.overview/Events delete mode 100644 sys/apps/.overview/Files delete mode 100644 sys/apps/.overview/Help delete mode 100644 sys/apps/.overview/Lua delete mode 100644 sys/apps/.overview/Network delete mode 100644 sys/apps/.overview/Peripherals delete mode 100644 sys/apps/.overview/Script delete mode 100644 sys/apps/.overview/System delete mode 100644 sys/apps/.overview/Tabs delete mode 100644 sys/apps/.overview/Turtles delete mode 100644 sys/apps/.overview/adventure delete mode 100644 sys/apps/.overview/builder delete mode 100644 sys/apps/.overview/dj delete mode 100644 sys/apps/.overview/falling delete mode 100644 sys/apps/.overview/reboot delete mode 100644 sys/apps/.overview/recorder delete mode 100644 sys/apps/.overview/redirection delete mode 100644 sys/apps/.overview/shell delete mode 100644 sys/apps/.overview/shutdown delete mode 100644 sys/apps/.overview/simpleMiner delete mode 100644 sys/apps/.overview/storageActivity delete mode 100644 sys/apps/.overview/storageManager delete mode 100644 sys/apps/.overview/telnet delete mode 100644 sys/apps/.overview/update delete mode 100644 sys/apps/.overview/vnc delete mode 100644 sys/apps/.overview/worm create mode 100644 sys/etc/app.db diff --git a/sys/apps/.overview/Appstore b/sys/apps/.overview/Appstore deleted file mode 100644 index 50a97af..0000000 --- a/sys/apps/.overview/Appstore +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\030 \0310=\0300 \030 XX\0300\031f \030 \ -\030 \031f \0300 \030 \ -\030 \031f \0310o \031f \0310o\031f ", - category = "System", - title = "AppStore", - run = "Appstore.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/Events b/sys/apps/.overview/Events deleted file mode 100644 index 4ed5516..0000000 --- a/sys/apps/.overview/Events +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0304\031f \030 \0311e\ -\030f\031f \0304 \030 \0311ee\031f \ -\030f\031f \0304 \030 \0311e\031f ", - title = "Events", - category = "System", - run = "Events.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/Files b/sys/apps/.overview/Files deleted file mode 100644 index 1ed1777..0000000 --- a/sys/apps/.overview/Files +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0300\0317==\031 \0307 \ -\0300\0317====\ -\0300\0317====", - title = "Files", - category = "Apps", - run = "Files.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/Help b/sys/apps/.overview/Help deleted file mode 100644 index 6a779d2..0000000 --- a/sys/apps/.overview/Help +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = " \031d?\031 \ -\031d?\031 \ - \031d?", - title = "Help", - category = "Apps", - run = "Help.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/Lua b/sys/apps/.overview/Lua deleted file mode 100644 index 6edfd2b..0000000 --- a/sys/apps/.overview/Lua +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\030f \ -\030f\0310lua>\031 \ -\030f ", - title = "Lua", - category = "Apps", - run = "Lua.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/Network b/sys/apps/.overview/Network deleted file mode 100644 index 0aeb7d5..0000000 --- a/sys/apps/.overview/Network +++ /dev/null @@ -1,9 +0,0 @@ -{ - title = "Network", - category = "Apps", - requires = "wireless_modem", - icon = "\0304 \030 \ -\030f \0304 \0307 \030 \031 \031f)\ -\030f \0304 \0307 \030 \031f)", - run = "Network.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/Peripherals b/sys/apps/.overview/Peripherals deleted file mode 100644 index 094ae6f..0000000 --- a/sys/apps/.overview/Peripherals +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0304 \030 \ -\030f \0304 \0307 \030 \031 \031f_\ -\030f \0304 \0307 \030 \031f/", - title = "Devices", - category = "System", - run = "Peripherals.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/Script b/sys/apps/.overview/Script deleted file mode 100644 index cda05e4..0000000 --- a/sys/apps/.overview/Script +++ /dev/null @@ -1,9 +0,0 @@ -{ - title = "Scripts", - category = "Apps", - requires = "wireless_modem", - icon = "\0300\0317if\031 \0307 \ -\0300\0317turt\ -\0300\0317retu", - run = "Script.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/System b/sys/apps/.overview/System deleted file mode 100644 index b374e8a..0000000 --- a/sys/apps/.overview/System +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = " \0307\031f| \ -\0307\031f---o\030 \031 \ - \0307\031f| ", - title = "System", - category = "System", - run = "System.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/Tabs b/sys/apps/.overview/Tabs deleted file mode 100644 index fcba0c7..0000000 --- a/sys/apps/.overview/Tabs +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0307 \0303\0317__\0307\031 \ -\0303 \ -\0303 ", - title = "Tabs", - category = "System", - run = "Tabs.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/Turtles b/sys/apps/.overview/Turtles deleted file mode 100644 index 61363a6..0000000 --- a/sys/apps/.overview/Turtles +++ /dev/null @@ -1,5 +0,0 @@ -{ - category = "Apps", - title = "Turtles", - run = "Turtles.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/adventure b/sys/apps/.overview/adventure deleted file mode 100644 index f09b1d6..0000000 --- a/sys/apps/.overview/adventure +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\030f\0310You \031 \ -\030f\0310Ther\030 \031 \ -\030f\0314?\031f \031 \030 ", - title = "Adventure", - category = "Games", - run = "rom/programs/fun/adventure", -} \ No newline at end of file diff --git a/sys/apps/.overview/builder b/sys/apps/.overview/builder deleted file mode 100644 index 60b73d8..0000000 --- a/sys/apps/.overview/builder +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0317_____\ -\030e\031c###\0308\0317=\030e\031c#\ -\030e\031c#\0307\031f.\030e\031c###", - title = "Builder", - category = "Apps", - run = "builder.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/dj b/sys/apps/.overview/dj deleted file mode 100644 index 5a4a7a8..0000000 --- a/sys/apps/.overview/dj +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = " \030f \ -\030f \0307 \ -\030f \0307 \0300 ", - title = "DJ", - category = "Games", - run = "/rom/programs/fun/dj", -} \ No newline at end of file diff --git a/sys/apps/.overview/falling b/sys/apps/.overview/falling deleted file mode 100644 index 72524eb..0000000 --- a/sys/apps/.overview/falling +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\030f \0302 \ -\0309 \0302 \0301 \ -\030e \0309 \0301 ", - title = "Falling", - category = "Games", - run = "rom/programs/pocket/falling", -} \ No newline at end of file diff --git a/sys/apps/.overview/reboot b/sys/apps/.overview/reboot deleted file mode 100644 index 4ef508b..0000000 --- a/sys/apps/.overview/reboot +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0304\031f \030f\0310o..\0304\031f \ -\0304\031f \030f\0310.o.\0304\031f \ -\0304\031f - ", - title = "Reboot", - category = "System", - run = "rom/programs/reboot", -} \ No newline at end of file diff --git a/sys/apps/.overview/recorder b/sys/apps/.overview/recorder deleted file mode 100644 index d995c52..0000000 --- a/sys/apps/.overview/recorder +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\030 \031f \031b \031foo \ -\030 \031f \030e\031b \030 \031f/\ -\030 \031b \030e \030 \031f\\", - category = "Apps", - title = "Recorder", - run = "recorder.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/redirection b/sys/apps/.overview/redirection deleted file mode 100644 index dc30296..0000000 --- a/sys/apps/.overview/redirection +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0307 \0308 \0307 \ -\0308\031b> \030b\0310>\0308\0318 \ -\0307 ", - title = "Redirection", - category = "Games", - run = "rom/programs/fun/advanced/redirection", -} \ No newline at end of file diff --git a/sys/apps/.overview/shell b/sys/apps/.overview/shell deleted file mode 100644 index fff1b7a..0000000 --- a/sys/apps/.overview/shell +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0304 \030 \ -\0304 \030f\0314> \0310_\031 \ -\0304 \030f \030 ", - title = "Shell", - category = "Apps", - run = "shell", -} \ No newline at end of file diff --git a/sys/apps/.overview/shutdown b/sys/apps/.overview/shutdown deleted file mode 100644 index 9d873b3..0000000 --- a/sys/apps/.overview/shutdown +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0304\031f \ -\0304\031f \030f\0310zz\031 \ -\0304\031f \030f ", - title = "Shutdown", - category = "System", - run = "/rom/programs/shutdown", -} \ No newline at end of file diff --git a/sys/apps/.overview/simpleMiner b/sys/apps/.overview/simpleMiner deleted file mode 100644 index 0c0282d..0000000 --- a/sys/apps/.overview/simpleMiner +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = " \0315\\\030 \031 \ - \0304\031f _ \030 \031c/\0315\\\ - \0304 ", - title = "Miner", - category = "Apps", - run = "simpleMiner.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/storageActivity b/sys/apps/.overview/storageActivity deleted file mode 100644 index f603440..0000000 --- a/sys/apps/.overview/storageActivity +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0318/\030f\031 \030 \0318\\\ -\030f \0308\0319o\030f\031 \ -\0318\\\030f\031 \030 \0318/", - title = "Activity", - category = "Apps", - run = "storageActivity.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/storageManager b/sys/apps/.overview/storageManager deleted file mode 100644 index d58a28e..0000000 --- a/sys/apps/.overview/storageManager +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0307 \ -\0307 \0308\0311 \0305 \0308\031 \0307 \0308 \0301 \ -\0307 ", - title = "Storage", - category = "Apps", - run = "storageManager.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/telnet b/sys/apps/.overview/telnet deleted file mode 100644 index f84dd46..0000000 --- a/sys/apps/.overview/telnet +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = " \0314>\0310_\ - \031f)))\031 \ -\0314>\0310_\031 ", - title = "Telnet", - category = "Apps", - run = "telnet.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/update b/sys/apps/.overview/update deleted file mode 100644 index cdd9fab..0000000 --- a/sys/apps/.overview/update +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\0301\03171\03180\030 \031 \ -\0301\03181\030 \031 \ -\0301\03170\03180\03171\0307\031f>", - title = "Update", - category = "System", - run = "update.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/vnc b/sys/apps/.overview/vnc deleted file mode 100644 index 0250402..0000000 --- a/sys/apps/.overview/vnc +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\ -\031e\\\031 \031e/\031dn\ - \031e\\/\031 \0319c", - title = "VNC", - category = "Apps", - run = "vnc.lua", -} \ No newline at end of file diff --git a/sys/apps/.overview/worm b/sys/apps/.overview/worm deleted file mode 100644 index 408793e..0000000 --- a/sys/apps/.overview/worm +++ /dev/null @@ -1,8 +0,0 @@ -{ - icon = "\030d \030 \030e \030 \ -\030d \030 \ -\030d ", - title = "Worm", - category = "Games", - run = "/rom/programs/fun/worm", -} \ No newline at end of file diff --git a/sys/apps/Overview.lua b/sys/apps/Overview.lua index abfc9cf..117f635 100644 --- a/sys/apps/Overview.lua +++ b/sys/apps/Overview.lua @@ -7,6 +7,9 @@ local NFT = require('nft') local class = require('class') local FileUI = require('fileui') local Tween = require('tween') +local SHA1 = require('sha1') + +local REGISTRY_DIR = 'usr/.registry' multishell.setTitle(multishell.getCurrent(), 'Overview') UI:configure('Overview', ...) @@ -20,13 +23,16 @@ Config.load('Overview', config) local applications = { } local function loadApplications() - Util.clear(applications) - local apps = fs.list('sys/apps/.overview') - for _,app in pairs(apps) do - local data = Util.readTable('sys/apps/.overview/' .. app) - if data then - data.filename = 'sys/apps/.overview/' .. app - table.insert(applications, data) + applications = Util.readTable('sys/etc/app.db') + + if fs.exists(REGISTRY_DIR) then + local files = fs.list(REGISTRY_DIR) + for _,file in pairs(files) do + local app = Util.readTable(fs.combine(REGISTRY_DIR, file)) + if app and app.key then + app.filename = fs.combine(REGISTRY_DIR, file) + applications[app.key] = app + end end end end diff --git a/sys/etc/app.db b/sys/etc/app.db new file mode 100644 index 0000000..73b74a8 --- /dev/null +++ b/sys/etc/app.db @@ -0,0 +1,217 @@ +{ + [ "53ebc572b4a44802ba114729f07bdaaf5409a9d7" ] = { + category = "Apps", + icon = "\0304 \030 \ +\030f \0304 \0307 \030 \031 \031f)\ +\030f \0304 \0307 \030 \031f)", + title = "Network", + run = "Network.lua", + requires = "wireless_modem", + }, + [ "90ef98d4b6fd15466f0a1f212ec1db8d9ebe018c" ] = { + title = "Turtles", + category = "Apps", + run = "Turtles.lua", + }, + [ "81c0d915fa6d82fd30661c5e66e204cea52bb2b5" ] = { + title = "Activity", + category = "Apps", + icon = "\0318/\030f\031 \030 \0318\\\ +\030f \0308\0319o\030f\031 \ +\0318\\\030f\031 \030 \0318/", + run = "storageActivity.lua", + }, + [ "9f46ca3ef617166776ef6014a58d4e66859caa62" ] = { + title = "DJ", + category = "Games", + icon = " \030f \ +\030f \0307 \ +\030f \0307 \0300 ", + run = "/rom/programs/fun/dj", + }, + [ "76b849f460640bc789c433894382fb5acbac42a2" ] = { + title = "Worm", + category = "Games", + icon = "\030d \030 \030e \030 \ +\030d \030 \ +\030d ", + run = "/rom/programs/fun/worm", + }, + c7116629a6a855cb774d9c7c8ad822fd83c71fb5 = { + title = "Reboot", + category = "System", + icon = "\0304\031f \030f\0310o..\0304\031f \ +\0304\031f \030f\0310.o.\0304\031f \ +\0304\031f - ", + run = "rom/programs/reboot", + }, + [ "381e3298b2b8f6caeb2208b57d805ada38402f0b" ] = { + category = "Apps", + icon = "\0300\0317if\031 \0307 \ +\0300\0317turt\ +\0300\0317retu", + title = "Scripts", + run = "Script.lua", + requires = "wireless_modem", + }, + db56e2e1db9f7accfc37f2b132d27505c66ba521 = { + title = "Adventure", + category = "Games", + icon = "\030f\0310You \031 \ +\030f\0310Ther\030 \031 \ +\030f\0314?\031f \031 \030 ", + run = "rom/programs/fun/adventure", + }, + fb91e24fa52d8d2b32937bf04d843f730319a902 = { + title = "Update", + category = "System", + icon = "\0301\03171\03180\030 \031 \ +\0301\03181\030 \031 \ +\0301\03170\03180\03171\0307\031f>", + run = "update.lua", + }, + [ "7ef35cac539f84722b0a988caee03b2df734c56a" ] = { + title = "AppStore", + category = "System", + icon = "\030 \0310=\0300 \030 XX\0300\031f \030 \ +\030 \031f \0300 \030 \ +\030 \031f \0310o \031f \0310o\031f ", + run = "Appstore.lua", + }, + [ "4486006f811b88cacd5f211fd579717e29b600cd" ] = { + title = "Miner", + category = "Apps", + icon = " \0315\\\030 \031 \ + \0304\031f _ \030 \031c/\0315\\\ + \0304 ", + run = "simpleMiner.lua", + }, + c47ae15370cfe1ed2781eedc1dc2547d12d9e972 = { + title = "Help", + category = "Apps", + icon = " \031d?\031 \ +\031d?\031 \ + \031d?", + run = "Help.lua", + }, + b0832074630eb731d7fbe8074de48a90cd9bb220 = { + title = "Lua", + category = "Apps", + icon = "\030f \ +\030f\0310lua>\031 \ +\030f ", + run = "Lua.lua", + }, + [ "89307d419a2fe4fbb69af92b3d3af27b6ec14d3e" ] = { + title = "Telnet", + category = "Apps", + icon = " \0314>\0310_\ + \031f)))\031 \ +\0314>\0310_\031 ", + run = "telnet.lua", + }, + df485c871329671f46570634d63216761441bcd6 = { + title = "Devices", + category = "System", + icon = "\0304 \030 \ +\030f \0304 \0307 \030 \031 \031f_\ +\030f \0304 \0307 \030 \031f/", + run = "Peripherals.lua", + }, + f39d173d91c22348565c20283b89d4d1cabd3b7e = { + title = "Falling", + category = "Games", + icon = "\030f \0302 \ +\0309 \0302 \0301 \ +\030e \0309 \0301 ", + run = "rom/programs/pocket/falling", + }, + bc0792d8dc81e8aa30b987246a5ce97c40cd6833 = { + title = "System", + category = "System", + icon = " \0307\031f| \ +\0307\031f---o\030 \031 \ + \0307\031f| ", + run = "System.lua", + }, + [ "9e092dda4f0e27d0c7686ddd00272079e678b6e6" ] = { + title = "Storage", + category = "Apps", + icon = "\0307 \ +\0307 \0308\0311 \0305 \0308\031 \0307 \0308 \0301 \ +\0307 ", + run = "storageManager.lua", + }, + c5497bca58468ae64aed6c0fd921109217988db3 = { + title = "Events", + category = "System", + icon = "\0304\031f \030 \0311e\ +\030f\031f \0304 \030 \0311ee\031f \ +\030f\031f \0304 \030 \0311e\031f ", + run = "Events.lua", + }, + [ "2a4d562b1d9a9c90bdede6fac8ce4f7402462b86" ] = { + title = "Tabs", + category = "System", + icon = "\0307 \0303\0317__\0307\031 \ +\0303 \ +\0303 ", + run = "Tabs.lua", + }, + [ "114edfc04a1ab03541bdc80ce064f66a7cfcedbb" ] = { + title = "Recorder", + category = "Apps", + icon = "\030 \031f \031b \031foo \ +\030 \031f \030e\031b \030 \031f/\ +\030 \031b \030e \030 \031f\\", + run = "recorder.lua", + }, + [ "8a77613b475e46064321fd7da18d126ee35e5066" ] = { + title = "VNC", + category = "Apps", + icon = "\ +\031e\\\031 \031e/\031dn\ + \031e\\/\031 \0319c", + run = "vnc.lua", + }, + [ "4759bf14d7a511508e86c343c934894b6e8db533" ] = { + title = "Builder", + category = "Apps", + icon = "\0317_____\ +\030e\031c###\0308\0317=\030e\031c#\ +\030e\031c#\0307\031f.\030e\031c###", + run = "builder.lua", + }, + [ "6ce6c512ea433a7fc5c8841628e7696cd0ff7f2b" ] = { + title = "Files", + category = "Apps", + icon = "\0300\0317==\031 \0307 \ +\0300\0317====\ +\0300\0317====", + run = "Files.lua", + }, + b77aad5fb24921ef76ac8f3e500ed93fddae8f2a = { + title = "Redirection", + category = "Games", + icon = "\0307 \0308 \0307 \ +\0308\031b> \030b\0310>\0308\0318 \ +\0307 ", + run = "rom/programs/fun/advanced/redirection", + }, + [ "7fddb7d8d1d60b1eeefa9af01082e0811d4b484d" ] = { + title = "Shutdown", + category = "System", + icon = "\0304\031f \ +\0304\031f \030f\0310zz\031 \ +\0304\031f \030f ", + run = "/rom/programs/shutdown", + }, + bdc1fd5d3c0f3dcfd55d010426e61bf9451e680d = { + title = "Shell", + category = "Apps", + icon = "\0304 \030 \ +\0304 \030f\0314> \0310_\031 \ +\0304 \030f \030 ", + run = "shell", + }, +} \ No newline at end of file diff --git a/sys/extensions/vfs.lua b/sys/extensions/vfs.lua index b9b2d05..339a14d 100644 --- a/sys/extensions/vfs.lua +++ b/sys/extensions/vfs.lua @@ -41,7 +41,6 @@ function nativefs.list(node, dir, full) end if not files then -print(dir) error('Not a directory') end diff --git a/sys/services/network.lua b/sys/services/network.lua index 4abf98b..c3ee673 100644 --- a/sys/services/network.lua +++ b/sys/services/network.lua @@ -7,7 +7,7 @@ _G.network = { } local function netUp() local process = require('process') -_G.__process = process + local files = fs.list('/sys/network') for _,file in pairs(files) do