Difference between revisions of "Pad Thing with CodiMD"

From Run Your Own
Jump to: navigation, search
(Created page with "CodiMD is a browser-based real-time collaborative markdown notes/pad kind of thing. == Prerequisites == * Node v8.x https://nodejs.org/dist/latest-v8.x (tested with v8.15, [h...")
 
(Installation and Configuration)
Line 47: Line 47:
 
   }
 
   }
 
  }
 
  }
 +
* You can fill the config as such:
 +
** <code>${FQDN}</code>: your absolute domain name, ie subdomain.domain.yolo
 +
** <code>${RANDOM_CRAP}</code>: for instance <code>cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c 32; echo</code>
 +
** <code>${DB_USER}</code>, <code>${DB_USER_PASSWORD}</code>, <code>${DB}</code>: info from the MySQL db and user you created for this app
 +
* Edit <code>.sequelizerc</code> with the relevant MySQL info, again.
 +
var path = require('path');
 
   
 
   
 +
module.exports = {
 +
    'config':          path.resolve('config.json'),
 +
    'migrations-path': path.resolve('lib', 'migrations'),
 +
    'models-path':    path.resolve('lib', 'models'),
 +
    'url':            'mysql://${DB_USER}:${DB_USER_PASSWORD}@localhost:3306/${DB}'
 +
}
 +
* Build
 +
npm run build
  
 
[[Category: Web Application]]
 
[[Category: Web Application]]

Revision as of 15:15, 25 February 2019

CodiMD is a browser-based real-time collaborative markdown notes/pad kind of thing.

Prerequisites

Installation and Configuration

wget https://github.com/hackmdio/codimd/archive/1.2.1.tar.gz
tar xvf 1.2.1.tar.gz
  • give it a place to stay if you like...
mv codimd-1.2.1 /path/to/somewhere/codimd
cd /path/to/somewhere/codimd
  • Edit config.json
{
   "production": {
       "host": "localhost",
       "debug": "false",
       "port": "3000",
       "domain": "${FQDN}",
       "sessionSecret": "${RANDOM_CRAP}",
       "useCDN": "false",
       "protocolUseSSL": "true",
       "allowOrigin": "['localhost']",
       "allowFreeURL": "true",
       "forbiddenNoteIDs": "['robots.txt']",
       "imageUploadType": "filesystem",
       "db": {
           "username": "${DB_USER}",
           "password": "${DB_USER_PASSWORD}",
           "database": "${DB}",
           "host": "localhost",
           "port": "3306",
           "dialect": "mysql"
       },
       "csp": {
           "enable": "true",
           "directives": {
               "scriptSrc": "${FQDN}"
           },
           "upgradeInsecureRequests": "auto",
           "addDefaults": "true"
       }
  }
}
  • You can fill the config as such:
    • ${FQDN}: your absolute domain name, ie subdomain.domain.yolo
    • ${RANDOM_CRAP}: for instance cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c 32; echo
    • ${DB_USER}, ${DB_USER_PASSWORD}, ${DB}: info from the MySQL db and user you created for this app
  • Edit .sequelizerc with the relevant MySQL info, again.
var path = require('path');

module.exports = {
   'config':          path.resolve('config.json'),
   'migrations-path': path.resolve('lib', 'migrations'),
   'models-path':     path.resolve('lib', 'models'),
   'url':             'mysql://${DB_USER}:${DB_USER_PASSWORD}@localhost:3306/${DB}'
}
  • Build
npm run build