diff --git a/docs/Building.md b/docs/Building.md index de0390dc..9c2cac5a 100755 --- a/docs/Building.md +++ b/docs/Building.md @@ -6,6 +6,13 @@ and running the server. For development or other running configurations, refer to [Notes On Development] and [Running Docker Image]. +## Prerequisites + +You will need the following installed on your system/server: + +* Git +* NodeJS + ## Build Instructions The application is a [NodeJS]/[ExpressJS]/[TypeScript] application so the @@ -18,7 +25,7 @@ npm run build ## Running -For testing and simple opertion, you can run Iamus in the build directory. +For testing and simple operation, you can run Iamus in the build directory. Say you want to build and run Iamus in the directory IBASE. The steps are: ```sh @@ -40,7 +47,7 @@ Refer to [Running Docker Image] for instructions. For connecting domain-servers to the Iamus metaverse-server, you must point any domain-servers (Vircadia) at this -metaverse server. This is accomplished by setting the `HIFI_METAVERSE_URL`: +metaverse server. This is accomplished by setting the `HIFI_METAVERSE_URL` environment variable: ```sh export HIFI_METAVERSE_URL=http://HOSTADDRESS:9400 @@ -71,7 +78,7 @@ current package and build version. The format of the file is: } ``` -`version-tag` combines the NPM package version, the date of build, and +`version-tag` combines the NPM package version, the date of the build, and the GIT commit version and is used to tag the Docker image. The version information is also read and added to the configuration @@ -81,7 +88,7 @@ data structure (for use by the application) and added to the ## Configuration The server parameters are all specified in `config.ts`. These default -values are overlayed with environment variables and then overlayed with +values are overlaid with environment variables and then overlaid with the contents of a configuration file. The environment variables are: @@ -89,7 +96,7 @@ The environment variables are: - IAMUS_LOGLEVEL: logging level. One of 'error', 'info', 'warn', 'debug'. Default 'info'. - IAMUS_LISTEN_HOST: host to listen for requests on. Default '0.0.0.0'. - IAMUS_LISTEN_PORT: port to listen for requests on. Default 9400. -- IAMUS_EXTERNAL_HOSTNAME: hostname to report as referencing back to this server. This is mostly used by ActivityPub for links to users. Default 'localhost'. This value MUST be set for proper metavserse-server operation. +- IAMUS_EXTERNAL_HOSTNAME: hostname to report as referencing back to this server. This is mostly used by ActivityPub for links to users. Default 'localhost'. This value MUST be set for proper metaverse-server operation. - IAMUS_CONFIG_FILE: filename or URL of a JSON formatted configuration file that over-rides the values. Default "./iamus.json". The configuration file, if it exists, is read and its values overlay @@ -139,6 +146,8 @@ All the configuration parameter default values are defined in `src/config.ts`. ## Setup MongoDB +### Install on Linux + Install MongoDb following the instructions at https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ : ```sh @@ -165,8 +174,8 @@ use admin db.createUser({user:"cadiauser", pwd: "LONGPASSWORD3", roles: [{ role: "readWrite", db: "domainstore" }]}) ``` -Where, if course, "LONGPASSWORD*" is a collection of random letter and numbers. -This creates account "adminer" for DB administration, "backuper" for doing backups +Where, of course, "LONGPASSWORD*" is a collection of random letter and numbers to use as a password. +This creates an account "adminer" for DB administration, "backuper" for doing backups and "cadiauser" to be the database user for the domain-server. The database is "domainstore". @@ -179,6 +188,42 @@ security: then do `sudo systemctl restart mongod`. +### Install on Windows + +Install MongoDb following the instructions at https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/ : + +```sh +"C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe" +db.disableFreeMonitoring() +``` + +Turn on authentication and create some users for our instance: + +```sh +"C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe" +use admin +db.createUser({user:"adminer", pwd: "LONGPASSWORD1", roles: [ "root" ]}) +use admin +db.createUser({user:"backuper", pwd: "LONGPASSWORD2", roles: [ "backup" ]}) +use admin +db.createUser({user:"cadiauser", pwd: "LONGPASSWORD3", roles: [{ role: "readWrite", db: "domainstore" }]}) +``` + +Where, of course, "LONGPASSWORD*" is a collection of random letter and numbers to use as a password. +This creates an account "adminer" for DB administration, "backuper" for doing backups +and "cadiauser" to be the database user for the domain-server. +The database is "domainstore". + +After doing the above creation steps, edit `\bin\mongod.cfg` and add: + +``` +security: + authorization: enabled +``` + +In Windows PowerShell, restart the service by running +`Restart-Service MongoDB -force`. + ## Logging My default, Iamus logs to a file named `iamus.log` in the directory `./logs`. @@ -194,7 +239,7 @@ These parameters can be changed with the config file. | debug.log-max-size-megabytes | 100 | the maximum size of the individual log files | | debug.log-max-files | 10 | number of old log files to keep | | debug.log-compress | false | if to compress old versions of the log files | -| debug.log-to-console | false | whether to additionlly log to the console | +| debug.log-to-console | false | whether to additionally log to the console | When running with Docker, one often changes the logging directory to point into a mounted volume for easy reference. diff --git a/docs/Design.md b/docs/Design.md index 1904d4f0..719ec825 100755 --- a/docs/Design.md +++ b/docs/Design.md @@ -72,11 +72,11 @@ the database. This two step process is done with: This sample takes the authorization of the requestor, the account being changed, the external name of the field being set, and the value being set. The extra parameters passing the AccountEntity that goes with the authorization token (this is -optional but saves a database lookup if supplied) and a VKeyedCollection that has the +optional but saves a database lookup if supplied) and a VKeyedCollection that has the database information that needs to be updated for this set operation. -Ths update information is then passed +This update information is then passed . -This system of field getting and setting is implmented with field definitions +This system of field getting and setting is implemented with field definitions that are attached to the entity definition. Each field in an Entity has a `FieldDefn` definition that gives its internal and external name and the routines to use to validate and update the field. @@ -108,7 +108,7 @@ The functions `getter` and `setter` are the operations that get and set the fiel Of course, the setter presumes the set value has passed the validation. These function definitions accept and return type "any" so the callers need to know what they want/expect. -## Other Implimentation Nodes +## Other Implementation Nodes BEWARE! All "entity" classes are really just Objects that are read out of the database. Even though they are defined as classes, when read from the diff --git a/docs/TestSetup.md b/docs/TestSetup.md index 69cf245a..6ea6f57b 100755 --- a/docs/TestSetup.md +++ b/docs/TestSetup.md @@ -1,4 +1,4 @@ -# Iamus Test Setup +# Iamus Test Setup (outdated) **TL:DR version**: a test metaverse using the latest Iamus and Vircadia diff --git a/src/routes/users/username.ts b/src/routes/users/username.ts index 40addaf1..2de3efc7 100755 --- a/src/routes/users/username.ts +++ b/src/routes/users/username.ts @@ -27,7 +27,7 @@ const procGetUserProfile: RequestHandler = async (req: Request, resp: Response, const dashboardURL = Config.metaverse["dashboard-url"]; const metaverseURL = encodeURIComponent(Config.metaverse["metaverse-server-url"]); const username = encodeURIComponent(req.vUsername); - const redirectionURL = `${dashboardURL}?metaverse=${metaverseURL}&page=user/profile&user=${username}`; + const redirectionURL = `${dashboardURL}?metaverse=${metaverseURL}&page=profile/${username}`; resp.statusCode = HTTPStatusCode.Found; resp.setHeader('Location', redirectionURL), resp.setHeader('content-type', 'text/html');