If you like BoxMatrix then please contribute Supportdata, Supportdata2, Firmware and/or Hardware (get in touch).
My metamonk@yahoo.com is not reachable by me since september. Please use hippie2000@webnmail.de instead.
Property:scgi server (avmcmd)
BoxMatrix >> Shell-Commands >> scgi_server (avmcmd) | @ BoxMatrix - IRC-Chat - Translate: de es fr it nl pl |
News | Selectors | Models | Accessories | Components | Environment | Config | Commands | System | Webif | Software | Develop | Lexicon | Community | Project | Gallery |
Startup-Scr | Hotplug-Scr | BusyBox-Cmds | Bash-Cmds | AVM-Cmds | Chipset-Cmds | Linux-Cmds | Shared-Libs | Kernel-Mods | Research |
Name-Collision - multiple objects in this wiki use the name scgi_server!
|
AVM-Command
Command: | scgi_server (avmcmd) - type Exec | Wiki | Freetz | IPPF | whmf | AVM | Web |
Location: | Shell-Commands >> AVM-Commands - Origin: AVM | ||||||
Path: | Release: /usr/bin Lab+Rel: /usr/bin | ||||||
Properties: | Size: 41.4k - 65.6k - Firmware: 7.39 - 7.51 | ||||||
Function: | Daemon to speed up CGI programs using the SCGI protocol. |
Goto: API-Scripts - Modules - Source - Dependencies - Model-Matrix - Symbols - SMW-Browser
Details
scgi_server is a daemon to speed up execution of CGI programs using the SCGI protocol.
SCGI is a protocol similar to FastCGI. Both are designed to speed up CGI programs executed by a Webserver. AVM uses SCGI to speed up the new REST-API which consists of a range of Lua-Scripts served on Port-8187-tcp to localhost and IPv4.
Currently it is only usable from within the box, but it is prepared for usage from LAN and from the Internet. 7530 fw 7.50:
root@fritz1:/var/media/ftp# netstat -tap | grep scgi_server tcp 0 0 localhost:8187 0.0.0.0:* LISTEN 925/scgi_server
The REST-API uses normal HTTP and the request methods GET, POST, PUT and DELETE. The request URL is construted like this:
http://localhost:8187/api/v0/<endpoint>[/<string>[/<string>[/<string>]]]?sid=<sid>[&<arg>=<val>]
The API still is unfinished that's why its version is v0
. An <endpoint>
is a function block for a specific topic.
In current implementation the request URI can have up to 3 <string>
levels.
Access requires a session id which is passed in <sid>
, same principle as used for the Webinterface.
Since the API is mainly used from withing Lua-Scripts of the Webinterface the <sid>
is just forwarded.
An <endpoint>
can either be a builtin of api.lua or a <endpoint>_rest.lua
module.
Besides this a selected subset of UI-Modules is accessible as <endpoint>
s.
fw 7.39 help:
root@fritz:/var/mod/root# scgi_server -? usage: scgi_server [options] options: -? - print this help -d - Start as scgi server. (NOTSET) -s - Stop the scgi server. (NOTSET) -p INTEGER - Set the port (scgi mode only). (8187) -m STRING - Set the main lua script. ("/usr/rest_api/api.lua") -a - Server allows all HTTP methods. (NOTSET) -v INTEGER - Set lua verbose level (0 ERROR-msg only, 1 += DEBUG-msg, 2+= INFO-msg). (0) -c - Enable C DEBUG-messages. (NOTSET) scgi_server
API-Scripts
The REST-API consists of a range of Lua-Scripts located in /usr/rest_api
. The main script is api.lua
.
This is a subset of the Lua-Scripts section, filtered for the path /usr/rest_api
:
Daily updated index of all lua scripts found scanning Firmware-Probes . Last update: 2023-02-06 06:31 GMT.
The label (static)
in the Script
column shows there are other objects in this wiki using this name.
The Mod
column shows the amount of models using the respective script. Click the column header to sort by this number.
Script | Mod | Firmware | Description | Path | Size/Bytes | Type | Origin |
---|---|---|---|---|---|---|---|
api.lua | 27 | 7.39 - 7.51 | REST-API Lua-Land - launched by scgi_server | /usr/rest_api | 10.3k - 19.8k | Script | AVM |
api_generic.lua | 27 | 7.39 - 7.51 | REST-API Generic Endpoints | /usr/rest_api | 5.3k - 8.4k | Script | AVM |
api_generic_filter.lua | 26 | 7.39 - 7.51 | REST-API TODO | /usr/rest_api | 14.0k - 14.8k | Script | AVM |
avmluamessages.lua | 27 | 7.39 - 7.51 | REST-API TODO | /usr/rest_api | 11.7k - 12.0k | Script | AVM |
dev_debug.lua | 6 | 7.39 - 7.51 | TODO | /usr/rest_api | 9.5k | Script | AVM |
error.lua | 27 | 7.39 - 7.51 | REST-API TODO | /usr/rest_api | 5.2k - 5.9k | Script | AVM |
espresso.lua | 27 | 7.39 - 7.51 | REST-API TODO | /usr/rest_api | 8.5k - 8.7k | Script | AVM |
fake_modules.lua | 13 | 7.39 | TODO | /usr/rest_api | 4.0k | Script | AVM |
landevice.lua | 17 | 7.39 - 7.51 | TODO | /usr/rest_api | 5.8k - 6.0k | Script | AVM |
obl.lua | 13 | 7.39 | TODO | /usr/rest_api | 28 | Script | AVM |
obl_fboxname.lua | 13 | 7.39 | TODO | /usr/rest_api | 8.0k | Script | AVM |
query_tree.lua | 15 | 7.39 | TODO | /usr/rest_api | 6.7k - 6.9k | Script | AVM |
resource.lua | 26 | 7.39 - 7.51 | REST-API TODO | /usr/rest_api | 1.1k | Script | AVM |
response.lua | 27 | 7.39 - 7.51 | REST-API Response API | /usr/rest_api | 3.6k - 4.4k | Script | AVM |
rest_api_const.lua | 27 | 7.39 - 7.51 | REST-API TODO | /usr/rest_api | 1.4k - 1.6k | Script | AVM |
rest_config.lua | 27 | 7.39 - 7.51 | REST-API TODO | /usr/rest_api | 3.8k - 4.0k | Script | AVM |
16 Lua scripts |
Modules
This is a subset of the Lua-Scripts section, filtered for the path /usr/rest_api
:
Daily updated index of all lua scripts found scanning Firmware-Probes . Last update: 2023-02-06 06:31 GMT.
The label (static)
in the Script
column shows there are other objects in this wiki using this name.
The Mod
column shows the amount of models using the respective script. Click the column header to sort by this number.
Script | Mod | Firmware | Description | Path | Size/Bytes | Type | Origin |
---|---|---|---|---|---|---|---|
boxnotify_rest.lua | 13 | 7.39 | TODO | /usr/rest_api | 2.3k | Script | AVM |
calllog_rest.lua | 13 | 7.39 | TODO | /usr/rest_api | 6.0k | Script | AVM |
faxjournal_rest.lua | 13 | 7.39 | TODO | /usr/rest_api | 3.6k | Script | AVM |
phonebook_rest.lua | 13 | 7.39 | TODO | /usr/rest_api | 12.9k | Script | AVM |
smarthome_rest.lua | 13 | 7.39 | TODO | /usr/rest_api | 39.8k - 44.2k | Script | AVM |
storagenasrights_rest.lua | 27 | 7.39 - 7.51 | REST-API TODO | /usr/rest_api | 10.8k - 11.7k | Script | AVM |
webusb_rest.lua | 27 | 7.39 - 7.51 | REST-API TODO | /usr/rest_api | 3.3k | Script | AVM |
7 Lua scripts |
Source
The names of source files compiled into an executable often help to understand function blocks (and show gaps in the docs).
fw 7.39 source files:
$ strings /usr/bin/scgi_server | grep -e '\.c$' -e '\.cpp$' ar7/ctlmgr/src/luacgi/scgi_server.c ar7/ctlmgr/src/luacgi/scgi_server_base.c ar7/ctlmgr/src/luacgi/scgi_server_utils.c ar7/ctlmgr/src/luacgi/escape_lua.c ar7/ctlmgr/src/luacgi/lua_json.c
Dependencies
Daily updated index of all dependencies of this command. Last update: 2023-02-06 07:23 GMT.
A *
in the Mod
column marks info from Supportdata-Probes, which will always stay incomplete.
Relation | Typ | Object | Mod | Firmware | Info | Origin |
---|---|---|---|---|---|---|
Started by | serv | scgi_server.service | 26 | 7.39 - 7.51 | supervisor service for scgi_server. | AVM |
Runs as | proc | scgi_server (process) | 5* | 7.39 - 7.51 | Daemon to speed up CGI programs using the SCGI protocol. | AVM |
Serving | port | Port-8187-tcp | 5* | 7.39 - 7.51 | Box REST-API provided by scgi_server. | AVM |
Depends on | lib | ld.so | 8 | 7.39 - 7.51 | Dynamic linker / loader | Linux |
Depends on | lib | libar7cfg.so | 27 | 7.39 - 7.51 | TFFS-Configuration API to ar7.cfg and many more. | AVM |
Depends on | lib | libavmauth.so | 27 | 7.39 - 7.51 | Fritzbox authentification helpers | AVM |
Depends on | lib | libavmcipher.so | 27 | 7.39 - 7.51 | AES / DES / Rijndael encryption / decryption. | AVM |
Depends on | lib | libavmcrypto.so | 27 | 7.39 - 7.51 | JWE encryption / decryption / key generator | AVM |
Depends on | lib | libavmcsock.so | 27 | 7.39 - 7.51 | Networking, I/O and helper functions | AVM |
Depends on | lib | libavmfbconf.so | 27 | 7.39 - 7.51 | API to hardcoded fbconf.cfg | AVM |
Depends on | lib | libavmfbstate.so | 27 | 7.39 - 7.51 | IPC fritzbox state notification | AVM |
Depends on | lib | libavmhmac.so | 27 | 7.39 - 7.51 | HMAC / SHA / MD5 hashing. | AVM |
Depends on | lib | libavmluautils.so | 27 | 7.39 - 7.51 | Utility Lua-Library | AVM |
Depends on | lib | libboxlib.so | 27 | 7.39 - 7.51 | Box status, logging and statistics functions | AVM |
Depends on | lib | libc.so | 27 | 7.39 - 7.51 | Standard C library | Linux |
Depends on | lib | libcm.so | 27 | 7.39 - 7.51 | ctlmgr / cm_logic messaging API | Linux |
Depends on | lib | libcrypto.so | 27 | 7.39 - 7.51 | OpenSSL general crypto and X.509 library | Linux |
Depends on | lib | libdl.so | 7 | 7.39 - 7.50 | Dynamic linking library | Linux |
Depends on | lib | libdputil.so | 27 | 7.39 - 7.51 | DataPipe / packet utilities | AVM |
Depends on | lib | libewnwjson.so | 27 | 7.39 - 7.51 | JSON helper functions | AVM |
Depends on | lib | libewnwlinux.so | 27 | 7.39 - 7.51 | Linux networking functions | AVM |
Depends on | lib | libewnwnet.so | 27 | 7.39 - 7.51 | Internet helper functions | AVM |
Depends on | lib | libjuisclient.so | 27 | 7.39 - 7.51 | Update-Search - second generation - JUIS | AVM |
Depends on | lib | liblua.so | 27 | 7.39 - 7.51 | Lua 5.1.4 interpreter library | Linux |
Depends on | lib | libm.so | 7 | 7.39 - 7.50 | C math library | Linux |
Depends on | lib | liboauth2.so | 27 | 7.39 - 7.51 | OAuth v2.0 authentificator | Linux |
Depends on | lib | libpthread.so | 7 | 7.39 - 7.50 | POSIX threading library | Linux |
Depends on | lib | librt.so | 7 | 7.39 - 7.50 | POSIX realtime extensions library | Linux |
Depends on | lib | libsvctl.so | 27 | 7.39 - 7.51 | supervisor notification library | AVM |
Depends on | lib | libtiinterpreter.so | 27 | 7.39 - 7.51 | Preprocessor for SSI-Files by TI. | AVM |
Depends on | lib | libwdt.so | 27 | 7.39 - 7.51 | AVM-Watchdogs management API | AVM |
Depends on | lib | libwebkpiclient.so | 23 | 7.39 - 7.51 | KPI sensor for system parts which use HTTP / HTTPS | AVM |
Depends on | lib | libwebsrv.so | 27 | 7.39 - 7.51 | HTTP / HTTPS webserver and tools. | AVM |
Depends on | lib | libyajl.so | 27 | 7.39 - 7.51 | Event-driven JSON parser | Linux |
Depends on | lib | libz.so | 27 | 7.39 - 7.51 | Zlib compressor / decompressor | Linux |
35 dependencies for this command |
Model-Matrix
Daily updated index of the presence, path and size of this command for each model. Last update: 2023-02-06 05:57 GMT.
Showing all models using this command. Click any column header (click-wait-click) to sort the list by the respective data.
The (main/scrpn/boot/arm/prx/atom)
label in the Model
column shows which CPU is meant for models with multiple Linux instances.
Note that this list is merged from Firmware-Probes of all known AVM firmware for a model, including Recovery.exe and Labor-Files.
Model | Firmware | Path | Size |
---|---|---|---|
FRITZ!Box 4040 | 7.39 | /usr/bin | 41.5k |
FRITZ!Box 4060 | 7.39 | /usr/bin | 41.5k |
FRITZ!Box 5590 Fiber (arm) | 7.39 | /usr/bin | 41.5k |
FRITZ!Box 6490 Cable (arm) | 7.39 | /usr/bin | 41.4k - 49.4k |
FRITZ!Box 6490 Cable (atom) | 7.39 | /usr/bin | 41.4k - 49.4k |
FRITZ!Box 6590 Cable (arm) | 7.39 | /usr/bin | 41.4k - 49.4k |
FRITZ!Box 6590 Cable (atom) | 7.39 | /usr/bin | 41.4k - 49.4k |
FRITZ!Box 6591 Cable (arm) | 7.39 | /usr/bin | 49.6k - 65.6k |
FRITZ!Box 6591 Cable (atom) | 7.39 | /usr/bin | 49.6k - 65.6k |
FRITZ!Box 6660 Cable (arm) | 7.39 | /usr/bin | 49.6k - 65.6k |
FRITZ!Box 6660 Cable (atom) | 7.39 | /usr/bin | 49.6k - 65.6k |
FRITZ!Box 6690 Cable (arm) | 7.39 - 7.50 | /usr/bin | 49.6k - 65.6k |
FRITZ!Box 6690 Cable (atom) | 7.39 - 7.50 | /usr/bin | 49.6k - 65.6k |
FRITZ!Box 6850 LTE | 7.39 | /usr/bin | 41.5k - 49.0k |
FRITZ!Box 6850 5G | 7.39 | /usr/bin | 41.5k |
FRITZ!Box 6890 LTE | 7.39 | /usr/bin | 49.0k - 57.4k |
FRITZ!Box 6890 LTE v1 | 7.39 | /usr/bin | 49.0k - 57.4k |
FRITZ!Box 6890 LTE v2 | 7.39 | /usr/bin | 49.0k - 57.4k |
FRITZ!Box 7490 (main) | 7.39 - 7.51 | /usr/bin | 53.1k |
FRITZ!Box 7510 | 7.39 | /usr/bin | 41.5k |
FRITZ!Box 7520 | 7.39 - 7.50 | /usr/bin | 41.5k |
FRITZ!Box 7520 v2 (arm) | 7.39 - 7.50 | /usr/bin | 41.5k |
FRITZ!Box 7530 | 7.39 - 7.51 | /usr/bin | 41.5k - 45.5k |
FRITZ!Box 7530 AX | 7.39 | /usr/bin | 41.6k - 45.6k |
FRITZ!Box 7590 | 7.39 - 7.51 | /usr/bin | 49.0k - 57.4k |
FRITZ!Box 7590 AX | 7.39 | /usr/bin | 49.0k - 57.4k |
FRITZ!Repeater 2400 | 7.39 | /usr/bin | 49.5k |
27 models use this command |
Symbols
Daily updated index of all symbols of this command. Last update: 2023-02-06 07:23 GMT.
Firmware | Symbol |
---|---|
7.39 - 7.51 | GetSessionId |
7.39 - 7.51 | IsAccessWithoutSidApi |
7.39 - 7.51 | OutputHTTPHeader |
7.39 - 7.51 | SetSessionId |
7.39 | escape_init |
7.39 - 7.51 | fork_server_start |
7.39 - 7.51 | is_logged_in |
7.39 - 7.51 | is_loginbutton_needed |
7.39 - 7.51 | login |
7.39 - 7.51 | login_from_addr |
7.39 - 7.51 | main |
7.39 - 7.51 | scgi_request_alloc |
7.39 - 7.51 | scgi_request_free |
7.39 - 7.51 | scgi_server_exit_lua_stack |
7.39 - 7.51 | scgi_server_init_lua_stack |
7.39 - 7.51 | scgi_server_load |
7.39 - 7.51 | scgi_server_load_request_vars |
7.39 | scgi_server_show_error |
7.39 - 7.51 | scgi_server_start |
7.39 - 7.51 | scgi_supportdata |
7.39 - 7.51 | set_no_sidrenew |
21 symbols for this command |