Fix bug where sendfile could not determine from user
Improve sending and receiving files example
Initial commit
Moshix and friends have updated FUNET-NJE for Linux. However, it requires some specific configuration and doesn't compile on my Linux (I use arch btw).
So, here is a Docker image!
You can find example configuration files for two nodes in the examples
folder. Docker
will mount the files at /etc/funetnje
in the container.
The default NJE port is 175
. The example configuration expects NODE1
port 175
to
be exposed as 1751
by Docker and NODE2
as 1752
.
First, update funetnje.cf
for both nodes:
IPADDRESS
to be the IP address of your computerTCPNAME
for the line to be the IP address of your computerThen, start two NJE nodes:
docker run -it --rm --name nje_node1 --hostname node1 -v $(pwd)/examples/node1:/etc/funetnje -p 1751:175 funetnje:latest
docker run -it --rm --name nje_node2 --hostname node2 -v $(pwd)/examples/node2:/etc/funetnje -p 1752:175 funetnje:latest
If successful, you should see the logs from the funetnje
process appear.
The image contains a nje
user who is a member of the funetnje
group.
To log in to NODE1
:
docker exec -it nje_node1 /bin/login -f nje
It is important to use /bin/login
to ensure that a utmp
record is created for the user, this
allows the funetnje
process to route messages to you.
The nje
.profile
run at login sets mesg y
allowing messages to be displayed.
To send a message to NODE2
:
send nje@node2 hello there!
Use the sendfile
, qrdr
and receive
commands to send and receive files.
Unlike messages, you do not need to be logged in to the container and, therefore, you can run the commands using docker exec
.
To send a file to NODE2
:
cat local_file.txt | docker exec -i -u nje nje_node1 sendfile nje@node2
Then, view spooled files on NODE2
:
docker exec -u nje nje_node2 qrdr
Finally, receive the file on NODE2
and write it out stdout
:
docker exec -u nje nje_node2 receive -o - 0001