commit 2941afbf3319b040351d133d99b6da082b186a00
parent 631cd83280c0dbd6766bae1f8675b88af631c0c2
Author: Remy Noulin <loader2x@gmail.com>
Date: Sun, 14 Aug 2022 11:03:05 -0400
add tuyau and tuyauServer packages
NOTES.md | 2 +-
README.md | 37 ++++++++++++++++++++++++++++++++++++-
clientPackage.sh | 15 +++++++++++++++
package.yml | 10 +++++-----
serverPackage.sh | 15 +++++++++++++++
serverPackage.yml | 37 +++++++++++++++++++++++++++++++++++++
tuyau.c | 26 --------------------------
7 files changed, 109 insertions(+), 33 deletions(-)
Diffstat:
7 files changed, 109 insertions(+), 35 deletions(-)
diff --git a/NOTES.md b/NOTES.md
@@ -1,4 +1,3 @@
-- create packages
- tls
- reduce repeated code: create macros and functions
- check inputs, add limits
@@ -6,6 +5,7 @@
- create tests
- send errors from server to client
- make daemon
+..- create packages
Speed (no tls)
diff --git a/README.md b/README.md
@@ -3,7 +3,42 @@ It supports only 1 client at a time.
It works like the cp command and copies the directories recursively.
-Commits:
+# install
+```
+spm -g install tuyau tuyauServer
+```
+
+# configuration
+In server, create ~/.tuyau/serverConfig.yml
+---
+ port: 1023 // optional
+ ausername(string):
+ token: 8 random non zero 8 bit values
+ root: apath(home)
+
+In client, create ~/.tuyau/config.yml
+---
+ ausername(string, this is the server name):
+ hostname: ip // server ip
+ token: 8 random non zero 8 bit values, same as server config
+ port: 1022
+
+# usage
+- start server
+- run client
+
+Upload files:
+tuyau files serverName
+tuyau files serverName:path/
+tuyau file serverName:path/newfilename
+
+Downdload files (globbing is supported):
+tuyau serverName:path/files
+ >> downloads to current directory
+tuyau serverName:path/files path/
+tuyau serverName:path/file path/newfilename
+
+# Commits
1 - send a single file
2 - send files and directories recursively
3 - receive a single file
diff --git a/clientPackage.sh b/clientPackage.sh
@@ -0,0 +1,15 @@
+mkdir tuyau
+
+cp makeHeader.c tuyau/
+cp makeHeader.h tuyau/
+cp netFrame.c tuyau/
+cp netFrame.h tuyau/
+cp netFrameInternal.h tuyau/
+cp package.yml tuyau/
+cp sclient.c tuyau/tuyau.c
+cp -R shpPackages tuyau/
+
+cd tuyau
+spm publish
+cd ..
+rm -rf tuyau
diff --git a/package.yml b/package.yml
@@ -1,7 +1,7 @@
---
name: tuyau
- version: 0.0.1
- description: "explanation"
+ version: 0.0.3
+ description: "Client for copying files to tuyauServer"
bin: ./tuyau.c
#cflags: -DA -g3 -std=gnu11 -fPIC -pipe
#lflags: -lpcre
@@ -17,8 +17,8 @@
url: https://github.com/USER/tuyau/issues
homepage: https://github.com/USER/tuyau#readme
#compileHelp: # text displayed when there is a compilation error
- #dependencies:
- # md4c:
+ dependencies:
+ short:
# Test configuration:
#testBin: ./testTuyau.c
#testCflags: -g3 -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra
@@ -34,4 +34,4 @@
#asanCflags: -fsanitize=address -fno-omit-frame-pointer -fsanitize-recover=address # these flags are overriden by package.yml
#asanLflags: -rdynamic -fsanitize=address -lasan # these flags are overriden by package.yml
#documentationCmd: # command for generating the documentation with spm doc
- private: false # true for private package-
\ No newline at end of file
+ private: false # true for private package
diff --git a/serverPackage.sh b/serverPackage.sh
@@ -0,0 +1,15 @@
+mkdir tuyauServer
+
+cp makeHeader.c tuyauServer/
+cp makeHeader.h tuyauServer/
+cp netFrame.c tuyauServer/
+cp netFrame.h tuyauServer/
+cp netFrameInternal.h tuyauServer/
+cp serverPackage.yml tuyauServer/package.yml
+cp sserver.c tuyauServer/tuyauServer.c
+cp -R shpPackages tuyauServer/
+
+cd tuyauServer
+spm publish
+cd ..
+rm -rf tuyauServer
diff --git a/serverPackage.yml b/serverPackage.yml
@@ -0,0 +1,37 @@
+---
+ name: tuyauServer
+ version: 0.0.2
+ description: "Server for copying files with tuyau"
+ bin: ./tuyauServer.c
+ #cflags: -DA -g3 -std=gnu11 -fPIC -pipe
+ #lflags: -lpcre
+ repository:
+ type: git
+ url: git+https://github.com/USER/tuyau.git
+ keywords:
+ #- utility
+ - command
+ author: Anonymous
+ license: MIT
+ bugs:
+ url: https://github.com/USER/tuyau/issues
+ homepage: https://github.com/USER/tuyau#readme
+ #compileHelp: # text displayed when there is a compilation error
+ dependencies:
+ short:
+ # Test configuration:
+ #testBin: ./testTuyau.c
+ #testCflags: -g3 -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra
+ #testLflags: -lcheck_pic -lrt -lm -lsubunit -fprofile-arcs -ftest-coverage -rdynamic
+ # Memcheck configuration (sheepy -m):
+ #memcheckBin: ./memcheckTuyau.c
+ #memcheckCmd: valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1
+ #memcheckCflags: -g3 -std=gnu11 -fPIC -pipe
+ #memcheckLflags: -rdynamic
+ # The asan* are the options for building the libsasan tests (sheepy -a):
+ #asanBin: ./asanTuyau.c
+ #asanCmd: env ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:halt_on_error=0:log_path=stdout:color=always:print_cmdline=1"
+ #asanCflags: -fsanitize=address -fno-omit-frame-pointer -fsanitize-recover=address # these flags are overriden by package.yml
+ #asanLflags: -rdynamic -fsanitize=address -lasan # these flags are overriden by package.yml
+ #documentationCmd: # command for generating the documentation with spm doc
+ private: false # true for private package
diff --git a/tuyau.c b/tuyau.c
@@ -1,26 +0,0 @@
-#! /usr/bin/env sheepy
-/* or direct path to sheepy: #! /usr/local/bin/sheepy */
-
-/* Libsheepy documentation: https://spartatek.se/libsheepy/ */
-#include "libsheepyObject.h"
-
-int argc; char **argv;
-
-/* enable/disable logging */
-/* #undef pLog */
-/* #define pLog(...) */
-
-int main(int ARGC, char** ARGV) {
-
- argc = ARGC; argv = ARGV;
-
- initLibsheepy(ARGV[0]);
- setLogMode(LOG_VERBOSE);
- //openProgLogFile();
- //setLogSymbols(LOG_UTF8);
- //disableLibsheepyErrorLogs;
-
- logI("C template");
-
-}
-// vim: set expandtab ts=2 sw=2:-
\ No newline at end of file