Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. qgp9
    • Profile
    • Following 1
    • Followers 1
    • Topics 7
    • Posts 87
    • Best 30
    • Groups 1

    qgp9

    @qgp9

    47
    Reputation
    940
    Profile views
    87
    Posts
    1
    Followers
    1
    Following
    Joined Last Online

    qgp9 Unfollow Follow
    GNU/Linux

    Best posts made by qgp9

    • NodeBB with Docker full chain ( nginx, redis, mongodb )

      I would like to introduce what I have done with a NodeBB and a docker.

      https://github.com/qgp9/nodebb-docker-dev

      This docker chain of Nginx, NodeBB, Redis, MongoDB(!!) is based on Alpine Linux and docker-compose.
      This design is mainly for developments and small standalone service rather than large distributable/scalable service.

      A Major Difference from other many(?) docker implementations is that I don't embed source and config files into images but just mount most of files on a host directory to containers even include NodeBB source and node_modules. There are pros and cons. I'll explain them briefly and we could discuss them.

      UPDATE

      A MongoDB is added as a default DB !!!
      And redis is intened to be used for websock blabla, but I'm not sure it's properly working.

      What I know actually, no errors, no warnings and I can see both of mongo and redis at admin web UI.

      If anybody would try this docker chain, please let me know results.

      !!! WARNING !!!
      I haven't checked yet how mongod and redis-server manage SIGTERM which docker send.
      This means that in worst case one can loose data !
      Does any body know about this?

      • mongod and redis-serverhas been checked. Safe with docker stop but not with docker kill

      Installation

      • This chain consists of 4 docker containers each of NodeBB, Redis, MongoDB, Nginx.
      • I don't provide compiled images but 10 mins will be more than enough to build them by yourself with this instructions. šŸ™‚
      • You will get error from a nginx docker if you already have any web server with port 80. I'll explain solutions after lines.
      git clone https://github.com/qgp9/nodebb-docker-dev.git nodebb-docker-dev
      cd nodebb-docker-dev
      git clone -b v1.x.x https://github.com/NodeBB/NodeBB.git nodebb
      ./bin/com-nodebb npm install
      ./bin/com-nodebb npm install socket.io-redis connect
      ./bin/com-nodebb npm setup
      ./bin/utils jq -M -s add nodebb/config.json conf/example/redis.josn > tmp.json && mv tmp.json nodebb/config.json
      ./bin/docker-compose up 
      
      • DB: mongo , DB address: mongodb , DB user: admin , no DB password
      • If you have a web server already, you have two options
        1. Remove a nginx from docker-compose.xml , connect a port 4567 of NodeBB to host, and you may know how you can connect from your webserver to http://127.0.0.1:4567 . Here is a example docker-compose.xml
        2. change a external port of a nginx docker ( example is 8080 ) and connect from your web server to http://127.0.0.1:8080. Here is a example docker-compose.xml

      Command line Settings, Upgrade, npm and so on

      When you want to do ./nodebb setup or ./nodebb upgrade or npm install on your nodebb, don't do it on Host directory. You have a helper script, do next.

      ./bin/com-nodebb ./nodebb setup
      ./bin/com-nodebb ./nodebb upgrade
      ./bin/com-nodebb npm install <package>
      

      Also you can open bash and do whatever you want

      ./bin/com-nodebb bash
      
      • But to edit/add/delete files, git pull, you can do it on the host directory ( or with docker, doesn't matter )

      Structure

      nodebb-docker-dev
      ā”œā”€ā”€ bin   
      │   ā”œā”€ā”€ com-nodebb      # Helper to control NodeBB docker
      │   └── docker-compose  # Docker version of docker-compose for portability
      ā”œā”€ā”€ conf                # All Dockerfile and configuration.
      │   ā”œā”€ā”€ nginx
      │   │   ā”œā”€ā”€ Dockerfile
      │   │   └── nginx.conf
      │   ā”œā”€ā”€ nodebb-dev
      │   │   └── Dockerfile
      │   └── redis
      │       ā”œā”€ā”€ Dockerfile
      │       └── redis.conf
      ā”œā”€ā”€ data
      │   ā”œā”€ā”€ nginx
      │   │   └── logs         # nginx, site logs
      │   ā”œā”€ā”€ nodebb           # Empty. reserved for future plans.
      │   └── redis            # dump.rgb ( db data ) , redis.log ( log file ) 
      ā”œā”€ā”€ docker-compose.yml
      └── nodebb               # NodeBB source will be here 
      
      • All configuration, data( log file ), NodeBB codes are mounted to dockers ( not copied ). So you can just edit them on a host directory.
      • All configurations are in a conf directory. All data files genereated by nginx, redis are in a data directory.
        • Exceptionally config.json and a logfile of NodeBB are in nodebb directory for easy management.
      • This desigin is aimed to archive easy and best development/management system for small standalone service.
        • Every improtant files are just under a main directory on a host and dockers act just like applications,
        • so you can remove/rebuild docker containers/images freely without any effect to data.
        • Also you can easily migrate this chain to new server. What you need is just copy the main directory to new server and rebuild dockers.
        • But large distributing/scaling can meet some side effects.

      Project Name

      When you build a system by ./bin/docker-compose up, you will see a wired long name of images/container like nodebbdockerdev_nginx by docker images or docker ps -a. This is because docker-compose use a directory name as a project nam.
      To get a short/readable name , you have recommontable 2 options.

      1. Change the directory name
      2. Shell variables ( RECOMMENDED but easilly one can make mistakes. smartcd can help )
        • export COMPOSE_PROJECT_NAME=qgp9
        • or you can embed this variable to ./bin/com-nodebb and ./bin/docker-compose
          Then you will see qgp9_nginx.

      And

      More details will be .. updated at the github repo soon.

      Any questions/comments/ideas/criticizing/WOW/BOO~ ?

      posted in Tutorials
      qgp9
      qgp9
    • [nodebb-plugin-magicblock] Macros, Color, Embeding

      I think this plugin is now reasonable working, so let me introduce nodebb-plugin-magicblock officially šŸ™‚

      NodeBB MagicBlock plugin

      NodeBB Plugin for macros, format, embeding.

      Updates

      • v0.1.8 : hackIframely. One can enable nodebb-plugin-iframely only in {{..}} without modifications of the iframely plugin. ( see a npm page )
      • v0.1.7 had a bug.

      Links

      • previous discussion at NodeBB Forum
      • npm
      • gihub repo : https://github.com/qgp9/nodebb-plugin-magicblock

      Summary

      • Please visit npm or gihub for details

      Magic

      {{ Any Link }}
      {{ http://i.imgur.com/HxvheyR.jpg }}
      {{ http://imgur.com/gallery/BxHKr }}
      

      Imgur gallery

      • image, imgur gallery are built in, and you can add more or override them.
      • Control iFramely by hackIframely: true in YAML ( see a npm page )

      Coloring

      {{#red This is red letters}}
      {{#red#green This is red letters on green background}}
      
      

      Coloring

      Class

      {{.myclass Any Text or Link }}
      {{.fa.fa-fw.fa-inbox}}
      

      class example

      Customizable Macros

      {{br}} -> <br/>
      {{ ALERT(info): This Info Box }}
      {{ ALERT: This is default alert Box }}
      {{ PANEL(success):  Body Only Panel }}
      {{ PANEL(warning, This is title): Panel with title }}
      

      Macros

      Nested Block

      {{ALERT: These are {{#blue blue letters}} In the Alert Box}}
      {{ALERT: This is {{ALERT(info): an Another Alert Box}} in the Alert Box }}
      

      Installation

      npm install nodebb-plugin-magicblock
      

      History

      • current version : v.0.1.3

      Acknowledge

      • This plugin is initialized on nodebb-mega-colors
      • Thanks to @frissdiegurke for a lot of comments and guiding.
      posted in NodeBB Plugins
      qgp9
      qgp9
    • Some ideas and on going development of new plugin called MagicBlock

      Hi everyone,

      After I felt that it's so difficult to write formatted text ( color, css class ...) with a sanitized markdown, I have started writing a new plugin called Magic Block. šŸ™‚

      A basic idea is a using of {{ }} block ( like mediawiki or wordpress ) with parameters like

      • {{.classname#color#BGcolor text of body }}
        • {{.myClass body }} will be <span class="myClass">body<span>
        • {{#red body}} will be <span style="color:red;"> body <span>
        • {{#red#000 body}} will be <span style="color:red;background-color:#000">body</span>
        • and also all toghter {{.classA.classB.classC#red#yello body}} will act in same manner.
      • If you put a link as a body, everything will be same as above but
        • {{.myclass http://example.com}} will be <a href="http://example.com" class="myclass">http://example.com</a>
        • Also the magic block supports {{#red [link](http://example.com)}} in same way.
      • if you just put just a link to the magic block, then real magic will be there so
        • {{ http://example.com/any.jpg }} will display a image ( currently with iFramely which means all iframely supported link will work )

      Actually I have done until here, and further plan is Macros like

      • {{macroName(parameter)#red text of body}} can do any special.
      • Also this can provide a simple but configurable macro action as a text expander via an admin interface

      Right now, codes are messy and no document, no configuration interface but some basic functionalities have been done.

      What do you think about these functionality and syntax?
      Are those too messy or conflicting with Markdown philosophy?
      Or do you have any better idea or any comments?

      • This is screenshot what current version of MagicBlock can do. ( iframely objects are hided by clicks )
        MagicBlock
      posted in Plugin Development
      qgp9
      qgp9
    • RE: Guide to install nodebb on docker?

      I made a docker chain of Nginx, NodeBB, Redis based on Alpine Linux for mainly developments and small standalone service.

      https://github.com/qgp9/nodebb-docker-dev

      I tested this on VULTR server and it works well
      No documentations yet, but soon šŸ™‚

      posted in General Discussion
      qgp9
      qgp9
    • An idea of new plugin html-preparser

      Hi, I'm back with a new idea again šŸ™‚

      After I made MagicBlock and got an issue of insecure images, I thought to make a plugin ( tentatively named long nodebb-plugin-secure-image-advance šŸ™‚ ) which include white list ( managed by human in first phase ) checking of images.

      But immediately I realized that it needs to handle <code> blocks again and this could be same for many other plugin which parse contents and filter it.

      So I bring new idea of pre html parsing plugin. This should be placed after a composer related plugin ( markdown ), plugin is better then a core's. And it can fire own filter hooks, and other plugin can use it.

      I also have thought some specs. Basic list of preparsing will be

      1. Replace <code>..</code> block with an unique string , and fire filter hooks. After all hooos, recover code blocks. I do same in Magicblock.
      2. Fire filter hooks with list of image tags.
      3. Fire filter hooks with list of link tags.

      This can reduce amount of resources for multiple parsings of whole contents for same purposes by plugins.

      Cons are also quite clear.

      1. Plugin dependency ( I think this is huge. Has NodeBB any solution for this? Or am I only one who doesn't know an already existing feature? šŸ™‚ )
      2. whole filtering structure of contents will become much more complicate.
      3. If many plugin doesn't use this, then maybe useless šŸ™‚

      So, personally, I want to have it, and I may do because I'll have own similar plugins more than two. But I want to hear comments from a community before.

      posted in Plugin Development
      qgp9
      qgp9
    • Does a sample data exists?

      Hi ,

      Do we have any sample data to test NodeBB?

      If any one have, or it will be good if there are some official data by NodeBB theam.

      OR, do we make some by community effort?

      With sample data and easy test systems, one can easily pre-view or check needs, and even it can be used for plugin developments.

      If there are no existing one and no plans by NodeBB team, then any volunteers to build it together?

      posted in General Discussion
      qgp9
      qgp9
    • RE: Does a sample data exists?

      @yariplus Yes, exactly that's what I meant. Specially, I like to see a cooperation between a community and a NodeBB team, so we could have balanced and abundant result.

      Also I'm thinking that, for example if we setup public workspace at http://c9.io with various version of NodeBB and sample data, one can easily clone it and test it.

      posted in General Discussion
      qgp9
      qgp9
    • RE: Some ideas and on going development of new plugin called MagicBlock

      @frissdiegurke,
      Thank you for advises.
      You threw a lot which will eat my weekend šŸ™‚
      I'll follow up your list slowly.

      AND

      @frissdiegurke said:

      In my opinion it's simply too much. I don't see the use of allowing all those markup. I like the simplicity of markdown and love the boundaries of it (with a few exceptions).
      Allowing safe HTML can be nice, but I think most of this community is used to markdown like me šŸ˜‰

      Actually, I agree with your opinion and that was my dilemma also.
      My needs were just colored text and a controllable inframely. And I'm using my plugin for only them. šŸ™‚
      simply {{#red TEXT}} and {{ URL }}

      But after I implemented those small functions, then I also thought somebody may want more exactly same as what you said in the end.

      ( Even now I'm back and thinking how admin can limit usages of users to keep clean by length? limit of functional?.. it's so ironic )

      posted in Plugin Development
      qgp9
      qgp9
    • Topic only RSS?

      Hi,

      Is there a way to have 'Topic Only RSS of Category or recent topic'?

      Default RSS of each category/topic is published with all posts.
      However, some times, depend on a characteristic of a forum or a category, reply posts can be usually short and too much for rss.

      I searched google and the forum but I wasn't lucky.

      posted in Technical Support
      qgp9
      qgp9
    • RE: Docker NodeBB v0.5

      I made a docker chain of Nginx, NodeBB, Redis based on Alpine Linux for mainly developments and small standalone service.

      https://github.com/qgp9/nodebb-docker-dev

      I tested this on a VULTR server and it works well .

      No documentations yet, but soon

      posted in General Discussion
      qgp9
      qgp9

    Latest posts made by qgp9

    • RE: Authentication, Mongo and Upstart

      @tqwhite Is it docker?

      posted in Technical Support
      qgp9
      qgp9
    • RE: Authentication, Mongo and Upstart

      @tqwhite

      My test

      In short, I tested ubuntu 14.04 and mongodb 3.2 from clean install with

      sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
      echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
      sudo apt-get update
      sudo apt-get install -y mongodb-org
      

      And added next to /etc/mongod.conf

      security:
        authorization: enabled
      

      And every thing is perfectly working. Even more funny thing is that, if one remove above authorization: enabled part, then mongod doesn't care of a password, which means any arbitrary passwords include empty string works fine with nodebb and mongodb

      Also mongod data filew are at /var/lib/mongodb. even I have no /data

      Question

      So I would like to ask how you installed mongodb. By compile?

      Some Information.

      Actually I installed mongodb 2.4 first and install mongodb 3.2 on it. And I found out /etc/mongodb.conf and /etc/init.d/mongod were not updated. This means, service mongod start will bring wrong configurations. One should do start mongod instead of service mongod start to use proper configurations via initctl

      posted in Technical Support
      qgp9
      qgp9
    • RE: Authentication, Mongo and Upstart

      Congratulations!

      By the way, can I know your OS version? I would like to test by myself also šŸ™‚

      posted in Technical Support
      qgp9
      qgp9
    • RE: Mailgun Setup from Mandrill

      @SimonQ said:

      The email is still not being sent through... Am I missing anything else? (I'm using the test email option that @julianlam suggested)

      Edit: I received it after a few minutes of typing this!

      • Edit : I missed second line begins with "Edit", congratulations šŸ™‚

      Have you checked email logs at mailgun site? That is the first thing you have to see.
      I always keep it opened while email testing šŸ™‚

      posted in General Discussion
      qgp9
      qgp9
    • RE: Authentication, Mongo and Upstart

      OK, now I think I got full stories šŸ™‚

      Actually, my first question to your situation is that

      @tqwhite said:

      When I type "mongod", it starts the Mongo daemon. After I do that, I can start and run nodebb with no problems at all. Works 100%.

      You might mean that you executed mongod at /var/lib/mongodb ( usually that is the data directory ), don't you?

      something like

      cd /var/lib/mongodb
      mongod
      
      posted in Technical Support
      qgp9
      qgp9
    • RE: Authentication, Mongo and Upstart

      @tqwhite said:

      I just can't figure out how to specify the equivalent of "auth=true" in YAML.

      I think you already did this, but just for sure.

      From https://docs.mongodb.org/manual/administration/configuration/

      security:
         authorization: enabled
      

      0_1458310939749_upload-5390aaff-31b6-406e-96fe-3f2214bfc6c9

      posted in Technical Support
      qgp9
      qgp9
    • RE: An idea of new plugin html-preparser

      So now, I have questions to the NodeBB development team. @julian

      1. About @frissdiegurke 's idea.

        • What do you think? Is it secure or do you have any better ideas, policies , plans?
      2. To manage dependencies between plugin,

        • Can we enforce to install and activate plugins by dependencies?
        • Or can we give warnings of wrong configurations, dependencies and so on by plugin on admin UI ( dash board? )?
      3. Do we have secure way to add/remove/modify custom data by plugin in a filtering pipe?

        • For example, on filtering hook, data.pluginData.<plugin name> can be always for plugins (means some sure for core will not use it for different reason!! ), whether they are removed or not after filtering. I know if I select good name( random or highly uniq), then it will be quite safe but it will be better if we have an official space.
      4. If I want to make a npm module which is dedicated to NodeBB while it's not a plugin, then what is good name for. Maybe nodebb-helper-any-name. It may be for individual plugins.

      I had one more, but I forgot what was it while writing.... šŸ™‚

      posted in Plugin Development
      qgp9
      qgp9
    • RE: Nodebb Docker commands?

      It's outdated, so don't use it.

      1. you can use just redis instead of nodebb/docker:ubuntu-redis and build nodebb image with Dockerfile of NodeBB ( from official github repo ), but only for testing purpose.
      2. Or check mine ( NodeBB with Docker full chain ( nginx, redis, mongodb ) ) šŸ™‚

      But here is genenal answers for your questions.

      Basically If a container is alive ( means if you can see the container with docker ps ) then you connect to bash shell

      docker exec -it <container name> bash
      

      If a container is Exit status, then it's more complicate. here An Golden Rule is that any modifications in containers is temporary and you will loose it. ( even there are ways to save a current container to image, but it's worst idea ).

      Basically you can't connect to a container in Exit status, but

      1. You can copy from or to the container with docker copy
      2. You can manage files if you mounted volumes
      3. After you solved problem then you can docker restart. BUT remember the Golden Rule

      So best idea is, I think, you have to be able to make your own Dockerfile with proper options from scratch( means from ubunt) or official docker image like redis.

      Docker is fun and powerful, fantastic, good to study, but much more complicate than without it before you have enough knowledge and skills. And even it will harm you easily.

      Nevertheless, I don't discourage you to use docker!!, I encourage it šŸ™‚
      I'm just giving a most important tip here. "Don't use docker for production before you know how to deal with a concept of a temporary container" but GOOD FOR TEST AND LEARN.

      Welcome to docker šŸ™‚

      And always do back them up. šŸ™‚

      posted in NodeBB Development
      qgp9
      qgp9
    • RE: Does a sample data exists?

      @charles one can make an import plugin, but an easiest and efficient way for (quick) testings will be just with redis data dump file. First, load redis with data file, and that's it.

      However, I agree that the importer can be better at some point.

      posted in General Discussion
      qgp9
      qgp9
    • RE: A harsh lesson learned

      @accalia Thank you for information. That sounds some inconvenient but may be good solution specially in budgets.

      Also let me introduce good and secure backup solution for a server.
      It's B2 Cloud storage by the BlackBlaze.
      This is similar with Amazon S3 rather than the CrashPlan or BlackBlaze backup.
      And quite cheap than S3.
      I did't implement this for my servers, but be seriously considering.

      0_1458236585241_upload-e5d1b31d-c5f3-4b75-ac20-0c3a3958eb7e

      posted in General Discussion
      qgp9
      qgp9