1.1.0 • Published 4 months ago

nanoweb-sync-php v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

Nanoweb Sync PHP is a command-line tool for synchronizing files between a local directory and a remote PHP server. It supports different sync strategies, chunked file uploads, and secure authentication.

Features

  • Synchronizes local files with a remote PHP server.
  • Supports multiple sync strategies: sync, merge, force.
  • Handles chunked uploads for large files.
  • Supports secure authentication via API tokens.
  • Automatically removes outdated remote files.

Installation

npm install -g nanoweb-sync-php

Upload file server/deploy.php on your server with the PHP support v7.4+. Upload server/config.example.php as config.php in the same directory with deploy.php and generate string AUTH_KEY.

Usage

Sync Files

nanoweb-sync-php -host https://example.com -pass YOUR_AUTH_KEY -local ./dist -remote /deploy.php

Options

OptionDescriptionDefault
-hostRemote PHP server URL-
-passAuthentication key-
-portServer portAuto
-strategySync strategy (sync, merge, force)sync
-localLocal directory to uploaddist
-remoteRemote PHP script for synchronization/deploy.php
-recentCache file for faster synchronization.nanoweb-sync.json
-publicPublic directory to merge before upload-
-ignoreIgnore patterns for file exclusion-

Environment Variables

Alternatively, you can define settings in a .env file:

SYNC_HOST=https://example.com
SYNC_PASS=YOUR_AUTH_KEY
SYNC_LOCAL=dist
SYNC_REMOTE=/deploy.php
SYNC_STRATEGY=sync
SYNC_CACHE=.nanoweb-sync.json
SYNC_PUBLIC=public
SYNC_IGNORE=node_modules;tmp;logs

Server Requirements

Ensure the remote server has the deploy.php script installed and configured:

  • Define AUTH_KEY in config.php for secure authentication.
  • Set NANO_DIR for managing uploaded files.

License

ISC License

Contributing

See CONTRIBUTING.md for details on how to contribute.

1.1.0

4 months ago

1.0.0

4 months ago