{"id":21158273,"url":"https://github.com/simbo/simbo.ninja","last_synced_at":"2025-03-14T15:27:12.117Z","repository":{"id":141796004,"uuid":"54415041","full_name":"simbo/simbo.ninja","owner":"simbo","description":"My private playground.","archived":false,"fork":false,"pushed_at":"2016-05-05T09:59:55.000Z","size":3979,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T09:09:17.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://simbo.ninja/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-21T19:00:22.000Z","updated_at":"2017-01-27T16:20:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"5caaefca-266c-4a69-8754-b2006e42560e","html_url":"https://github.com/simbo/simbo.ninja","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fsimbo.ninja","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fsimbo.ninja/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fsimbo.ninja/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fsimbo.ninja/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simbo","download_url":"https://codeload.github.com/simbo/simbo.ninja/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243599802,"owners_count":20317164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T12:19:28.079Z","updated_at":"2025-03-14T15:27:12.093Z","avatar_url":"https://github.com/simbo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"simbo.ninja\n===========\n\n  \u003e My private playground.  \n  \u003e [simbo.ninja](http://simbo.ninja/)\n\n--\n\n**EVERYTHING IS DRAFT AND IN PROGRESS**\n\n\u003c!-- MarkdownTOC depth=4 --\u003e\n\n- [General Setup](#general-setup)\n- [Development](#development)\n  - [Vagrant](#vagrant)\n  - [Gulp](#gulp)\n  - [Testing](#testing)\n- [Uberspace](#uberspace)\n  - [Setup](#setup)\n    - [nginx](#nginx)\n    - [couchdb](#couchdb)\n    - [node.js](#nodejs)\n    - [pm2](#pm2)\n\n\u003c!-- /MarkdownTOC --\u003e\n\n--\n\n\n## General Setup\n\nThe project is hosted using a shared host on [uberspace](https://uberspace.de/),\ntherefore services are not using default ports.\nVagrant is used for local development and production environment is given as far\nas necessary.\n\nThe project contains\n\n  - a nginx server, serving static files and as proxy for node.js app\n  - a couchdb\n  - a node.js app using express\n\n\n## Development\n\n\n### Vagrant\n\nAfter a `vagrant up`, the machine should be provisioned and services should be\nrunning.\n\n  - **Website**  \n    [localhost:8080](http://localhost:8080/) or [10.0.0.5:52323](http://10.0.0.5:52323/)\n\n  - **CouchDB Futon**  \n    [10.0.0.5:52322/_utils/](http://10.0.0.5:52322/_utils/)\n\n\n### Gulp\n\nRun `gulp` within project root to list available tasks with descriptions.\n\n**Common gulp tasks:**\n\n  - **`build`** ➜ `[clean], [copy + build:css + build:js + build:site]`  \n    *clean and rebuild all static files*\n\n  - **`dev`** ➜ `build, [browsersync + watch]`  \n    *build and watch static files, serve via browsersync*\n\n  - **`release:www`** ➜ `env:prod, build, uberspace:rsync-www`  \n    *build in production environment and rsync static files to uberspace*\n\n  - **`nginx-conf`** ➜ `clean:nginx-conf, build:nginx-conf, uberspace:rsync-nginx-conf, uberspace:reload-nginx`  \n    *generate production nginx config, rsync to uberspace and reload nginx*\n\n  - **`release:app`** ➜ `uberspace:rsync-app, uberspace:after-rsync-app`  \n    *rsync app and dependencies to uberspace, install production packages, apply production config and restart app via pm2*\n\n\n### Testing\n\nTests are organized in subfolders and will run recursively when using the \ndefault command.\n\n``` bash\n# run all tests\nnpm run test\n# with watching enabled\nnpm run test-watch\n# only run tests in within subfolder 'app/modules'\nnpm run test -- test/app/modules\n# only run tests matching description pattern\nnpm run test -- --grep ^app/\n```\n\n\n## Uberspace\n\n  - **Website**  \n    [simbo.ninja](http://simbo.ninja/)\n\n  - **CouchDB Futon**  \n    [simbo.libra.uberspace.de/couchdb/_utils/](https://simbo.libra.uberspace.de/couchdb/_utils/)\n\n\n### Setup\n\n\n#### nginx\n\nnginx has to be installed and updated manually.\n\n``` bash\n# download, unpack, configure and install latest nginx\nwget http://nginx.org/download/nginx-1.7.9.tar.gz \ntar xf nginx-1.7.9.tar.gz \u0026\u0026 cd nginx-1.7.9\n./configure --prefix=$HOME/nginx --with-http_realip_module --with-ipv6\nmake \u0026\u0026 make install\n\n# symlink binary and create service\nln -s ~/nginx/sbin/nginx ~/bin\nuberspace-setup-service nginx ~/nginx/sbin/nginx\n\n# restart service\nsvc -du ~/service/nginx\n\n# reload nginx config\nnginx -s reload\n```\n\nnginx is listening on custom port 52323. Nevertheless it is available via port\n80 using pound proxy for my domain. (Thanks to uberspace team for custom config!)\n\nnginx config is located at `~/nginx/conf`. Beside other rules, the `nginx.conf`\nhas to contain the following:\n\n``` nginx\ndaemon off;\n\nhttp {\n  set_real_ip_from 127.0.0.1;\n  set_real_ip_from ::1;\n  real_ip_header X-Forwarded-For;\n}\n```\n\n\n#### couchdb\n\nFor details, see [couchdb](https://wiki.uberspace.de/database:couchdb) \nin uberspace wiki.\n\n``` bash\n#setup couchdb service\nuberspace-setup-couchdb\n\n# change port in couchdb.ini\nsed -i \"s/^\\(port\\s*=\\s*\\).*$/\\152324/\" ~/couchdb.ini\n\n# restart service\nsvc -du ~/service/couchdb\n```\n\nEdit `.htaccess` in `/var/www/virtual/simbo/html/` to rewrite `/couchdb/`:\n\n``` apache\nRewriteEngine on\nRewriteBase /\nRewriteCond %{HTTPS} on [OR]\nRewriteCond %{ENV:HTTPS} on\nRewriteRule ^couchdb/(.*) http://localhost:52324/$1 [P]\n```\n\n\n#### node.js\n\nFor details, see [node.js](https://wiki.uberspace.de/development:nodejs)\nin uberspace wiki.\n\nEdit and reload `~/.bash_profile`:\n\n``` bash\nexport PATH=/package/host/localhost/nodejs-5.7.0/bin:$PATH\n```\n\nInstall and configure latest npm:\n\n``` bash\nnpm i -g npm@latest\nnpm config set cache-lock-stale 604800000\nnpm config set cache-min 86400\nnpm config set progress false\nnpm config set loglevel error\n```\n\n\n#### pm2\n\nFor details, see [daemontools](https://wiki.uberspace.de/system:daemontools)\nin uberspace wiki.\n\n``` bash\n# install\nnpm i -g pm2@1.0.2\n\n# start app via pm2; save process list; stop app; kill pm2 daemon\npm2 start /var/www/virtual/simbo/nginx/simbo.ninja/src/config/pm2.json\npm2 save\npm2 stop 0\npm2 kill\n\n# setup pm2 as a service\nuberspace-setup-service pm2 ~/bin/pm2 resurrect --no-daemon\n\n# restart service\nsvc -du ~/service/pm2\n```\n\n\n##### App management\n\n``` bash\n# restart|stop|start\npm2 restart 0\npm2 stop 0\npm2 start 0\n# monitor app process\npm2 monit 0\n# show live log\npm2 log 0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Fsimbo.ninja","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimbo%2Fsimbo.ninja","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Fsimbo.ninja/lists"}