Comments (10)
Sure, totally open to a non-PHP approach. FastAPI is great, I've played with it a bit in the past.
from raspap-webgui.
quick update, i have the system info already implemented, moving on to wifi info:
the following parts i cannot implement because of having zero knowledge about php:
button in webinterface enables a systemd service (which is already installed, but not running) that runs this API
field in webinterface to let the user input a API key (because the API needs to be exposed to the eth0 interface to be of any use)
i'll continue this weekend
from raspap-webgui.
That was quick 😅 Re: PHP or implementing API endpoints, generally, I'm happy to give advice and/or contribute code as needed.
from raspap-webgui.
Image built successfully. Started the container per usual. The raspap-api.service
exited with a path error. Executing the following worked:
root@raspberrypi:/home/API# uvicorn main:app --host 0.0.0.0 --port 8081
insecure
INFO: Started server process [1511]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8081 (Press CTRL+C to quit)
INFO: 192.168.0.101:50949 - "GET /docs HTTP/1.1" 200 OK
INFO: 192.168.0.101:50952 - "GET /openapi.json HTTP/1.1" 200 OK
INFO: 192.168.0.101:51188 - "GET /ap HTTP/1.1" 200 OK
Opening http://raspberrypi.local:8081/docs loads the interactive FastAPI docs (very nice).
Tried several endpoints - all the ones I tested worked as expected. eg.:
GET http://raspberrypi.local:8081/ap
{
"driver": "nl80211",
"ctrl_interface": "/var/run/hostapd",
"ctrl_interface_group": "0",
"auth_algs": "1",
"wpa_key_mgmt": "WPA-PSK",
"beacon_int": "100",
"ssid": "raspi-webgui",
"channel": "1",
"hw_mode": "g",
"ieee80211n": "1 # 802.11n support (Raspberry Pi 3)",
"wpa_passphrase": "ChangeMe",
"interface": "/var/run/hostapd",
"wpa": "2",
"wpa_pairwise": "CCMP",
"country_code": "GB",
"ignore_broadcast_ssid": ""
}
Amazing work!
from raspap-webgui.
this is quite a big feature, so idk if this is anything "we" should want
from raspap-webgui.
Agreed that the level of effort is somewhat non-trivial. However it's a frequently requested feature #1372 #602 #393 (probably more examples) and would indeed make RaspAP more useful for IoT / HA applications.
I've been gradually moving the project toward more PHP class definitions (see contents of /src/RaspAP
) so it would make sense for an API to live here. Probably best to start with a few simple endpoints, eg., service status. We could also leverage an existing RESTful API framework, though my preference would be for something lean and minimal rather than a bloated 'kitchen sink' type framework.
from raspap-webgui.
cool!
Is it an idea, that i will try to create a PoC for an API with python (FastAPI)?
So we have a different script for the API on python than on the already existing webgui (on a different port).
Or do you want to have it per-sé integrated in the php code?
from raspap-webgui.
Hey @billz the API is progressing quite nicely, can i ask to get insider access?
i am implementing the wireguard api, and it would benefit to have API access to view the different configs imo.
what is your opinion on this?
the branch is quite cluttered, but if you're interested, here is the progress: https://github.com/NL-TCH/raspap-docker/tree/API-alpha
from raspap-webgui.
@billz can you give feedback on the branch?
all the GET requests are implemented, POST requests are only configured for the hostspot, and more are comming.
- TCH
from raspap-webgui.
@NL-TCH great! I'll carve out some time and give it a round of testing.
from raspap-webgui.
Related Issues (20)
- [Bug]: changing wifi password via config does not work HOT 4
- cannot start quick installer HOT 4
- [NOT a Bug]: create equal access rights for /etc/wireguard as /etc/openvpn HOT 6
- Add option to configure the firewall for IPTables or NFTables HOT 3
- [Bug]: RaspAP has no internet. Raspberry Pi Bookworm now has NFTables not IPTables HOT 2
- Invalid default DHCP configuration for wlan0 interface HOT 4
- [Bug]: Can't connect to 5Ghz AP HOT 1
- Insider repo not found HOT 4
- [Bug]: Wireless LAN is not working. HOT 1
- [Bug]: Cant save any Configurations HOT 1
- [Bug]: Critical security fixes, PR available https://github.com/RaspAP/raspap-webgui/pull/1546 HOT 1
- [Bug]: Night mode switch is not obeyed when changing themes
- [Bug]: Bridge-Mode breaking access to SSH / WebUI HOT 1
- [Bug]: Saving any settings triggers password manager extention to update password for the portal HOT 3
- Manage WLAN, LAN, WWAN and WAN subnets and routing table in the UI
- Implement NetworkManager or NMCLI backend to RaspAP
- [Bug]: iptables: Failed to initialize nft: Protocol not supported HOT 1
- [Bug]: Default configuration with wlan0 AP + eth0 connected to home broadband but no internet HOT 1
- problem with AVM fritzbox wiregurad config [Bug]: HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raspap-webgui.