Git Product home page Git Product logo

addon-octobox's Introduction

Community Hass.io Add-ons: Octobox

GitHub Release Project Stage License

GitLab CI Project Maintenance GitHub Activity

Bountysource Discord Community Forum

Buy me a coffee

Support my work on Patreon

Take back control of your GitHub notifications.

Octobox on the Home Assistant frontend

About

If you manage more than one active project on GitHub, you probably find GitHub notifications pretty lacking.

Notifications are marked as read and disappear from the list as soon as you load the page or view the email of the notification. This makes it very hard to keep on top of which notifications you still need to follow up on.

Most open source maintainers and GitHub staff end up using a complex combination of filters and labels in Gmail to manage their notifications from their inbox. If you are like me, try to avoid email, then you might want something else.

Octobox is a beautiful application that manages your GitHub notifications via GitHub’s API, allowing you to filter down by organization, project, notification type, or the reason why you are receiving the notification in the first place.

It is easy to drill down into the issues that matter to you in the current moment while still allowing you to be subscribed to projects that you’d like to keep an eye on. You can quickly address threads that you’ve authored yourself or remember that you still need to submit your review that someone requested. You can “star” long-running issues that you know might be important down the road.

A real must-have for every GitHub opensource contributor.

Installation

The installation of this add-on is pretty straightforward and not different in comparison to installing any other Hass.io add-on.

  1. Add our Hass.io add-ons repository to your Hass.io instance.
  2. Install the "Octobox" add-on.
  3. Register a GitHub application, and set the github_client_id and github_client_secret add-on options.
  4. Start the "Octobox" add-on
  5. Check the logs of the "Octobox" add-on to see if everything went well.

NOTE: Starting the add-on might take a couple of minutes (especially the first time starting the add-on).

NOTE: Do not add this repository to Hass.io, please use: https://github.com/hassio-addons/repository.

Docker status

Supports armhf Architecture Supports aarch64 Architecture Supports amd64 Architecture Supports i386 Architecture

Docker Layers Docker Pulls

Configuration

Note: Remember to restart the add-on when the configuration is changed.

Example add-on configuration:

{
  "log_level": "info",
  "github_client_id": "59e0ec28d71d42d60104",
  "github_client_secret": "3c63dfc42ecb8fc65bb27d3f6ae3f271846367fe",
  "username": "MarryPoppins",
  "password": "Supercalifragilisticexpialidocious",
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "sync_timeout": 600,
  "fetch_subject": true,
  "minimum_refresh_interval": 1,
  "allow_personal_access_token": false,
  "github_restrict_access": false,
  "github_organization_id": 0,
  "github_team_id": 0,
  "ipv6": false
}

Note: This is just an example, don't copy and paste it! Create your own!

Option: log_level

The log_level option controls the level of log output by the addon and can be changed to be more or less verbose, which might be useful when you are dealing with an unknown issue. Possible values are:

  • trace: Show every detail, like all called internal functions.
  • debug: Shows detailed debug information.
  • info: Normal (usually) interesting events.
  • warning: Exceptional occurrences that are not errors.
  • error: Runtime errors that do not require immediate action.
  • fatal: Something went terribly wrong. Add-on becomes unusable.

Please note that each level automatically includes log messages from a more severe level, e.g., debug also shows info messages. By default, the log_level is set to info, which is the recommended setting unless you are troubleshooting.

Option: github_client_id

The GitHub application client ID for Octobox. You can get this ID by registering a new application on GitHub.

For more information, please see the "Registering a GitHub application" chapter.

Note: This option support secrets, e.g., !secret github_client_id.

Option: github_client_secret

The GitHub application client ID for Octobox. You can get this secret by registering a new application on GitHub.

For more information, please see the "Registering a GitHub application" chapter.

Note: This option support secrets, e.g., !secret github_client_secret.

Option: username

Username for authenticating with the Octobox interface. Leaving the username field empty, will disable the authentication mechanism entirely.

Octox is already protected by a GitHub authentication, nevertheless, other users might still use your installation (still, they need to authenticate with their own GitHub account).

Setting a username/password can be added as an extra line of defense, to prevent users of using your installation for themselves.

This option is HIGHLY recommended in case you expose this add-on to the outside world.

Note: This option support secrets, e.g., !secret octobox_username.

Option: password

Password for authenticating with Octobox interface.

Note: This option support secrets, e.g., !secret octobox_password.

Option: ssl

Enables/Disables SSL (HTTPS) on the web interface of Octobox. Set it true to enable it, false otherwise.

Option: certfile

The certificate file to use for SSL.

Note: The file MUST be stored in /ssl/, which is the default for Hass.io

Option: keyfile

The private key file to use for SSL.

Note: The file MUST be stored in /ssl/, which is the default for Hass.io

Option: sync_timeout

The add-on will sync the notification automatically in the background using a special task. This option allows you to specify a timeout before each sync.

For example, setting this to 900 will automatically sync you the notifications every 15 minutes.

Option: fetch_subject

Experimental feature for downloading extra information about the subject of each notification, namely:

  • Author for Issues, Pull Requests, Commit Comments and Releases
  • State (open/closed/merged) for Issues, Pull Requests
  • Labels

This feature is enabled by default in this add-on, but can be disabled by setting this option to false.

If you want this feature to work for private repositories, you'll need to Customize the Scopes on GitHub adding the repo scope to allow Octobox to get subject information for private issues and pull requests.

Option: minimum_refresh_interval

You may allow users to set an auto-refresh interval that will cause a periodic sync and page reload when they are viewing notifications.

To disable this simply set the environment variable minimum_refresh_interval to 0. minimum_refresh_interval is the lowest number of minutes between auto-syncs that the add-on will allow.

Option: allow_personal_access_token

Octobox can optionally allow you to set a personal access token to use when querying for notifications. This must be enabled at add-on level, by setting this option to true.

Once that is set, users can set a personal access token on the Settings page (found on the user drop-down menu).

Option: github_restrict_access

You can restrict access to your Octobox instance, and only allow members of a GitHub organization or team. To limit access set the configuration option github_restrict_access to true. Next set either github_organization_id or github_team_id.

Option: github_organization_id

This option allows you to limit access to your add-on, by only allowing access to Octobox for members of a specific GitHub organization.

You can get an organization's ID with this curl command:

curl https://api.github.com/orgs/<org_name>

Option: github_team_id

This option allows you to limit access to your add-on, by only allowing access to Octobox for members of a specific GitHub team.

You can get a team's ID with this curl command:

curl https://api.github.com/orgs/<org_name>/teams

Find your team on the list and copy its ID.

Option: ipv6

Set this option too false to disable IPv6 support.

Option: i_like_to_be_pwned

Adding this option to the add-on configuration allows to you bypass the HaveIBeenPwned password requirement by setting it to true.

Note: We STRONGLY suggest picking a stronger/safer password instead of using this option! USE AT YOUR OWN RISK!

Option: leave_front_door_open

Adding this option to the add-on configuration allows you to disable authentication on the add-on by setting it to true and leaving the username and password empty.

Note: We STRONGLY suggest, not to use this, even if this add-on is only exposed to your internal network. USE AT YOUR OWN RISK!

Registering a GitHub application

Octobox works as a GitHub application. In order to work, this application must be registered with GitHub. Every registered OAuth application is assigned a unique Client ID and Client Secret, which is needed by this add-on.

Surf to the following URL to register a new GitHub application:

https://github.com/settings/applications/new

You can fill out every piece of information however you like, except the Authorization callback URL. This is easily the most important piece to set up your Octobox. It's the callback URL that GitHub returns the user to after successful authentication.

The configuration for Octobox should look something like this:

Registering a new application on GitHub

After creating it, GitHub should show you your GitHub's application Client ID and Client Secret.

Registered GitHub application showing credentials

Use them both in the matching add-on configuration options.

Embedding into Home Assistant

It is possible to embed Octobox directly into Home Assistant, allowing you to access your Octobox through the Home Assistant frontend.

Home Assistant provides the panel_iframe component, for these purposes.

Example configuration:

panel_iframe:
  octobox:
    title: Octobox
    icon: mdi:github-face
    url: http://addres.to.your.hass.io:3333

Changelog & Releases

This repository keeps a change log using GitHub's releases functionality. The format of the log is based on Keep a Changelog.

Releases are based on Semantic Versioning, and use the format of MAJOR.MINOR.PATCH. In a nutshell, the version will be incremented based on the following:

  • MAJOR: Incompatible or major changes.
  • MINOR: Backwards-compatible new features and enhancements.
  • PATCH: Backwards-compatible bugfixes and package updates.

Support

Got questions?

You have several options to get them answered:

You could also open an issue here GitHub.

Contributing

This is an active open-source project. We are always open to people who want to use the code or contribute to it.

We have set up a separate document containing our contribution guidelines.

Thank you for being involved! 😍

Authors & contributors

The original setup of this repository is by Franck Nijhof.

For a full list of all authors and contributors, check the contributor's page.

We have got some Hass.io add-ons for you

Want some more functionality to your Hass.io Home Assistant instance?

We have created multiple add-ons for Hass.io. For a full list, check out our GitHub Repository.

License

MIT License

Copyright (c) 2018 Franck Nijhof

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

addon-octobox's People

Contributors

dayofdoom avatar frenck avatar ludeeus avatar renovate-bot avatar timmo001 avatar tjorim avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

addon-octobox's Issues

Addon does not start after reboot

Problem/Motivation

After restart, the addon does not start (see Actual behavior).

Expected behavior

Addon starts on startup.

Actual behavior

INFO: Running database migrations...
/root is not writable.
Bundler will use /tmp/bundler/home/unknown' as your home directory temporarily. INFO: Syncing notifications... rake aborted! OpenSSL::Cipher::CipherError: /opt/app/models/user.rb:117:in effective_access_token'
/opt/app/workers/sync_notifications_worker.rb:15:in perform' /opt/config/initializers/custom_sidekiq_worker.rb:9:in perform_async_if_configured'
/opt/app/models/user.rb:74:in sync_notifications' /opt/lib/tasks/tasks.rake:6:in block (3 levels) in <top (required)>'
/opt/lib/tasks/tasks.rake:4:in `block (2 levels) in <top (required)>'
Tasks: TOP => tasks:sync_notifications
(See full trace by running task with --trace)

Steps to reproduce

Seem to be enough to restart the machine for the error to occur. I have it running after setup, then I reboot the machine, and it does not work. It isn't enough to restart the addon, but it seems to work to uninstall and install addon again (and do setup again).

Proposed changes

Permission denied to cd into /opt

Problem/Motivation

Cannot start the octobox add-on due to unable to create database. Log shows several errors indicating permission denied to do anything in /opt. I am running this on the hassOS2.2 beta image on Odroid-C2.

Expected behavior

Normal startup of octobox add-on application.

Actual behavior

full add-on log below

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 10-postgres: applying... 
[fix-attrs.d] 10-postgres: exited 0.
[fix-attrs.d] 11-octobox: applying... 
[fix-attrs.d] 11-octobox: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Octobox v0.3.1
 Take back control of your GitHub notifications
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 aarch64 / HassOS 2.2 / HA 0.77.1 / SU 128 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
INFO: Password is NOT in the Have I Been Pwned database! Nice!
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 20-initdb.sh: executing... 
could not change directory to "/opt": Permission denied
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /data/postgres ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
2018-08-31 14:04:20.346 CEST [12979] WARNING:  no usable system locales were found
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
Success.
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
could not change directory to "/opt": Permission denied
waiting for server to start....2018-08-31 14:04:22.853 CEST [12983] LOG:  listening on Unix socket "/run/postgresql/.s.PGSQL.5432"
2018-08-31 14:04:22.862 CEST [12983] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2018-08-31 14:04:22.898 CEST [12984] LOG:  database system was shut down at 2018-08-31 14:04:21 CEST
2018-08-31 14:04:22.906 CEST [12983] LOG:  database system is ready to accept connections
 done
server started
could not change directory to "/opt": Permission denied
CREATE DATABASE
could not change directory to "/opt": Permission denied
CREATE ROLE
could not change directory to "/opt": Permission denied
waiting for server to shut down...2018-08-31 14:04:23.790 CEST [12983] LOG:  received fast shutdown request
.2018-08-31 14:04:23.795 CEST [12983] LOG:  aborting any active transactions
2018-08-31 14:04:23.798 CEST [12983] LOG:  worker process: logical replication launcher (PID 12990) exited with exit code 1
2018-08-31 14:04:23.800 CEST [12985] LOG:  shutting down
2018-08-31 14:04:23.838 CEST [12983] LOG:  database system is shut down
 done
server stopped
[cont-init.d] 20-initdb.sh: exited 0.
[cont-init.d] 30-nginx.sh: executing... 

Steps to reproduce

Try to install and run the add-on on same image and hardware?

Proposed changes

not a clue

Adding username/password produces `htpasswd: command not found` error

Problem/Motivation

When adding a username/password the logs produce this error:

[cont-init.d] 30-nginx.sh: executing... 
/var/run/s6/etc/cont-init.d/30-nginx.sh: line 36: htpasswd: command not found

Full log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 10-postgres: applying... 
[fix-attrs.d] 10-postgres: exited 0.
[fix-attrs.d] 11-octobox: applying... 
[fix-attrs.d] 11-octobox: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Octobox v0.1.0
 Take back control of your GitHub notifications
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 20-initdb.sh: executing... 
[cont-init.d] 20-initdb.sh: exited 0.
[cont-init.d] 30-nginx.sh: executing... 
/var/run/s6/etc/cont-init.d/30-nginx.sh: line 36: htpasswd: command not found
[cont-init.d] 30-nginx.sh: exited 127.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.
 
 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

Steps to reproduce

Add a username/password to the add-on config

Error when starting the Postgres database server

Problem

When starting the add-on I get an error when starting the Postgres database server.

I did change Github to use 2FA, but afterwards I registered the application again at https://github.com/settings/applications/new, but that makes no difference.
Guess the 2FA doesn't influence the addon as it is registered as an OAuth application.

Log

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 10-postgres: applying... 
[fix-attrs.d] 10-postgres: exited 0.
[fix-attrs.d] 11-octobox: applying... 
[fix-attrs.d] 11-octobox: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Hass.io Add-on: Octobox v0.2.0

 Take back control of your GitHub notifications

 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 

INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 20-initdb.sh: executing... 
[cont-init.d] 20-initdb.sh: exited 0.
[cont-init.d] 30-nginx.sh: executing... 
Adding password for user gerard
[cont-init.d] 30-nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
INFO: Starting the Postgres database server...
INFO: Starting NGinx...
postgres: could not access the server configuration file "/data/postgres/postgresql.conf": Permission denied
[services.d] done.

System

Ubuntu 18.04.1 LTS / HA 0.75.3 / SU 126

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.