This repository contains the source code for the following magic-network services:
- Magic Gateway Provider (to be used in conjunction with a router/AP device)
- Magic Payment Enabler (Service)
- Magic Privacy Enabler (Service)
The fastest way to install and run these services is to use docker. The recommended versions are:
- docker (18.06.1-ce+)
- docker-compose (1.22.0+)
Fork, improve and PR. View our contributing guide for more details.
The gateway's primary goals are to authenticate users, track usage, and charge for network usage. Any magic client user within range of your network may utilize your network as long as they agree with your pricing and rules.
To setup the gateway, you'll need:
- a Router/AP device.
- any x86 or ARM device to host the gateway server (for now)
The radius gateway server will ultimately by hosted on the network supplied by the router/AP, but we suggest using a pre-existing internet connection during setup. Support for external radius gateway servers running on cloud providers such as AWS is coming soon.
-
While on your gateway server device assuming a unix based system:
git clone https://github.com/magic-network/magic-agent cd magic-agent docker-compose up -d
-
Verify the gateway is running:
docker ps docker logs <container-id from output of previous command>
-
(optional) Stop the gateway
docker-compose down
- Configure your router to use WPA2-Enterprise. (external guide under development)
- Adjust gateway config with AP details and restart. (external guide under development)
- Verify connection with the magic-cli. (external guide under development)
For the gateway to run properly, you'll need to complete the config file found in the docker-compose.yml
file
"environments" section.
The gateway server extends a default config found at /magic/gateway/config/default-config.hjson
. Currently
supported options are found in the Gateway Configuration Reference. In order
to extend the default configuration:
-
Extend with docker-compose.yml environment variables. To override default config keys, specify the group and key separated by a underscore character, for example: ADMIN_ACCOUNT, or ADMIN_USER_MIN_BALANCE.
services: magic-agent: build: . image: magic-agent network_mode: "host" ports: - "1812:1812/udp" - "1813:1813/udp" - "5000:5000" environment: - ADMIN_ACCOUNT=0xdf6ce563D547D56cb60FD7211061a30366D16414 - BILLING_TYPE=session
-
Extend with a user-config.hjson file. Example user-config file found in
/conf/user-config.example.hjson
:- Create a file named
/conf/user-config.hjson
- Update with your specific settings
- Run
docker-compose build
on x86 machines ordocker-compose build --build-arg ARCH=armhf
on ARM machines in order to apply the changes.
- Create a file named
Not implemented yet.
Not implemented yet.