Skip to content

Install and Configuration

Sotaro KARASAWA edited this page Jul 19, 2022 · 9 revisions

Install and Configuration

Install

To install, just set up dependencies after clone.

$ npm install

And you can up the application (please replace the ENV parameter as your environment).

$ PASSWORD_SEED=yourpasswordseed MONGO_URI=yourmongouri npm start

ENV Parameters

Required

PASSWORD_SEED:

  • A password seed is used by password hash generator.
  • WARNING: If you change this parameter after the first user is created then the user lose the ability to login.

MONGO_URI:

  • URI to connect MongoDB.
    • Examples:
      • MONGO_URI=mongodb://localhost/crowi
      • MONGO_URI=mongodb://localhost:27017/crowi_prod
      • MONGO_URI=mongodb://crowi_user:password@localhost/crowi_prod2

Option

PORT:

  • Server port. default: 3000.

NODE_ENV:

  • production OR development.

REDIS_URL:

  • URI to connect Redis (to session store). This parameter is also by REDISTOGO_URL.
  • Crowi uses MemoryStore as the session store as default if REDIS_URL is not passed. REDIS_URL parameter is an optional, but using Redis is strongly suggested in production mode.
  • Example: REDIS_URL=redis://localhost:6379

SECRET_TOKEN:

  • A secret key for verifying the integrity of signed cookies.

ELASTICSEARCH_URI:

  • A URL of Elasticsearch. Also allowed BONSAI_URL.
  • Example: ELASTICSEARCH_URI=http://127.0.0.1:9200/crowi_search

Configuration

After your Crowi run, access to Crowi with your browser (e.g. http://crowi.example.com:3000). First time you access to Crowi, you have to create the first user (the user becomes an administrator).

To configure others, access to /admin (the link placed on the header).

Set Up Google Project

Enable configuration of Google, you can register and login by using google account. Configure google section,

Registration/Login using Google account is also affected a whilelist setting on security section. You can restrict registrant's email by only listed emails. This setting is useful if you use Google Apps on your organization.

For more help, go to the official document. Google Developers Console Help

Create Project

To set up your project's consent screen, do the following:

  1. Go to the Google Developers Console.
  2. Select Create Project.
  3. Fill forms and click Create.

Create New Client ID for OAuth

In the sidebar on the left, select Credentials, then select Create New Client ID.

  1. Select OAuth Client ID

  2. Select Web Application

  3. Fill forms as below:

    If you set up this wiki on wiki.example.com, fill the as below:

    https://wiki.example.com
    

    And fill 'Redirect URL' field as below:

    https://wiki.example.com/google/callback
    

So, now you can get Client ID and Client Secret, copy these values and paste it to the fields on the setting.

Set Up Consent Screen

Make sure that the email is set on EMAIL ADDRESSS field.

Set Up GitHub

Enable configuration of GitHub, you can register and login by using github account. Configure github section,

Registration/Login using GitHub account is also affected a whilelist setting on security section. You can restrict the user's registrations with the email whitelist or the organization name registered.

For more help, go to the official document. Creating an OAuth App | GitHub Developer Guide

Create Project

To set up your project's consent screen, do the following:

  1. Go to the Developer applications on GitHub.
  2. Select New OAuth App.
  3. Fill forms and click Register application.

Create New OAuth App

  1. Fill forms as below:

    If you set up this wiki on wiki.example.com, fill the as below:

    https://wiki.example.com
    

    And fill 'Authorization callback URL' field as below:

    https://wiki.example.com/github/callback
    

So, now you can get Client ID and Client Secret, copy these values and paste it to the fields on the setting.