Web client for loklak server (see: https://github.com/loklak/loklak_server ). To use the loklak webclient, you need a running loklak server. Install and run it first.
- Install
git,npm,nodejs,nasm,libpng-devanddh-autoreconfpackages. Run the commands as:sudo apt-get install git-coresudo apt-get install npmsudo apt-get install nodejssudo apt-get install nasmsudo apt-get install libpng-devsudo apt-get install dh-autoreconf
- Run
sudo npm install -g gulpto installgulpsystemwide as a tool to run the task. - Clone this repo from
https://github.com/loklak/loklak_webclient.git - Create your custom settings file by doing
cp configFile.json custom_configFile.json. Edit your settings insidecustom_configFile.json. - Run
npm installfrom the root directory AND fromoauth-proxysubdirectory, AND fromiframely - Install mongodb and run
mongod.
Create a Twitter application at https://apps.twitter.com, remember to set the correct website url & callback url (for localhost, http://127.0.0.1/ works better), then modify custom_configFile.json as:
- Set the twitterConsumerKey var in
custom_configFile.jsonto set the Consumer Key (API Key) from your Twitter app - Set the twitterConsumerSecret var in
custom_configFile.jsonto set the Consumer Secret from your Twitter app - Change the jwtsecret var in
custom_configFile.jsonto a different string - Change the email var in
custom_configFile.jsonto a different email
A twitter app is valid only for a domain (defined when creating the app). So the credentails above need to be changed also according to the domain (e.g. you'll need to create 2 twitter apps separately for a clone in localhost and for a clone in a remote server)
See here to run your own https://github.com/loklak/loklak_server (reccommended), and change apiUrl in config accordingly. Last resource, or for production is http://loklak.org/api/
Link debugging server is essential to embed rich contents from tweets, e.g. videos, links, articles, photos, ..etc. This need to be ran separately, just like the loklak server. Go to ./iframely, and run node server. It's a MUST to be in ./iframely folder when executing the service. pm or *nix screen can help managing this service in the background.
After adding twitter credentials and apiUrl, you can leave the rest as is and run gulp dev for development. gulp dev includes an express server to serve the build at gulpDevExpressPort, a proxy server at oauthProxyPort, and browser-sync at 3000. A browser window will be opened automatically.
For a remote server, along with twitter credential for the remote server: change all localhost to your domain e.g. "oauthProxyUrl": "http://mydomain.org:3002/oauthproxy"
We recommend using screen of pm2 to manage your node processes.
-
If you have your own web server engine,
gulp prodwill create static files only at directorybuild. You'll need to runoauthservice manually bynode oauth-proxy/index.js, and also the debugging service manually, see 'Iframely Link Debugging server' -
If your server don't have a web serve,
gulp livewill serve the appgulpDevExpressPortalong withoauthservice atoauthProxyPort. You'll need to run the 'Iframely Link Debugging server' mentioned above manually.
When there is a need to change default port oauthProxyUrl, oauthProxyRedirectUrl, oauthProxyPort should have the same port. The port to the application can be change at gulpDevExpressPort
IMPORTANT Since OauthProxy instance are also using fields from custom_configFile.json, if twitter credentials are changed, including consumerKey, consumerSecret & callbackUrl, OauthProxy must be restarted. This only applies for production since in development, the instance is restarted automatically with gulp dev
- On *nix based systems (latest Ubuntu, Fedora version) you might get an
Error: watch ENOSPCwhen runninggulp dev. To fix, check this post on Stackoverflow. version 'GLIBC_2.14' not found required by imagemin-jpegtran. To fix this, make sure you have installed nasm, libpng-dev, dh-autoreconf. Then dorm node_modules -randnpm install.- Problem with
node-gyp? Check if you meet the requirements here: Link