A simple and efficient file server implemented in C.
- Multi-threaded server architecture
- File operations: read, write, delete, list
- Directory operations: create, list
- Configuration system
- Logging system
- Custom binary protocol
- Authentication and authorization
cileserver/
├── config/ # Configuration files
│ └── cileserver.conf # Example configuration (not tracked in git)
├── docs/ # Documentation
│ ├── architecture.md
│ ├── authentication.md
│ ├── client.md
│ ├── configuration.md
│ ├── file_operations.md
│ ├── index.md
│ ├── logging.md
│ ├── protocol.md
│ ├── server.md
│ └── TODO.md
├── include/ # Header files
├── logs/ # Log files (not tracked in git)
├── src/ # Source code
├── test_files/ # Test files
├── tests/ # Test scripts
├── builddir/ # Build output directory (not tracked in git)
├── .gitignore
├── install.sh # Installation script
├── meson.build # Meson build system
└── README.md # This file
Note: The
config/cileserver.conffile is not tracked in git. You'll need to create your own configuration file based on the example below.
To build the server and client using Meson:
# Run the installation script
./install.shOr manually:
# Setup build directory
meson setup builddir
# Build the project
meson compile -C builddirThis will create the executables in the builddir directory.
To run the server:
./builddir/cileserverTo run the client:
./builddir/cileclient [COMMAND] [ARGS]Available commands:
list PATH- List directory contentsget REMOTE_PATH LOCAL_PATH- Download a fileput REMOTE_PATH LOCAL_PATH- Upload a filedelete PATH- Delete a file or directorymkdir PATH- Create a directory
-p, --port PORT: Port to listen on (default: from config or 9090)-c, --config PATH: Path to config file (default: config/cileserver.conf)-a, --auth [FILE]: Enable authentication (optional auth file path)--no-auth: Disable authentication-h, --help: Display help message
You can also specify the config file path directly as the first argument:
./builddir/cileserver config/cileserver.conf-h, --host HOST: Server hostname (default: localhost)-p, --port PORT: Server port (default: 9090)
The server requires a configuration file at config/cileserver.conf. This file is not included in the git repository for security reasons, so you'll need to create it yourself.
Example configuration:
# Directory to serve files from
root_directory=/tmp/cileserver
# Maximum number of concurrent connections
max_connections=100
# Port to listen on
port=9090
# Logging level (0=DEBUG, 1=INFO, 2=WARNING, 3=ERROR)
log_level=1
# Enable authentication (0=disabled, 1=enabled)
enable_auth=0
# File containing user credentials
auth_file=users.auth
Comprehensive documentation is available in the docs directory:
- Architecture Overview
- Server Implementation
- Client Usage
- Protocol Specification
- File Operations
- Configuration System
- Logging System
- Authentication System
- Project TODO List
./builddir/cileclient list /./builddir/cileclient put /remote_file.txt local_file.txt./builddir/cileclient get /remote_file.txt downloaded_file.txt./builddir/cileclient mkdir /new_directory./builddir/cileclient delete /remote_file.txtThis project is licensed under the MIT License - see the LICENSE file for details.