Skip to content
Joonghoon Kim edited this page Nov 20, 2015 · 18 revisions

Configuraion file

${server source}/src/server/conf/default-conf.js provides default configuration. You should copy the file to conf.js and edit all necessary configurations to update Weida server easily, without resolving conflicts. it's script but can be edited for it's ignored in .gitignore already.

Configurating Webida server

Before editing configuration file, you should decide to use reverse proxy or not.

  1. If you want to open standard ports (80/443) only, you should use reverse proxy. To use reverse proxy, you should have some DNS and add hosts (auth, fs, app, ... ) in the configuration file.

  2. If you don't have DNS service and should use IP, then you should not use reverse proxy.

Cchange useReverseProxy variable in conf.js (not conf.useReverseProxy property) to enable/disable.

Using WEBIDA_* environment variables

Many values in configuration can be overrided by environment varialbles, but not recommended except development purpose. Just edit conf.js and set 'real' paths and values to the file. Use WEBIDA_HOME not to spread your data. Default value of WEBIDA_HOME is '/home/webida' (is hard-coded) and should be set always when running server in producntion mode using NODE_ENV='production'.

Discarding some 'developers-only' options, in most case, you should set/change following env. variables

  • WEBIDA_LOG_LEVEL (conf.logLevel): plain log level string. Setting the value to 'debug' will slow server perfomance a lot.
  • WEBIDA_APP_QUOTA_COUNT (conf.: maximum number of apps allowed to be deployed by one user
  • WEBIDA_APP_QUOTA_SIZE : maximum size of deployable app.
  • WEBIDA_HTTP_HOST, WEBIDA_HTTP_SERVERS : binding address of the servers. We don't recommend you to change binding addresses other than default (0.0.0.0). Use firewall and other shiny network security tools to protect server from illegal access.

Important configuration object values

You should change or set these values before running services.

  • conf.logLevel (see above section)

  • conf.workerInfo : Although not enabled by default, it's recommended to enable this option usually. set proper number of worker count, but no more than the number of CPU cores.

  • conf.dataMapperConf.connectors : set access credential to your DB. DO NOT USE DEFAULT. for security.

  • conf.signup : you should configure this object to send emails to activate account. DO NOT USE DEFAULT, for it would not work.

  • conf.servies.fs.linuxfs : If your host have XFS/BTRFS than change this value. Quota system will not work if you don't set file system type to XFS or BTRFS

  • conf.services.fs.container.lxc.net : If you are running your sever in 10.x.y.z IP (usually VM) check this object carefully. You should check your LXC configuration first and set proper base, gw & ip range to containers. Every terminal and most of git/build tasks will be executed in container.

  • conf.services.fs.exec.timeoutSecs : 300 sec. default If you allow users run very long (maybe very heavy, too) building & git jobs, increase timeout value.

  • conf.units : see below section

Configuring units

Unit is a 'server module' of Webida server, that runs its own http(s) services and provides API to client or other units. If you want to use reverse proxy, You should enable proxy unit (disabled by default). If you want to spread unit services to multiple hosts, you should change unit array's values. convention for unit name for services is adding 0,1,2,3,... to service type of the unit.

Checking configuration file

Run conf.js with node. conf.js will check conf object values refering invalid paths. And best feature is node wil check syntax and throw error when the script is broken. Run node conf.js always if you changed something in the file before (re)starting server process.

Serving Webida with HTTPS

  • to use https, we recommend you enable useReverseProxy option.
  • First of all, buy or receive 3 files : SSL key, certification & CA certification.
  • As many other servies, you have to set the path of the files in configuratino file. grep WEBIDA_SSL in conf.js & change the paths to your own. Or, put the files in $WEBIDA_HOME/keys.

System configuration

Edit sudoers

Before running Webida server, you should give webdia user some previleges to run some sudo actions.

    $ cd /home/weibida/webida-server/src/system-configs
    $ sudo cp ./system-configs/sudoers /etc/sudoers.d/webida
    $ sudo visudo -f /etc/sudoers.d/webida 

webida user should be able to run lxc-execute without password

XFS

If you've set conf.servies.fs.linuxfs to XFS or BTRFS, you may have to change fstab & configuration file. See XFS Guide for details.

BTRFS

You should enalbe quota before run 'fs-install.js' (fs-install.js will fail for the errors from btrfs command)

sudo btrfs enable quota /home/webida

If you could not run fs-install.js successfully, you should run fs-uninstall.js first, before running fs-install.js again.

Clone this wiki locally