Hello appwrite team, I'm trying to create an appwrite function in python, which executes a command for scanning open ports on a url
Theres a tool for network scanning called "nmap" that allows me to do it, when im in linux i can install it in the terminal using the command:
sudo apt install nmap
And once I have nmap installed, I can run python scripts that use the subprocess library of python to run commands, I'll attach an example of the function I want to achieve and that uses the subprocess thing, so you guys can have an idea:
I don't really know where the appwrite functions run, but looking at the documentation it says that they are in an isolated docker container, my question is how can i install nmap in the docker container or wherever the function is so i can run the command nmap in my python script?
thanks !
Technically, it's not possible to install OS-level dependencies at the moment: https://github.com/appwrite/appwrite/issues/1037. That said...I wonder if you can spawn a sub process to install the program on function start š
The containers run in an alpine-based container so you can try to look into installing nmap using alpine's package manager
thanks for the response Steven <:appwriterocket:823996226894692403>
In the github link I see that they modify the dockerfile to add the library there, I still don't quite understand very well, but I'll take a look at that
but do you happen to have guidance on how to install libraries using alpine package manager š¤ , or any clues that might get me close to spawning a subprocess to install 'nmap' on function start by any chance?
No you can't modify the docker file or provide your own right now. You should š the issue.
Did you try searching for how to do it?
thanks, already liked the issue š
Currently im trying to do it this way:
I'll let you know if I succeed once I run the function
Apparently it worked! I made it return all the installed libraries and among them is nmap
the response:
{"installed_packages":["musl","busybox","alpine-baselayout","alpine-keys","ca-certificates-bundle","libcrypto1.1","libssl1.1","libretls","ssl_client","zlib","apk-tools","scanelf","musl-utils","libc-utils","ca-certificates","tzdata","ncurses-terminfo-base","ncurses-libs","libbz2","sqlite-libs","libffi","gdbm","xz-libs","expat","libintl","libtirpc-conf","krb5-conf","libcom_err","keyutils-libs","libverto","krb5-libs","libtirpc","libnsl","libuuid","readline",".python-rundeps","libgcc","lua5.3-libs","libpcap","pcre","libssh2","libstdc++","nmap"]}
I have not tried running nmap yet but for now It seems that the library was installed š
Hi @ianmont - is this solved? do you need more help with this?
its solved
[SOLVED] Need help installing a script in a Appwrite Function
Recommended threads
- [SOLVED] curl error Number: 6 ā function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...
- ClientException with SocketException: Cl...
hi <@564158268319203348> i have noticed this 500 status code in my function requests, it seems its not able to connect to the internet in the function as reque...
- mcp-server-appwrite 0.4 fails on startup...
Iām trying to use `mcp-server-appwrite` against Appwrite Cloud and the server authenticates successfully, but fails during startup validation when probing `tabl...