Officer Hub
Load data automatically
Set up signed push so an export arrives on a schedule: turn it on, make a token, choose what publishes, and run the loader program.
- Who can do this
- Union administrators and officers with UnionOps Data access, and whoever looks after the local’s computers.
Instead of uploading the same export each time, UnionOps Data can take it from a small program that sends the file on a schedule. UnionOps reads it the way it reads an upload, then follows the rule you set for that source. A file is never published just because it arrived. This guide has two parts: what an officer sets up, then what whoever looks after the local's computers does.
Before you start
- Site Admin has to allow signed push for the whole site. If the Recurring sources panel says Signed push is off on this host, ask Site Admin.
- A union administrator turns push on for your union.
- You need access to UnionOps Data in the local that owns the list.
Turn on push for your union
Only a union administrator sees the button. Nothing can be pushed until it is on.
- Open UnionOps Data from the Officer Hub menu and choose the Imports tab.
- Under Recurring sources, press Turn on push for the union.
- Enter the code from your authenticator app in Authenticator code and confirm. The panel now says Signed push is on for your union.
To stop every push into your union, press Turn off push for the union. Files sent after that are refused.
Create a push source
A source is the same export arriving into the same dataset each time. It keeps the layout, the review rule and the push token.
- Under Recurring sources, enter a Source name and choose the Dataset.
- For a member list, fill in Where this list came from: Who supplied it, Authority to hold it, What it will be used for and Review by. UnionOps records what you state and does not check it. Every file pushed into the source carries it.
- Press Create source.
A pushed member list is refused if the statement is missing or its review date has passed. Open the source and press Say where this list comes from or Change where this list comes from, update it, and press Save.
Make a token and copy the push address
- On the source, press Create push token. Enter a fresh code from your authenticator app.
- Copy the token now. It is shown once and UnionOps keeps no copy. Press I have copied it once you have stored it.
- Copy the Push address shown under the source. The loader needs both.
Careful: Treat the token like a password. Keep it in a password manager and hand it to the person who runs the loader in person. Never send it by email or chat. Anyone who has it can send files into this source.
Choose what happens to a file
By default, an officer reviews every file. A pushed file waits on the Imports tab like an upload, compared with the last one.
Press Publish within bounds if you want a file to publish on its own. It takes a fresh code. By default that happens only after two reviewed files from the source, and only when a file brings at most 10 new people, at most 5% departures, and the same column headers. Anything outside that waits for an officer. If the person who turned it on loses access to the local, files wait again.
Site Admin can switch automatic publishing off for the whole site. Until it is back on, every file waits for an officer. Press Back to officer review at any time to return to review.
Rotate or remove a token
- Rotate push token makes a new token and stops the old one at once. Do this when someone who knew the token leaves, or it may have been seen. Give the new token to whoever runs the loader.
- Remove push token stops pushing into the source until you make another.
What a refusal means
The loader prints a short line and a code. These are the ones to know:
- Refused with no reason (401). UnionOps gives the same answer for every cause so a token cannot be guessed. Check that the token is current, that push is on for the site and your union, that the source is not archived, and that the person who created the source still has access to the local's data.
- Statement due or missing (409). The member list statement is missing, or its review date has passed. Confirm it as above.
- Too many pushes (429). A source accepts 12 files an hour. Send once or twice a day.
- Daily limit (429). Your union's daily size limit for pushed files is used up. Try again tomorrow.
- File problems. Only
.csvand.xlsxfiles are accepted, up to 12 MiB by default. A file that cannot be read with the source's layout is refused with a reason. - Already has this exact file. The export has not changed since the last push. This is normal, not an error.
Run the loader
This part is for the person who looks after the local's computers. The full steps, settings and troubleshooting are in the loader README.
- Install Node.js 20 or newer. Nothing else is needed.
- Put the loader files in a folder, copy the example settings file to
unionops-push.config.json, and fill in the push address (pushUrl) and the export file (file). - Keep the token in an environment variable (
tokenEnv) or in a file only you can read (tokenFile). It never goes in the settings file or on the command line, and the loader refuses--token. - Run it once by hand with
--verboseand check the line it prints. - Schedule it. On Windows,
register-task.ps1sets up a daily or weekly Scheduled Task. On Linux or macOS, use cron.
Read what the loader reports
It prints one plain line, such as published 1,204 rows, and exits with a code your scheduler shows.
- 0: done. The file was published, or accepted and waiting for an officer, or UnionOps already had it.
- 2: setup problem. UnionOps did not take the file.
- 3: waiting for an officer. Only with
--require-published. - 4: UnionOps refused the file or the token, or took the file but would not say what became of it. Look at the source in UnionOps Data.
- 5: UnionOps or the network failed three times. The next run tries again.
- 6: the file was accepted but was still being read when the wait ran out.
- 1: an unexpected error. Run with
--verboseand ask for help.
If you set logFile, one line is added per run: time, file name and size, run, status, counts and codes. It never holds the token or anything from inside the file. UnionOps sends back only counts and short codes. No names, no member numbers and no rows ever come back to the computer that runs the loader.
Tip: Tell an officer when the loader goes live, so someone watches the Imports tab for the first few files.