| Sep | OCT | Nov |
| 10 | ||
| 2019 | 2020 | 2021 |
COLLECTED BY
Collection: github.com
codeworld-api
package and blank-canvas.
●CodeWorld Blocks provides a drag-and-drop
programming user interface for younger students to build programs with
CodeWorld. This interface still has some bugs, and isn't recommended for
use.
CONTRIBUTING.md for details.
./install.sh to set up the project.
(四)Run ./run.sh to start the server.
You can now access the CodeWorld system at http://localhost:8080.
If you make changes to CodeWorld, you can rebuild it without rebuilding the dependencies:
(一)Change to the root directory of the project.
(二)Run ./build.sh to recompile just CodeWorld itself, using previously installed tools and libraries.
(三)Run ./run.sh to start the server.
sudo docker build -t codeworld https://github.com/google/codeworld.git
sudo docker run -p 80:8080 -t codeworld
For now, the docker container has no way to access a client id, mount a shared NFS
drive, or other setup steps. It will work, but it won't be complete. In the
future, this should become the standard way to deploy CodeWorld.
stack.yaml in the project's root is present to partially support Intero and
Travis CI. On Travis, codeworld-compiler
tests do not run.
Building and running CodeWorld locally with Stack is unsupported, and in fact doesn't
work. Stack cannot yet substitute for the shell scripts or docker usage above.
web/clientId.txt.
To get a Google API key for your CodeWorld installation, please consult the
following resources:
●Creating a project
●Creating an OAuth client ID
Once you have a Google API key, copy and paste it into web/clientId.txt. A running
CodeWorld instance will immediately pick up changes to this file.
In general, the Google authentication system will be the easiest system to
maintain since no local password stores are required. This is the mechanism
used by the official, live version of CodeWorld.
codeworld-auth CLI tool to manage accounts.
The local authentication system may be useful for situations where an
instructor cannot reasonably expect all students to have a valid Google account
and in which the instructor is willing to deploy a local CodeWorld stack.
codeworld-auth.db file is present
in the application's root directory. To create this database, run the following
from the root of the Git repository:
build/bin/codeworld-auth init-accounts -d codeworld-auth.db
This will create an empty account database with no accounts.
build/bin/codeworld-auth create-account -d codeworld-auth.db johndoe Expired
This will create a new account with user ID johndoe with a randomly generated
password. The account will be set to "Expired" which means the user will be
prompted to enter a new password at next sign-in time.
Other subcommands are provided for updating and deleting accounts etc. For
help:
build/bin/codeworld-auth --help
codeworld-auth.txt. This is used to sign JWT tokens passed
back and forth between the server and the browser. From the Git repository's
root directory, run the following command:
build/bin/codeworld-auth generate-secret -s codeworld-auth.txt
This will generate a new random JWT signing key. The server should not expose
this secret to external users.
$ sudo dd if=/dev/zero of=/swap bs=1024 count=2097152
$ sudo mkswap /swap
$ sudo swapon /swap
This creates a 2 GB swap file to increase available virtual memory. Installation with
a swap file may be slow, but it will succeed. (Unless you intend to write very large
programs in CodeWorld, it's usually safe to remove the swap file after running the
server for the first time.)