Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Docs Branch #86

Merged
merged 27 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cff00ad
Merge pull request #79 from MercuryWorkshop/docs
markrosenbaum Sep 11, 2023
4ec21b4
Update SECURITY-BP.md
markrosenbaum Sep 11, 2023
76f94bf
the lack of a gap was PISSING ME THE FUCK OFF
MadjikDotPng Sep 11, 2023
c182648
Merge pull request #80 from MercuryWorkshop/docs
markrosenbaum Sep 11, 2023
0318e67
Seamless Ui Update
MadjikDotPng Sep 11, 2023
28f38b6
Seamless Ui Update
MadjikDotPng Sep 11, 2023
d82fc8c
Launcher Ui
MadjikDotPng Sep 11, 2023
7881658
Merge pull request #81 from MercuryWorkshop/workstore
MadjikDotPng Sep 11, 2023
dcd83d4
Glass Ui Tweaks
MadjikDotPng Sep 11, 2023
5608e11
Merge pull request #82 from MercuryWorkshop/workstore
MadjikDotPng Sep 11, 2023
57ab2c5
make the animation speed sane again
ProgrammerIn-wonderland Sep 11, 2023
8cf3a7b
not a progress bar, but a progress indicator
ProgrammerIn-wonderland Sep 12, 2023
07f400f
make x86 not break if you start a term preinit
ProgrammerIn-wonderland Sep 12, 2023
081e991
update anura aboutbrowser
ProgrammerIn-wonderland Sep 13, 2023
7065a9a
add a "tracker" to settings
ProgrammerIn-wonderland Sep 13, 2023
85bbcee
temporary (permanent) pty resize fix
ProgrammerIn-wonderland Sep 13, 2023
f27d540
make term.js resize on finish resize
ProgrammerIn-wonderland Sep 13, 2023
083f167
Rounded logo in aboutapp
wearrrrr Sep 13, 2023
9939f2c
shh 🤫
ProgrammerIn-wonderland Sep 14, 2023
2216389
Update AboutApp.css
markrosenbaum Sep 14, 2023
83dc903
update gitignore
ProgrammerIn-wonderland Sep 14, 2023
4bfbf3e
commit bzResize
ProgrammerIn-wonderland Sep 14, 2023
e33b5c7
get rid of weird readFileSync thing
ProgrammerIn-wonderland Sep 15, 2023
a14b05b
fix: revert to the last known working version of aboutproxy
velzie Sep 19, 2023
bc74019
Add basic layout and some code snippets to CREDITS.md
Endercass Sep 20, 2023
1d2241c
add float dialog gist to credits
Endercass Sep 20, 2023
d4683d1
Credit some things explicitly
Endercass Sep 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rootfs/*
node_modules
anurax86.tar.gz
symlinks
images/
build/images/
build/
dist/
bios/
Expand Down
27 changes: 26 additions & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
#TODO
# Credits

- Contributors

- A full list of contributors can be found [here](https://github.com/MercuryWorkshop/anuraOS/graphs/contributors)

- Libraries

- Filesystem - [Filer.js](https://filer.js.org/)
- Filesystem HTTP bridge - [MercuryWorkshop Nohost](https://github.com/MercuryWorkshop/nohost) (Fork of [Humphd Nohost](https://github.com/humphd/nohost))
- x86 Emulation - [v86](https://copy.sh/v86/)
- A full list of dependencies can be found [here](https://github.com/MercuryWorkshop/anuraOS/network/dependencies)

- Code snippets used

Note: This list is non-exhaustive and may not contain all of the code snippets used in production of this software.

- [original base](https://gist.github.com/chwkai/290488)
- [Material Design Pure CSS Switch](https://codepen.io/sajran/pen/dMKvpb) by [sajran](https://codepen.io/sajran)
- [Material Design Pure CSS Contained Button](https://codepen.io/finnhvman/pen/MQyJxV) by [finnhvman](https://codepen.io/finnhvman)

- Design & Assets

- UI design inspiration - [Google ChromeOS](https://www.google.com/chromebook/chrome-os/)
- Various icons - [papirus icon theme](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme)
- Various assets - [Google ChromeOS](https://www.google.com/chromebook/chrome-os/)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
WebOS complete with v86 integration and a minimal yet capable desktop enviroment.
Formerly known as Chimera. Based off of the AliceWM.

### Easy Install(When in a codespace)
### Easy Install (When in a codespace)

- Run `bash codespace-basic-setup.sh`

Expand Down
1 change: 0 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ If you are wondering what counts as a vulnerability, heres a good list:
- The ability to execute arbitrary code on the server hosting Anura(not in Anura itself, as this is an intended feature)
- The ability to crash Anura(As in for everyone, not just your browser session)


## Implementing Security(For Project Members and Contributors)

See [SECURITY-BP.md](./documentation/SECURITY-BP.md) for instructions on implementing security in your code.
68 changes: 37 additions & 31 deletions apps/term.app/term.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,60 @@ const $ = document.querySelector.bind(document);

window.addEventListener("load", async () => {

/** @type {Anura} */
let anura = top.anura;
/** @type {Anura} */
let anura = top.anura;

const t = new hterm.Terminal();
top.t = t;
const t = new hterm.Terminal();
top.t = t;

let htermNode = $("#terminal");
let htermNode = $("#terminal");




t.decorate(htermNode);

t.decorate(htermNode);

const decoder = new TextDecoder("UTF-8");
t.onTerminalReady = async () => {
let currentCol;
let currentRow;
let e = document.querySelector("iframe").contentDocument.querySelector("x-screen");
console.log(e);
e.style.overflow = "hidden"
let io = t.io.push();

const decoder = new TextDecoder("UTF-8");
t.onTerminalReady = async () => {
t.setBackgroundColor("#141516");
t.setCursorColor("#bbb");
currentCol = t.screenSize.width;
currentRow = t.screenSize.height;
const pty = await anura.x86.openpty("TERM=xterm DISPLAY=:0 bash", t.screenSize.width, t.screenSize.height, (data) => {
io.print(data);
});

let e = document.querySelector("iframe").contentDocument.querySelector("x-screen");
console.log(e);
e.style.overflow = "hidden"
let io = t.io.push();

t.setBackgroundColor("#141516");
t.setCursorColor("#bbb");
const pty = await anura.x86.openpty("TERM=xterm DISPLAY=:0 bash", t.screenSize.width, t.screenSize.height, (data) => {
io.print(data);
});


function writeData(str) {
anura.x86.writepty(pty, str)
}

io.onVTKeystroke = writeData;
io.sendString = writeData;

function writeData(str) {
anura.x86.writepty(pty, str)
}
io.onTerminalResize = (cols, rows) => {
currentCol = cols;
currentRow = rows;
}

io.onVTKeystroke = writeData;
io.sendString = writeData;
io.onTerminalResize = (cols, rows) => {
anura.x86.resizepty(pty, cols, rows);
}
t.installKeyboard();

t.installKeyboard();

htermNode.querySelector("iframe").style.position = "relative";
console.log("wtf")
anura.apps['anura.term'].windows[anura.apps['anura.term'].windows.length - 1].onresize = () => {
anura.x86.resizepty(pty, currentCol, currentRow);
}

htermNode.querySelector("iframe").style.position = "relative";
console.log("wtf")


}
}
});
22 changes: 11 additions & 11 deletions documentation/SECURITY-BP.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Security Blueprint
This Document will explain what and how security features are implemented in AnuraOS.


This Document will explain what and how security features are implemented in AnuraOS.

## Secure Math

In Anura, when coding in a cryptographic/security sensitive context, we replace `Math.random()` with our own function `cryptoRandom()`. `cryptoRandom()` is a direct replacement for `Math.random()` and the two are fully interchangeable. If you would like to implement `cryptoRandom()` you can use the following steps(for TypeScript):
In Anura, when coding in a cryptographic/security sensitive context, we replace `Math.random()` with our own function `cryptoRandom()`. `cryptoRandom()` is a direct replacement for `Math.random()` and the two are fully interchangeable. If you would like to implement `cryptoRandom()` you can use the following steps(for TypeScript):

1. If not already installed, run `npm install @types/node`
2. Add `import * as crypto from "crypto";` to the head of whatever file in which you would like to replace `Math.random()`
3. Add the following function to your code:

1. If not already installed, run `npm install @types/node`
2. Add `import * as crypto from "crypto";` to the head of whatever file in which you would like to replace `Math.random()`
3. Add the following function to your code:

```ts
function cryptoRandom() {
const typedArray = new Uint8Array(1);
const randomValue = crypto.getRandomValues(typedArray)[0];
const randomFloat = randomValue / Math.pow(2, 8);
return randomFloat;
const typedArray = new Uint8Array(1);
const randomValue = crypto.getRandomValues(typedArray)[0];
const randomFloat = randomValue / Math.pow(2, 8);
return randomFloat;
}
```

4. You can now replace `Math.random()` anywhere in your code with `cryptoRandom()`.

## TODO
Binary file added public/assets/icons/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 25 additions & 1 deletion public/assets/icons/chrome.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/assets/icons/launcher.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/lagtrain.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading