{"id":13598044,"url":"https://github.com/fxbox/foxbox","last_synced_at":"2025-04-10T06:30:50.928Z","repository":{"id":79824142,"uuid":"50702140","full_name":"fxbox/foxbox","owner":"fxbox","description":"The FoxBox daemon","archived":false,"fork":false,"pushed_at":"2017-02-21T21:52:40.000Z","size":3627,"stargazers_count":29,"open_issues_count":76,"forks_count":29,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-02T17:32:36.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fxbox.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}},"created_at":"2016-01-30T01:13:10.000Z","updated_at":"2024-04-30T08:19:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"cfdf8c5f-e49e-46a2-844f-76f2b774d83d","html_url":"https://github.com/fxbox/foxbox","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/fxbox%2Ffoxbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fxbox%2Ffoxbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fxbox%2Ffoxbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fxbox%2Ffoxbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fxbox","download_url":"https://codeload.github.com/fxbox/foxbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223427432,"owners_count":17143291,"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-08-01T17:00:46.836Z","updated_at":"2024-11-06T22:31:13.977Z","avatar_url":"https://github.com/fxbox.png","language":"Rust","funding_links":[],"categories":["others","Rust"],"sub_categories":[],"readme":"# FoxBox\n\n[![Build Status](https://travis-ci.org/fxbox/foxbox.svg?branch=master)](https://travis-ci.org/fxbox/foxbox)\n[![Coverage Status](https://coveralls.io/repos/github/fxbox/foxbox/badge.svg?branch=master)](https://coveralls.io/github/fxbox/foxbox?branch=master)\n[![License](https://img.shields.io/badge/license-MPL2-blue.svg)](https://raw.githubusercontent.com/fxbox/foxbox/master/LICENSE)\n\n\n## Technologies\n\n### Rust\n\nWe're using Rust for the daemon/server.\n\nCurrently a fairly recent nightly is required. To determine which version of rust is being used, check the [.travis.yml](https://github.com/fxbox/foxbox/blob/master/.travis.yml) file.\n\nLook for these lines near the top of the file:\n```yaml\nrust:\n  - nightly-YYYY-MM-DD\n```\n\nIt's recommended that you use `rustup` to install and switch between versions\nof Rust and available toolchains. You should then be able to then use:\n```\ncd /your/path/to/foxbox     # Required, otherwise you might replace rustc for another project\nrustup override set nightly-YYYY-MM-DD   # Replace with the correct date you found\n```\n\nAfter that, you should be all set in regard to compiling the project.\n\n#### :warning: Warning\n\nSometimes, there might be a 1-day-difference between the date shown in `.travis.yml` and the one reported by `rustc`. For example [nightly-2016-04-06](https://static.rust-lang.org/dist/2016-04-06/) corresponds to:\n```bash\n$ rustc -V\nrustc 1.9.0-nightly (241a9d0dd 2016-04-05)\n```\n\n#### Build requirements\n\n| Dependency   | Debian/Raspian        | Fedora          | Arch               | OS X (Homebrew) |\n| ------------ | --------------------- | --------------- | ------------------ | --------------- |\n| `libupnp`    | `libupnp-dev`         | `libupnp-devel` | `extra/libupnp`    | `libupnp`       |\n| `libssl`     | `libssl-dev`          | `openssl-devel` | via `base-devel`   | `openssl`       |\n| `libev`      | `libev-dev`           | `libev-devel`   | `?`                | `libev`         |\n| `libavahi`   | `libavahi-client-dev` | `avahi-devel`   | `extra/avahi`      | `n.a.`          |\n| `libsqlite3` | `libsqlite3-dev`      | `sqlite-devel`  | `core/sqlite`      | `sqlite`        |\n| `libespeak`  | `libespeak-dev`       | `espeak-devel`  | `community/espeak` | `espeak`        |\n| `libdbus`    | `?`                   | `dbus-devel`    | `core/libdbus`     | `d-bus`         |\n| `libudev`    | `libudev-dev`         | `?`             | `n.a.`             | `n.a.`          |\n| `pkg-config` | `pkg-config`          | `?`             | `pkg-config`       | `pkg-config`    |\n\n### Node\n\nWe're using Node to run Selenium tests. Currently v4.x LTS. We plan to stay on\nstable LTS releases. It's recommended that you use\n[`nvm`](https://github.com/creationix/nvm) to install and switch between\nversions of Node.\n\n\n## Target hardware\n\nWe're using the Raspberry Pi 2 as a prototyping target (ARMv7). The target\noperating system is the latest Raspbian which is based on Debian 8.0 Jessie.\n\n\n## Contributing\n\nNote: We're in an iterative prototyping phase of the project. Things are moving\nreally fast so it may be easier to contribute when the dust starts to settle.\nYou've been warned. :shipit:\n\n### Forks and feature branches\n\nYou should fork the main repo and create pull requests against feature branches\nof your fork. If you need some guidance with this see:\n\n - https://guides.github.com/introduction/flow/\n - http://scottchacon.com/2011/08/31/github-flow.html\n\n\n## Setup\n\n```bash\n$ git clone git@github.com:\u003cusername\u003e/foxbox.git\n$ cd foxbox\n```\n\n### Extra steps for Mac OS X\n\nFoxbox requires some up-to-date libraries (like OpenSSL). In order to make sure\nyou have the correct packages and bindings, we recommend you install `brew` and\nrun:\n\n``` bash\nbrew install openssl libupnp sqlite libev\nexport LIBRARY_PATH=/usr/local/lib\n```\n\n## Build time options\n### Disable authentication\nYou may want to disable endpoints authentication to ease your development process. You can do that by removing `authentication` from the `default` feature in the `Cargo.toml` file.\n\n```conf\n[features]\ndefault = []\nauthentication = []\n```\n\n## Runtime dependencies\n\nFoxbox expects certain executables to be available in the `PATH` during its execution.\nSome are third party, others are built as components found in the `components`\ndirectory.\n\n| Dependency     | Optional?                                      | Where to find it                                                                                              |\n| -------------- | ---------------------------------------------- |-------------------------------------------------------------------------------------------------------------- |\n| `dnschallenge` | No (required for LetsEncrypt DNS-01 challenge) | Built as a binary with `cargo build` in the same target directory as foxbox, see `target/\u003cprofile\u003e` directory |\n| `bash`         | No (required for LetsEncrypt client)           | System package manager                                                                                        |\n\n## Running the daemon\n\n```bash\n$ ./run.sh\n```\n\nThere are several command line options to start the daemon:\n\n```bash\n-v, --verbose : Toggle verbose output.\n-l, --local-name \u003chostname\u003e : Set local hostname. Linux only. Requires to be a member of the netdev group.\n-p, --port \u003cport\u003e  : Set port to listen on for http connections. [default: 3000]\n-w, --wsport \u003cwsport\u003e : Set port to listen on for websocket. [default: 4000]\n-d, --profile \u003cpath\u003e : Set profile path to store user data.\n-r, --register \u003curl\u003e : URL of registration endpoint [default: https://localhost:4443]\n-t, --tunnel \u003ctunnel\u003e : Set the tunnel endpoint hostname. If omitted, the tunnel is disabled.\n-s, --tunnel-secret \u003csecret\u003e : Set the tunnel shared secret. [default: secret]\n-c, --config \u003cnamespace;key;value\u003e :  Set configuration override\n-h, --help : Print this help menu.\n--disable-tls : Run as a plain HTTP server, disabling encryption.\n--dns-domain \u003cdomain\u003e : Set the top level domain for public DNS. If omitted, the tunnel is disabled\n--dns-api \u003curl\u003e : Set the DNS API endpoint\n```\n\nCurrently you would likely want to start the daemon like this:\n\n```bash\n./run.sh -- -r https://knilxof.org:4443 --disable-tls\n```\n\nThat means that your foxbox will be using our dev [registration server](https://wiki.mozilla.org/Connected_Devices/Projects/Project_Link/Registration_Server) and you will be disabling [TLS](https://wiki.mozilla.org/Connected_Devices/Projects/Project_Link/TLS) support. We hope to have out-of-the-box TLS support ready pretty soon, but for now disabling it is the easiest way to run foxbox.\n\nIf you want to use TLS you'll likely want to add `target/\u003cprofile\u003e` (eg:\n`target/debug`) to your PATH so that `dnschallenge` is found properly.\n\n### Enable tunneling support\n\nIf you want to access your foxbox from outside of the network where it is running, you'll need to enable [tunneling](https://wiki.mozilla.org/Connected_Devices/Projects/Project_Link/Tunneling) support. To do that you need to specify the address of the tunneling server that you want to use and the shared secret for this server (if any) to access to your foxbox from outside of your foxbox' local network.\n\n```bash\n./run.sh -- -r https://knilxof.org:4443 -t knilxof.org:443 -s secret --disable-tls\n```\n\nIn the example above, `knilxof.org:443` is the location of our tunneling dev server, which has a not-that-secret-anymore value that you'll need to ask for on [IRC](https://wiki.mozilla.org/Connected_Devices/Projects/Project_Link#IRC). You are supposed to substitute `\u003cyourname\u003e` by the subdomain of your choice, but take into account that you'll need to keep the domain name of the tunneling server, in this case `.knilxof.org`. Starting the daemon with the command line options above you should be able to access your foxbox through `http://yourname.knilxof.org`.\n\n### Custom local hostname\n\nTo run with custom local host name (eg. foxbox.local):\n\n```bash\n$ ./run.sh -- -l foxbox\n```\n\n__NOTE:__ currently changing of host name is done via ```avahi-daemon``` and therefore supported only on Linux platform. To be able to change local host machine name user must be either included into ```netdev``` group or allow any other suitable user group to manage host name by adding the following policy to ```/etc/dbus-1/system.d/avahi-dbus.conf```:\n```xml\n\u003cpolicy group=\"any_suitable_group_name\"\u003e\n  \u003callow send_destination=\"org.freedesktop.Avahi\"/\u003e\n  \u003callow receive_sender=\"org.freedesktop.Avahi\"/\u003e\n\u003c/policy\u003e\n```\n\n### Custom Philips Hue nUPNP server\n\n```\n$ ./run.sh -- -c \"philips_hue;nupnp_url;http://localhost:8002/\"\n```\n\n## Interacting with the daemon\n\nOnce you have your foxbox up and running you can try our [demo application](https://github.com/fxbox/app) by browsing to [https://fxbox.github.io/app](https://fxbox.github.io/app).\n\nAlternatively, you can use the foxbox' current [REST API](https://wiki.mozilla.org/Connected_Devices/Projects/Project_Link/Taxonomy#Current_REST_API)\n\n## Rust tests\n\n```bash\n$ cargo test\n```\n\n## Selenium tests\n\nYou'll need to make sure you install the dependencies via:\n\n```bash\n$ npm install\n```\n\nThen you can run the Selenium tests via:\n\n```bash\n$ ./run.sh -- --disable-tls\n$ npm run test-selenium\n```\n\n## Cross compiling to ARM\n\nThere is no one solution for this. The process will be different depending on\nyour operating system. You may be able to build on a RPi, but the larger the\napplication gets, the slower and more painful this will be (not recommended).\n\n### Linux\n\nThere is support to cross-compile with a Docker image targetting the Raspberry Pi\n(model 2 and up) in the `tools/docker` directory.\n\nFor an extensive write-up about cross compiling Rust programs see:\n\n - https://github.com/japaric/rust-cross\n\n\n### Mac OS X\n\nCross compiling on Mac hasn't been documented. A PR is welcomed. :wink:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffxbox%2Ffoxbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffxbox%2Ffoxbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffxbox%2Ffoxbox/lists"}