Remove autarco.toml from documentation and Docker files
* Fix up `docker-compose.yml` and Dockerfile * Ensure that `README.md` makes it to the build Docker container so the build does not fail * Update `README.md`
This commit is contained in:
parent
3c35c4fe72
commit
32a5fbc236
|
@ -12,7 +12,4 @@ docker-compose*
|
||||||
.gitignore
|
.gitignore
|
||||||
|
|
||||||
# TOML files
|
# TOML files
|
||||||
autarco.toml*
|
Rocket.toml
|
||||||
|
|
||||||
# Documentation
|
|
||||||
*.md
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ FROM docker.io/rust:1 as builder
|
||||||
|
|
||||||
# Build the dependencies first
|
# Build the dependencies first
|
||||||
RUN USER=root cargo new --bin autarco-scraper
|
RUN USER=root cargo new --bin autarco-scraper
|
||||||
WORKDIR ./autarco-scraper
|
WORKDIR /usr/src/autarco-scraper
|
||||||
COPY ./Cargo.* ./
|
COPY ./Cargo.* ./
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
RUN rm src/*.rs
|
RUN rm src/*.rs
|
||||||
|
|
45
README.md
45
README.md
|
@ -5,16 +5,36 @@ Autarco site/API to get statistical data of your solar panels.
|
||||||
|
|
||||||
## Building & running
|
## Building & running
|
||||||
|
|
||||||
First you need to provide your My Autarco credentials in the file
|
First, you need to provide your My Autarco credentials in the file
|
||||||
`autarco.toml` by setting the username and password. You can copy and modify `autarco.toml.example` for this:
|
`Rocket.toml` by setting the username, password and site ID.
|
||||||
|
You can copy and modify `Rocket.toml.example` for this:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Put your My Autarco credentials below
|
[default]
|
||||||
|
# ...
|
||||||
|
|
||||||
|
# Put your My Autarco credentials below and uncomment them
|
||||||
username = "foo@domain.tld"
|
username = "foo@domain.tld"
|
||||||
password = "secret"
|
password = "secret"
|
||||||
|
site_id = "abc123de"
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, using Cargo, it is easy to build and run Autarco Scraper, just run:
|
You can also change this configuration to use a different address and/or port.
|
||||||
|
(Note that Rocket listens on `127.0.0.1:8000` by default for debug builds, i.e.
|
||||||
|
builds when you don't add `--release`.)
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[default]
|
||||||
|
address = "0.0.0.0"
|
||||||
|
port = 8080
|
||||||
|
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
|
This will work independent of the type of build. For more about Rocket's
|
||||||
|
configuration, see: <https://rocket.rs/v0.5-rc/guide/configuration/>.
|
||||||
|
|
||||||
|
Finally, using Cargo, it is easy to build and run Autarco Scraper, just run:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ cargo run --release
|
$ cargo run --release
|
||||||
|
@ -24,21 +44,6 @@ $ cargo run --release
|
||||||
Running `/path/to/autarco-scraper/target/release/autarco-scraper`
|
Running `/path/to/autarco-scraper/target/release/autarco-scraper`
|
||||||
```
|
```
|
||||||
|
|
||||||
(Note that Rocket listens on `127.0.0.1:8000` by default for debug builds, i.e.
|
|
||||||
builds when you don't add `--release`.)
|
|
||||||
|
|
||||||
You can provide Rocket with configuration to use a different address and/or port.
|
|
||||||
Just create a `Rocket.toml` file that contains (or copy `Rocket.toml.example`):
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[default]
|
|
||||||
address = "0.0.0.0"
|
|
||||||
port = 8080
|
|
||||||
```
|
|
||||||
|
|
||||||
This will work independent of the type of build. For more about Rocket's
|
|
||||||
configuration, see: <https://rocket.rs/v0.5-rc/guide/configuration/>.
|
|
||||||
|
|
||||||
## API endpoint
|
## API endpoint
|
||||||
|
|
||||||
The `/` API endpoint provides the current statistical data of your solar panels
|
The `/` API endpoint provides the current statistical data of your solar panels
|
||||||
|
@ -54,7 +59,7 @@ GET /
|
||||||
A response uses the JSON format and typically looks like this:
|
A response uses the JSON format and typically looks like this:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{"current_w":23, "total_kwh":6159, "last_updated":1661194620}
|
{"current_w":23,"total_kwh":6159,"last_updated":1661194620}
|
||||||
```
|
```
|
||||||
|
|
||||||
This contains the current production power (`current_w`) in Watt,
|
This contains the current production power (`current_w`) in Watt,
|
||||||
|
|
|
@ -6,10 +6,14 @@ services:
|
||||||
build: .
|
build: .
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- 8066:8000
|
- 2356:8000
|
||||||
|
# Use a `Rocket.toml` or configure the credentials using environment variables below
|
||||||
volumes:
|
volumes:
|
||||||
- ./autarco.toml:/autarco-scraper/autarco.toml
|
- ./Rocket.toml:/autarco-scraper/Rocket.toml
|
||||||
environment:
|
environment:
|
||||||
ROCKET_ADDRESS: 0.0.0.0
|
|
||||||
ROCKET_LOG_LEVEL: normal # Available levels are: off, debug, normal, critical
|
ROCKET_LOG_LEVEL: normal # Available levels are: off, debug, normal, critical
|
||||||
|
# Put your My Autarco credentials below and uncomment them
|
||||||
|
# ROCKET_USERNAME: foo@domain.tld
|
||||||
|
# ROCKET_PASSWORD: secret
|
||||||
|
# ROCKET_SITE_ID: abc123de
|
||||||
shm_size: '2gb'
|
shm_size: '2gb'
|
||||||
|
|
Reference in New Issue