Sam's Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
notes:p5-editor-fork [2026/11/29 16:19] – Add p5-editor-fork page samnotes:p5-editor-fork [2026/11/29 18:56] (current) – tweak sam
Line 4: Line 4:
  
 ===== Development ===== ===== Development =====
 +
 +This [[https://wiki.nixos.org/wiki/Docker|link]] has useful information about running Docker under NixOS.
 +
 +If this is the first time starting the container, it is necessary to copy ''.env.example'' to ''.env'', and fill-in the required fields.
 +At a minimum, the required fields are:
 +  * ''GITLAB_URL''
 +  * ''GITLAB_ID''
 +    * This can be found by adding the editor as a GitLab Application.
 +    * The callback URL (for development) is ''http://localhost:8000/auth/gitlab/callback'' (''server/routes/passport.routes.js'')
 +    * The ''api'' scope must be granted.
 +  * ''GITLAB_SECRET''
 +    * This value can also be found once a GitLab application has been registered.
  
 To start the web server and the database: To start the web server and the database:
 <code> <code>
-$ docker-compose -f docker-compose-development.yml up+$ docker compose -f docker-compose-development.yml up
 </code> </code>
 +
 +When you're done, run the following to shut down the services:
 +<code>
 +$ docker compose -f docker-compose-development.yml down
 +</code>
 +
 +==== Removing the Database Volume ====
 +
 +The docker compose configuration defines a named volume, ''dbdata'', which contains the database.
 +To drop this database, you can delete this persistent volume:
 +<code>
 +$ docker volume rm p5-editor_dbdata
 +</code>
 +
 +===== Adding a Course Edition =====
 +
 +There are some useful scripts which add course editions, assignments, etc. in ''/server/scripts''.
 +For example, to add a new course edition, you could run:
 +<code>
 +$ ./server/scripts/add-course-edition.sh \
 +  --name "test-edition" \
 +  --password 1234 \
 +  --project-name-template "sbcohen/p5-assignments-OWNER"
 +</code>
 +
 +The ''--project-name-template'' flag tells the server how to construct project/repository names.
 +In the case of the above example, the gitlab repository URL was ''%%https://gitlab.taila5f9fc.ts.net/sbcohen/p5-assignments-sbcohen%%''.
 +The string ''OWNER'' stands in for the gitlab username of the repository owner (it is replaced dynamically at runtime with the actual username).
 +
 +===== Adding an Assignment =====
 +
 +Example:
 +<code>
 +$ ./server/scripts/add-assignment.sh \
 +  --name "Test Assignment" \
 +  --urlName "test-assignment" \
 +  --dueDate 2026-11-30 \
 +  --edition test-edition
 +</code>
 +
 +===== TODO =====
 +  * Update dependencies to avoid passing ''--legacy-peer-deps'' (See ''/Dockerfile'')
  
notes/p5-editor-fork.1795969191.txt.gz · Last modified: by sam