{"id":20859156,"url":"https://github.com/daemonite/fubar","last_synced_at":"2025-05-12T08:32:09.502Z","repository":{"id":3819270,"uuid":"4899626","full_name":"Daemonite/fubar","owner":"Daemonite","description":"A CouchApp for storing, exploring, and aggregating logs","archived":false,"fork":false,"pushed_at":"2012-11-15T06:30:07.000Z","size":385,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-03-26T15:02:31.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Daemonite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-05T06:40:24.000Z","updated_at":"2021-08-22T06:40:21.000Z","dependencies_parsed_at":"2022-09-04T02:22:38.168Z","dependency_job_id":null,"html_url":"https://github.com/Daemonite/fubar","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/Daemonite%2Ffubar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daemonite%2Ffubar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daemonite%2Ffubar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daemonite%2Ffubar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daemonite","download_url":"https://codeload.github.com/Daemonite/fubar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225130736,"owners_count":17425506,"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-18T04:48:48.958Z","updated_at":"2024-11-18T04:48:49.617Z","avatar_url":"https://github.com/Daemonite.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fubar\n\nFubar is a CouchApp for scalable storage, exploration, and aggregation of log records, with a particular focus on errors. It has:\n\n- an overview showing the activity of all applications\n- standard log view showing a particular log in reverse chronological order\n- a nicely formatted log detail page\n- a logs-by-session report\n- a logs-by-IP report\n- a common errors report (showing common errors in the last 7 days, overall and by-application)\n\n## Initial CouchDB Setup\n\n1. Install [Couch DB 1.2][downloadcouch]\n2. Go to [Futon][futon]\n3. Add an admin user to Couch\n4. Create an `errorlog` database\n\n### Simple - for behind firewalls and proxies\n\nThis setup is appropriate when Fubar will not require strong security. This might be appropriate if:\n\n- Fubar will only be accessible via `localhost`\n- there will be IP restrictions in place\n- a firewall or other authentication will in place\n\nSo on top of the basic CouchDB setup:\n\n1. Install the Fubar CouchApp to `errorlog`. You can either:\n    \n    - Use the [CouchApp Command Line Tool][couchapp], OR\n    - Replicate Fubar from an existing \"master\" installation\n    \n         {\n           source : \"http://username:password@your-source.com.au/sourceapp\",\n           target : \"http://localhost:5984/errorlog\",\n           filter : \"errorlog/design\"\n         }\n         \n2. Fubar should now be available by [browsing `errorlog`][logasapp].\n3. Set up Fubar to log to `errorlog`, no username or password required.\n\n### Secure - for public facing databases\n\nThis setup is appropriate when Fubar will be exposed on a public server. The gist of the setup is that the \nUI will be put in a lightly secured database, and the log itself in another strictly secured database. Thus\nusers can browse Fubar, but have to log in to access the data.\n\n1. Create a database called `errorapp`\n2. Edit `errorlog` and click \"Security\" - add your user to the list of admins AND users. You can also add \nless powerful users just to the users list.\n3. Install the Fubar CouchApp to `errorapp`. You can either:\n    \n    - Use the [CouchApp Command Line Tool][couchapp], OR\n    - Replicate Fubar from an existing \"master\" installation\n    \n         {\n           source : \"http://username:password@your-source.com.au/sourceapp\",\n           target : \"http://localhost:5984/errorapp\",\n           filter : \"errorlog/design\"\n         }\n         \n4. Fubar should now be available by [browsing `errorapp`][separateapp].\n5. Open Fubar and log in as an admin.\n6. Go to the Configuration page, and update the Log Database to `errorlog`\n7. Set up Fubar to log to `errorlog`, using the credentials for any user in the users list\n\n### Extra Credit\n\n#### Increasing login session length\n\n1. Go to the Futon [Configuration][futonconfig] section\n2. Edit the `couch_httpd_auth` timeout value.\n\n#### Database Compaction\n\nThe normal running of Couch can cause a lot of redundant data to build up - particularly after adding new documents.\n\n1. Go to the Futon [Configuration][futonconfig] section\n2. Scroll to the bottom of the page and click \"Add a new section\".\n3. section: `compactions`, option: `\\_default`, value: `[{db_fragmentation, \"70%\"}, {view_fragmentation, \"60%\"}, {from, \"23:00\"}, {to, \"04:00\"}]`\n\nFor more information about compaction options: [Compaction][compaction].\n\n#### Apache Proxy\n\nThe following can be set up to proxy Couch DB requests through an Apache Virtual:\n\n\tLoadModule  proxy_module         modules/mod_proxy.so\n\tLoadModule  proxy_http_module    modules/mod_proxy_http.so\n\tLoadModule  headers_module       modules/mod_headers.so\n\tLoadModule  deflate_module       modules/mod_deflate.so\n\t\n\tProxyRequests off\n\t\n\t\u003cLocation /\u003e\n\t\tProxyPass http://localhost:5984/\n        ProxyPassReverse /\n\t\u003c/Location\u003e\n\nThis also makes it easy to add IP restrictions. Note that you can also add rewrite rules, but be careful that they don't interfere with the paths Couch expects.\n\n## logging\n\nLogs are POSTed to the couch database (usually `errorlog`) as JSON objects. Except where excepted below, they are all strings. Required fields are:\n\n- **application**\n- **logtype**: logs in Fubar are almost always grouped by this value\n- **datetime**: this should be a string parsable by JavaScript; we use `mmmm, dd yyyy HH:mm:ss`\n\nOptional fields that are displayed automatically are:\n\n- **machinename**: the server\n- **instancename**: for cases where one server has multiple engine instances\n- **sessionid**: if this is available Fubar will link this to a view showing all logs for that session \n- **message**: if this is available (**error** logtype only) Fubar will link this to the application summary page, which shows how many of this error have occurred recently\n- **browser**: the user agent\n- **host**\n- **httpreferer**\n- **scriptname** \u0026 **querystring**: if these are available they will be displayed together as a link\n- **remoteaddress**: user's IP address; if this is available Fubar will link this value to a view showing all logs for that IP\n- **bot**: a string showing whether the application thought the user was a bot\n- **version**: an object; the `string` key will be displayed\n- **farcry**: an object; the `string` key will be displayed\n- **engine**: an object; the `string` key will be displayed\n\n### logtype\n\nIs used to group all logs displayed by Fubar, and is used as a hook for customising the log summary and detail templates. Fubar currently has templates for these logtypes:\n\n#### error\n\nThis logtype has an extra report in Fubar (Common Errors, which groups errors by **message**) that the others do not. The following extra fields are also displayed if available:\n\n- **type**: aka Exception Type\n- **detail**\n- **extended_info**\n- **queryError**\n- **sql**\n- **where**\n- **stack**: an array of template, line, location objects (if location == \"project\" then that stack line is emphasised)\n- **url**: aka Post-process URL (an object) - for cases where the URL as the application sees it is not the same as scriptname?querystring\n\n#### 404\n\n- **url**: aka Post-process URL (an object) - for cases where the URL as the application sees it is not the same as scriptname?querystring\n\n#### types / rules\n\nThese logtypes were added for [FarCry][farcry] CRUD logs.\n\n- **event**\n- **userid**\n- **object**: the id of the object in question\n- **objecttype**\n- **notes**\n\n#### security\n\n- **event**\n- **userid**\n- **notes**\n\n#### default\n\nYes, there is a default detail view. Log types that don't have a custom detail view simply display all the non-standard keys in the log record.\nKeep in mind that it is limited to what JavaScript's `toString` function can do.\n\n[downloadcouch]: http://couchdb.apache.org/#download\n[futon]: http://127.0.0.1/_utils/\n[couchapp]: http://couchapp.org\n[logasapp]: http://127.0.0.1/errorlog/_design/errorlog/index.html\n[separateapp]: http://127.0.0.1/errorapp/_design/errorlog/index.html\n[futonconfig]: http://127.0.0.1/_utils/config.html\n[compaction]: http://wiki.apache.org/couchdb/Compaction/\n[farcry]: http://www.farcrycore.org/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaemonite%2Ffubar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaemonite%2Ffubar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaemonite%2Ffubar/lists"}