Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7d79545
do-fixes: `./nc.js --dataset..` MUST be run before `npm run package`
benloh Jun 4, 2025
b927d38
do-fixes: Deprecate MakeTokens. Functionality is now in netcreate Ad…
benloh Jun 4, 2025
f8aaa99
do-fixes: Remove obsolete Google Adwords parameters
benloh Jun 4, 2025
adf3186
do-fixes: Update README to point to `.start-nc-multiplex.sh` instead …
benloh Jun 4, 2025
62e3288
do-fixes: Add note to switch branches if necessary in README
benloh Jun 4, 2025
de26976
do-fixes: Deprecate `MakeToken` function and `/maketoken` route
benloh Jun 5, 2025
6cad521
download-zips: Add download logs, lokis, backups, and templates via zip
benloh Jun 5, 2025
aeac568
download-zips: Only allow downloads if user is authorized
benloh Jun 6, 2025
d4f03cd
download-zips: Show archive errors with a message and redirect
benloh Jun 6, 2025
a64c438
download-zips: Set SERVER_IP when app is launched.
benloh Jun 6, 2025
0461a60
download-zips: Support passing multiple file extensions to archiver
benloh Jun 6, 2025
3a68f2c
download-zips: Add Download "All Networks" (lokis and templates)
benloh Jun 6, 2025
67abb27
deploy-do: Add custom port override support for SSL reverse proxy ser…
benloh Jun 18, 2025
326fec6
deploy-do: Add `start-nc-multiplex-ssl.sh` script to use port 8080 fo…
benloh Jun 18, 2025
4b26921
deploy-do: `APP_PORT` should be `PORT_ROUTER`
benloh Jun 19, 2025
3ed7f0d
deploy-do: Lock out the full range of ports from 3000-4999 (rather th…
benloh Jun 21, 2025
ee20fb7
Merge pull request #18 from netcreateorg/deploy-do
benloh Jun 21, 2025
e3ed787
Update README with how list of databases is retained across restarts
benloh Aug 14, 2025
5d310ab
Merge pull request #21 from netcreateorg/update-readme
benloh Aug 14, 2025
4880d51
download-data: Simply downloads. Download EVERYTHING in a single zip
benloh Sep 12, 2025
3d0252e
Merge pull request #22 from netcreateorg/download-data
benloh Sep 13, 2025
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
39 changes: 13 additions & 26 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ git clone https://github.com/netcreateorg/netcreate-itest.git

```
cd netcreate-itest
git checkout dev // if you need to switch to a different branch
npm ci
```

If this is your first run with a newly cloned repo, run Net.Create once to set the initial configuration file and build dependent libraries:
If this is your first run with a newly cloned repo, you need to create a new project. Run Net.Create once to set the initial configuration file:
```
cd netcreate-itest
npm run package
cd ~/your-dev-folder/nc-multiplex/netcreate-itest/ // if necessary
./nc.js --dataset=demo
```

Check your browser to make sure it's running:
Expand All @@ -67,6 +68,7 @@ Then stop the Net.Create application.
ctrl-c
```


#### 3. Compile Net.Create for Classroom

Use `npm run package` to package the app.
Expand Down Expand Up @@ -110,12 +112,10 @@ cd ~/your-dev-folder/nc-multiplex
```

***IP Address or Google Analytics Code**
Use the optional `--ip` or `--googlea` parameters if you need
to start the server with a specific IP address or google
analytics code. e.g.:
Use the optional `--ip` parameters if you need
to start the server with a specific IP address. e.g.:

`node nc-multiplex.js --ip=192.168.1.40`
`node nc-multiplex.js --googlea=xxxxx`

See "Caveats" below for more information.

Expand Down Expand Up @@ -161,25 +161,11 @@ If you're not logged in, you will get an error.
Shortcut: If you have an active valid cookie, you can just go directly to the URL.


#### 10. Generate Tokens

Any user who wants to edit a graph will need to generate a token. Tokens now only work for specific graphs, so for instance a token for "hawaii" will not allow you to open "tacitus". To generate tokens, in the "Generate Tokens" box:

1. Select the graph you want to generate tokens for.
2. Enter a Class ID. It can be any string. e.g. you can use this to designate an organization.
3. Enter a Project ID. It can be any string. e.g. you can use this to designate a group.
4. Select the number of tokens to generate.
5. Click "Generate Tokens".
6. Copy the resulting codes.

You can regenerate the same codes any time.


## Managing Databases

All databases are stored in the Net.Create runtime folder, e.g. `~/your-dev-folder/nc-multiplex/netcreate-itest/runtime/`. All node processes share the same database files. So any database you spin up will be in the main runtime folder.

* Prepopulate the databases and templates by simply copying the `*.loki` and `*.template` files there prior to running `node nc-multiplex.js`.
* Prepopulate the databases and templates by simply copying the `*.loki` and `*.template` files there prior to running `./start-nc-multiplex.sh`.

* You can copy and back up databases directly in the `runtime` folder.

Expand All @@ -193,7 +179,9 @@ All databases are stored in the Net.Create runtime folder, e.g. `~/your-dev-fold

* The database named "base" is always started on port 3000 to handle static file requests. You shouldn't need to touch this graph.

* The default database template used when creating a new project is in `~/your-dev-folder/nc-multiplex/netcreate-itest/app-templates/_default.template`. You can modify this.
* The default database template used when creating a new project is in `~/your-dev-folder/nc-multiplex/netcreate-itest/app-templates/_default.template.toml`. You can modify this.

* The currently running databases are stored in `~/your-dev-folder/nc-multiplex/.nc-process-state.json`. If this file is present, the currently running databases will be reloaded when the server restarts.


## How it works
Expand Down Expand Up @@ -226,7 +214,7 @@ To start up:
b. `git pull`
c. `npm run package`
4. `cd your-dev-folder/nc-mutiplex`
5. `node nc-multiplex.js`
5. `./start-nc-multiplex.sh`

---

Expand All @@ -246,10 +234,9 @@ Or you can:


## Startup Parameters
Use startup parameters to set the ip address or google analytics code:
Use startup parameters to set the ip address code:

* `--ip` -- e.g. `node nc-multiplex.js --ip=192.168.1.40`. See "IP option is for private IP networks" below for more details.
* `--googlea` -- e.g. `node nc-multiplex.js --googlea=xxxxx`


## Variables
Expand Down
18 changes: 15 additions & 3 deletions nc-launch-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ const REPO_PATHS = [
repo: './netcreate-2018',
build: 'build',
config: 'app/assets',
pubConfig: 'netcreate-config.js'
pubConfig: 'netcreate-config.js',
runtime: 'runtime',
logs: 'runtime/logs',
backups: 'runtime/backups'
},
{
repo: './netcreate-itest',
build: '',
config: 'app-config',
pubConfig: 'config/netcreate-config.js'
pubConfig: 'config/netcreate-config.js',
runtime: 'runtime',
logs: 'runtime/logs',
backups: 'runtime/backups'
}
];

Expand Down Expand Up @@ -58,16 +64,22 @@ function ScanForRepos() {
/// EXPORTS ///////////////////////////////////////////////////////////////////
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const { primary, count, repoExists } = ScanForRepos();
const { repo, build, config, pubConfig } = primary;
const { repo, build, config, pubConfig, runtime, logs, backups } = primary;
const NC_PATH = `./${path.join(repo, build)}`;
const NC_SERVER_PATH = `./${path.join(repo, build)}`;
const NC_CONFIG_PATH = `./${path.join(repo, build, config)}`;
const NC_RUNTIME_PATH = `./${path.join(repo, build, runtime)}`;
const NC_LOGS_PATH = `./${path.join(repo, build, logs)}`;
const NC_BACKUPS_PATH = `./${path.join(repo, build, backups)}`;
const NC_URL_CONFIG = pubConfig;
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
module.exports = {
ScanForRepos,
NC_PATH,
NC_SERVER_PATH,
NC_CONFIG_PATH,
NC_RUNTIME_PATH,
NC_LOGS_PATH,
NC_BACKUPS_PATH,
NC_URL_CONFIG
};
Loading