<jupyter_start><jupyter_text>Configuration of cairio.orgRight now the central cairio server is hosted on https://pairio.org:20443This is a linode serverInside a tmux session called cairio:```cd ~/src/spikeforest2/repos/cairio```See .env file containing:```PORT=20443CAIRIO_ADMIN_TOKEN=******```To run the server:```npm install .node cairioserver/cairioserver.js```There are instructions in the home directory for setting up firewall and renewing the certs<jupyter_code># import cairio client and other packages
from cairio import client as ca
from getpass import getpass
# How to add a collection:

CAIRIO_ADMIN_TOKEN=getpass('Enter the secret CAIRIO_ADMIN_TOKEN')
collection='spikeforest'
collection_token=getpass('Enter new token for collection {}: '.format(collection))
ca.addRemoteCollection(collection=collection, token=collection_token, admin_token=CAIRIO_ADMIN_TOKEN)
# Now, for convenience, store this token in the collection, protected by password:
ca.setRemoteConfig(collection=collection, token=collection_token)
ca.setValue(key='token',password=getpass('Enter password for retrieving token'),value=collection_token)
## In the future this is how we can bootstrap the read/write configuration
ca.setRemoteConfig(collection='spikeforest')
ca.setRemoteConfig(token=ca.getValue(key='token',password=getpass('Enter password: ')))
# Now test:
ca.setValue(key=dict(name='some-test-key'),value='the value on spikeforest3')
print(ca.getValue(key=dict(name='some-test-key')))
# Make sure we don't have it locally
ca.setRemoteConfig(collection='')
print(ca.getValue(key=dict(name='some-test-key')))
ca.setRemoteConfig(collection='spikeforest3')
print(ca.getValue(key=dict(name='some-test-key')))
# Note that we can read but not write when do not provide the token
ca.setRemoteConfig(collection='spikeforest',token='')
print(ca.getValue(key=dict(name='some-test-key')))
ca.setValue(key=dict(name='some-other-key'),value='test2')<jupyter_output>the value on spikeforest3
Missing token for remote cairio server.
{'fraction_non_alphanumeric': 0.12101593625498008, 'fraction_numerical': 0.007470119521912351, 'mean_word_length': 8.61244019138756, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '231080', 'license': 'Apache-2.0', 'n_tokens_mistral': 631, 'n_tokens_neox': 607, 'n_words': 158, 'path': 'working/configuration/config_cairio_org.ipynb', 'repo_name': 'tjd2002/spikeforest2', 'size': '2008'}