Set up Intrapps you use


Following step are in order to create environment you use Intrapps.
If you want to develop and debug intrapps, go to the page.


Prerequisition

You have to prepare following.

  1. Install docker and docker-compose to server. (Intrapps is based on docker.)
  2. Set domain-name to server.
  3. Prepare server certificate. You need both the certificate file in the PEM format and the secret key file in the PEM format. (iOS app can be downloaded via only SSL.)

Step 1 : Download Intrapps

Download resources by "git clone" from GitHub repogitory of Intrapps.

git clone https://github.com/lwngt/intrapps.git

Step 2 : Set server certificate

Put server certificate to both web and api of docker.
Before this step, self-sigined certificate has already been set in git as domain-name is "localhost".
So, If you hope to use it, you can skip the step. (I don't recommend it...)

# for api
cp pem_format_file.pem /your-download-path/intrapps/api/app/nginx/app_server.cert
cp secret_key_file.key /your-download-path/intrapps/api/app/nginx/app_server.key
# for web
cp pem_format_file.pem /your-download-path/intrapps/web/app/nginx/web_server.cert
cp secret_key_file.key /your-download-path/intrapps/web/app/nginx/web_server.key

If api's and web's docker is in same server, same certificate is ok.


Step 3 : Customize config file

  • Web customization

    Write domain-name in production section of api.config.json.
    Replace "localhost" with "domain-name".

    # /your-download-path/intrapps/web/app/src/common/config/api.config.json
    
    {
    "api_log_output": false,
      "development": {
          :
          :
      },
      "production": {
          :
          :
        "api": {
          "api_server": "https://intrapps_api_nginx_container:8181/api",
          "api_server_image": {
            "SCREENSHOT": "https://<-domain-name->:8181/images/screenshot/",
            "ICON": "https://<-domain-name->:8181/images/icon/"
          },
          "api_server_files": {
            "PLIST": "https://<-domain-name->:8181/files/plist/",
            "APK": "https://<-domain-name->:8181/files/apk/"
          },
          :
          :
          }
      }
    }
  • API customization
    • Set api and web server's domain-name

      Write domain-name of api.json.

      # intrapps/api/app/src/api_conf/api.json
      
      {
        "web_url": "https://<-domain-name->",         // for web server's domain-name
        "base_url": "https://<-domain-name->:8181",   // for api server's domain-name
        "api_log_output": false
      }
    • Set database connect definition

      Write user name, password and database name in mysql.json to access mysql.
      If you hope to use default parameter, you can skip this step.
      Once you defined them, you must not change.

      # intrapps/api/app/src/db_conf/mysql.json
      
      {
        "host": "db",                 // You must not change
        "user": "<-user-name->",      // change db user name to access db
        "password": "<-password->",   // change db user's password
        "database" : "<-db-name->"    // change db name in mysql
      }
    • Set STMP server access definition

      Write stmp server access definition in mail.json in order to send E-mail for user authorization.

      # intrapps/api/app/src/mail_conf/mail.json
      
      {
        "stmp_server" : "<-stmp-server-domain-name->",
        "stmp_user_id" : "<-stmp-server-user-id->",
        "stmp_password" : "<-stmp-server-password->",
        "from_mail_address" : "<-from-email-address->"
      }
  • DB customization

    Write user name, password, root password and database name to docker-compose.yml
    If you hope to use default parameter, you can skip this step.
    Once you defined them, you must not change.
    The parameters must be equal to mysql.json's above.

    # intrapps/docker-compose.yml
    
    version: "3"
    services:
        :
        :
      # ######################################################################
      #mysql
      db:
        build: ./db/docker/construct_db
        restart: always
        image: intrapps_db_image # Docker image name
        container_name: intrapps_db_container # Docker container name
        environment:
          MYSQL_DATABASE: "<-db-name->"
          MYSQL_USER: "<-user-name->"
          MYSQL_PASSWORD: "<-password->"
          MYSQL_ROOT_PASSWORD: "<-root-user-name->"
        volumes:
          - ./db/app/mysql/mysql_data:/var/lib/mysql # parmanent data
          - ./db/app/mysql/sqls:/docker-entrypoint-initdb.d # initial data
        ports:
          - "3306:3306"
        expose:
          - "3306"
        networks:
          - intrapps_network
    networks:
      intrapps_network:
        external: true

Step 4 : Build Docker image

Build and create docker images.
Execute following command under Intrapps directory.

docker-compose build

Step 5 : Launch service

Launch Intrapps service containers.
Execute following command under Intrapps directory.

docker-compose up -d

Step 6 : Check success to launch

Access to Intrapps sign up page by using browser.

https://<-your-intrapps-domain-name->/signup