Skip to content

haplo-org/haplo-user-sync-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

haplo-user-sync-uploader
========================

Current web home: https://github.com/haplo-org/haplo-user-sync-uploader

haplo-user-sync-uploader is a marvelous new Windows command-line utility
for uploading to Haplo services, without all that tedious mucking about 
in PowerShell.

It can make zero or more file uploads with a given name argument, then 
optionally make a further request to tell the Haplo service to use the uploads. 

Certificates are tested properly, and it authenticates with HTTP Basic auth 
using the fixed username 'haplo' and a configured API key as a password.


Configuration
-------------

At the windows command line, set the server name and API key as environment 
variables:

set HAPLO_SERVER=example.server.tld
set HAPLO_API_KEY=ABCD1234ABCD1234ABCD1234ABCD1234ABCD1234ABCD1234

[Note the absence of whitespace around the '=' sign. This is very
 important - Windows will happily use spaces in variable names!]
 

Use
---

Syntax: haplo-user-sync-uploader command [name] [filename]

Examples:

haplo-user-sync-uploader file students path\to\students.tsv
haplo-user-sync-uploader file staff path\to\staff.tsv
haplo-user-sync-uploader apply

Possible errors returned:

 Missing command

 Missing or invalid filename

 The remote server returned an error: (400) Bad Request.
 Sync in unexpected state -- use admin interface to resolve.

 The remote server returned an error: (400) Bad Request.
 Last sync is not ready. Upload all the required files.


Verbosity
---------

The tool's output is intentionally UNIXy, so is silent on success.

If you want to see additional output, use the --digest option to make it
far more chatty, e.g.

haplo-user-sync-uploader --digest apply


Troubleshooting
---------------

Invoking the utility with the 'test' command ...

haplo-user-sync-uploader test

... will make a GET request to https://{HAPLO_SERVER}/

Servers that support SNI will return quietly on success, while attempts
to access non-SNI sites will (correctly) return an error. 


Building
--------

This version of the utility was built using Microsoft Visual Studio 2015,
and is configured to target the .NET 4.7 platform, which is the oldest version
that supports TLSv1.2 - see:
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls

The earliest version that supported server certificate validation callbacks
in WebClient was .NET 4.5 - see:
https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.servercertificatevalidationcallback(v=vs.110).aspx

Earlier releases were deliberately configured to target .NET 2.0, meaning
legacy platforms wouldn't need a new framework installing, nor the obligatory
restart that usually entails.

License
-------

(c) Haplo Services Ltd 2006 - 2018    http://www.haplo-services.com

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/

Haplo Platform                                     http://haplo.org

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages