forked from txn2/txwifi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:cjimti/iotwifi
- Loading branch information
Showing
9 changed files
with
166 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM arm32v7/golang:1.9 AS builder | ||
|
||
ENV GOPATH /go | ||
WORKDIR /go/src | ||
|
||
RUN go get github.com/bhoriuchi/go-bunyan/bunyan | ||
RUN go get github.com/gorilla/mux | ||
RUN go get github.com/gorilla/handlers | ||
|
||
RUN mkdir -p /go/src/github.com/cjimti/iotwifi | ||
COPY . /go/src/github.com/cjimti/iotwifi | ||
|
||
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o /go/bin/wifi /go/src/github.com/cjimti/iotwifi/main.go | ||
|
||
FROM arm32v6/alpine | ||
|
||
RUN apk update | ||
RUN apk add bridge hostapd wireless-tools wpa_supplicant dnsmasq iw | ||
|
||
RUN mkdir -p /etc/wpa_supplicant/ | ||
COPY ./dev/configs/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf | ||
|
||
WORKDIR / | ||
|
||
COPY --from=builder /go/bin/wifi /wifi | ||
ENTRYPOINT ["/wifi"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package iotwifi | ||
|
||
type SetupCfg struct { | ||
DnsmasqCfg DnsmasqCfg `json:"dnsmasq_cfg"` | ||
HostApdCfg HostApdCfg `json:"host_apd_cfg"` | ||
WpaSupplicantCfg WpaSupplicantCfg `json:"wpa_supplicant_cfg"` | ||
} | ||
|
||
type DnsmasqCfg struct { | ||
Address string `json:"address"` // --address=/#/192.168.27.1", | ||
DhcpRange string `json:"dhcp_range"` // "--dhcp-range=192.168.27.100,192.168.27.150,1h", | ||
VendorClass string `json:"vendor_class"` // "--dhcp-vendorclass=set:device,IoT", | ||
} | ||
|
||
type HostApdCfg struct { | ||
Ssid string `json:"ssid"` // ssid=iotwifi2 | ||
WpaPassphrase string `json:"wpa_passphrase"` // wpa_passphrase=iotwifipass | ||
Channel string `json:"channel"` // channel=6 | ||
Ip string `json:"ip"` // 192.168.27.1 | ||
} | ||
|
||
type WpaSupplicantCfg struct { | ||
CfgFile string `json:"cfg_file"` // /etc/wpa_supplicant/wpa_supplicant.conf | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.