Skip to content

Share data from fire weather stations and other related sources. Replaces a legacy FTP service known as SCADA

Notifications You must be signed in to change notification settings

icefoganalytics/weather-transfer-files

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Transfer Files

Content coming soon...

Development

  1. Build the container via

docker-compose build

  1. Boot the container via

docker-compose up

  1. Go to localhost in your browser to see the app landing page.

  2. Go to localhost/ to see the upload files by group.

  3. Connect to the server via sftp to test connection.

sftp -P 22 group_b@localhost
# verify server fingerprint
# enter group b's password as seen in the sftp/users.conf file

Production

  1. Duplicate the example sftp/users.conf.example file and edit as desired.
cp sftp/users.conf.example sftp/users.conf
nano sftp/users.conf
  1. Generate a ed25519 and rsa key files via:
ssh-keygen -t ed25519 -f sftp/ssh_host_ed25519_key < /dev/null
ssh-keygen -t rsa -b 4096 -f sftp/ssh_host_rsa_key < /dev/null
  1. You can generate a fingerprint for a public key using ssh-keygen like so:
# sha256 fingerprint
ssh-keygen -lf sftp/ssh_host_ed25519_key.pub > files/sha256-server-fingerprint.txt

# or md5 fingerprint
ssh-keygen -l -E md5 -f sftp/ssh_host_ed25519_key.pub > files/md5-server-fingerprint.txt
  1. (optional) Auto-load public keys for a specific user by adding the key to the sftp/keys_by_user folder. The format is keys_by_user/user-name/.ssh/keys/id_ed25519_key.pub, as seen in the sftp/keys_by_user/example_user folder.

  2. Boot the app via docker-compose up -d --build

  3. (optional) For passwordless login, load public ssh keys for a given user via:

Only needed if you didn't auto-load the keys earlier.

container_id=$(docker ps -q --filter name="sftp")

docker cp ~/.ssh/id_ed25519.pub $container_id:/tmp/
docker-compose exec sftp bash

# inside the container
# create an .ssh director owned by root
user="group_a"
uid="$(id -u "$user")"
user_ssh_folder="/home/$user/.ssh"
mkdir -p "$user_ssh_folder"

# add key to the authorized keys file and set owner to appropriate user
user_authorized_keys_file="$user_ssh_folder/authorized_keys"
cat "/tmp/id_ed25519.pub" >> "$user_authorized_keys_file"
chown "$uid" "$user_authorized_keys_file"
chmod 600 "$user_authorized_keys_file"

For End-Users

  1. Set up an example .ssh/config.
Host weather-transfer-files
    HostName some-host-name
    USER group_a
    Port 22

About

Share data from fire weather stations and other related sources. Replaces a legacy FTP service known as SCADA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 72.6%
  • HTML 27.4%