From 25e3bdf6d85289e8fd90560ee60341e70f642a7f Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Sun, 11 Jul 2021 02:25:23 +0000 Subject: [PATCH] Start updating documentation --- README.md | 3 +- SECURITY.md | 5 ++- doc/tutorial.md | 74 +++++++++++++++-------------------------- doc/tutorial/install.md | 5 +-- doc/what-languages.md | 5 ++- lib/yaml.js | 2 +- 6 files changed, 38 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index d3757ec..0263eb3 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,8 @@ Riju does not collect your personal information. * Riju uses [Fathom Analytics](https://usefathom.com/) to measure traffic. Fathom collects very limited data and does not sell it to third parties, unlike Google Analytics. -* Riju does not serve advertisements. +* Riju does not serve advertisements or share data with any third + party aside from Fathom Analytics. All of the above notwithstanding, any service that allows people to run code online is inherently risky. For this reason, I can't make any diff --git a/SECURITY.md b/SECURITY.md index 81537d6..7d94501 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,4 +8,7 @@ way to: * View or interfere with another user's session. * Tamper with the Riju server. -I will do my best to correct the vulnerability as soon as possible. +Although I work on Riju in my free time, I take security seriously, so +I will do my best to get back to you in less than a week, and to +correct the vulnerability as soon as possible (I will let you know the +likely timeline by email). diff --git a/doc/tutorial.md b/doc/tutorial.md index 5577369..9f69c5f 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -24,8 +24,8 @@ start the admin shell: $ make image shell I=admin ``` -All future operations can be done inside the admin shell, where all -dependencies are installed automatically. +All future operations can be done inside the admin shell, where Riju's +dependencies are already installed. ## Start tmux @@ -48,60 +48,32 @@ keybindings are: use `control-b` twice to do a command on the inner one instead of the outer one -## Configure local project +## Start Riju server -Using your regular text editor (the Riju repository is synchronized -inside and outside of the container, so you can use whatever editor -you would like, it doesn't have to be something in the terminal), -create a file `.env` in the Riju repository with the following -contents: +Use `dep`, the Riju build tool, to compile the Docker image that the +Riju server will run inside: ``` -DOCKER_REPO=raxod502/riju -S3_BUCKET=riju +$ dep image:runtime ``` -This tells Riju to pull assets from the official registries that I -maintain, so that you don't have to build them yourself. - -## Set up Docker images - -Download the two Docker images needed for testing a new language: +Start Riju in development mode: ``` -$ make pull I=packaging -$ make pull I=runtime -``` - -Create a new tab in tmux (`control-b c`) and start the runtime image -with ports exposed: - -``` -$ make shell I=runtime E=1 -``` - -Inside that shell, start another instance of tmux: - -``` -$ make tmux -``` - -Now within that tmux, start Riju in development mode: - -``` -$ make dev +$ make shell I=runtime E=1 CMD="make dev" ``` You should now be able to navigate to and see that Riju is running, although it does not have any languages installed. -Finally, switch back to the admin shell (`control-b p`). We are ready -to start creating your new language. +We are now ready to start creating your new language. ## Create a language configuration -Create a file `langs/mylanguage.yaml` with the following contents: +Create a file `langs/mylanguage.yaml` with the following contents +(replacing `mylanguage` and `My Language` with appropriate values, +like `objectivecpp` and `Objective-C++`): ```yaml id: "mylanguage" @@ -115,15 +87,21 @@ run: | echo "Hello, world!" ``` -Now from the admin shell, run `make repkgs L=mylanguage`. Once that -completes, you should see your language at . -Furthermore, you can switch to the runtime image (`control-b n`) and -run `make sandbox L=mylanguage` to test your language at the command -line (e.g. type `run` to print `Hello, world!`). Each time you modify -the language configuration, run `make repkgs L=mylanguage` to -reinstall the language. +Open a new tmux pane in the admin shell (`control-b c`) and build the +Docker image for your language: -Follow these steps to augment your language configuration: +``` +$ dep image:lang-mylanguage +``` + +Once that completes, you should see your language at +. Furthermore, you can run `make sandbox +L=mylanguage` to test your language at the command line (e.g. type +`run` to print `Hello, world!`). Each time you modify the language +configuration, run `dep image:lang-mylanguage` to update the language. + +Follow these steps to get from "Hello, world" to running your actual +language: * [Install your language](tutorial/install.md) * [Provide run commands](tutorial/run.md) diff --git a/doc/tutorial/install.md b/doc/tutorial/install.md index 8635316..65361bd 100644 --- a/doc/tutorial/install.md +++ b/doc/tutorial/install.md @@ -1,6 +1,6 @@ # Tutorial: install your language -Presumably, your language isn't installed by default in Ubuntu. If +Most likely, your language isn't installed by default in Ubuntu. If not, you'll need to add an `install:` block to your language configuration describing how to install it. @@ -95,7 +95,8 @@ paths for the targets of symlinks (`/opt/swift/bin/swiftc`) but This is because while we are putting all files into `${pkg}` during build, the eventual place they will be installed by the package is into the root filesystem, so any references to paths *within* files -(including symlink targets) must not mention `${pkg}`. +(including symlink targets) must not mention `${pkg}`. This is a +standard feature of all Linux packaging tools. ```yaml install: diff --git a/doc/what-languages.md b/doc/what-languages.md index be55efa..50cb764 100644 --- a/doc/what-languages.md +++ b/doc/what-languages.md @@ -62,9 +62,8 @@ Here are some explicit *non-requirements*: * *Language must be well-known.* Nope, I'll be happy to add your pet project; after all, [Kalyn](https://github.com/raxod502/kalyn) and [Ink](https://github.com/thesephist/ink) are already supported. -* *Language must be useful.* I would have no objection to adding - everything on the esolangs wiki, if there are interpreters/compilers - available. +* *Language must be useful.* I have no objection to adding everything + on the esolangs wiki, if there are interpreters/compilers available. * *Language must be easy to install and run.* Well, it would be nice, but I've seen some s\*\*\* when adding languages to Riju so it will take a lot to surprise me at this point. diff --git a/lib/yaml.js b/lib/yaml.js index e89a90d..1558fbc 100644 --- a/lib/yaml.js +++ b/lib/yaml.js @@ -27,7 +27,7 @@ const jsonSchemaPromise = readJSONSchemaFromDisk(); export async function getLangs() { return (await fs.readdir("langs")) .filter((lang) => lang.endsWith(".yaml")) - .map((lang) => path.parse(lang).name); + .map((lang) => path.parse(lang).name).sort(); } // Return a list of the IDs of all the configured shared dependencies.