Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where find config information #1

Closed
Sebseb01 opened this issue Jun 7, 2020 · 5 comments
Closed

Where find config information #1

Sebseb01 opened this issue Jun 7, 2020 · 5 comments

Comments

@Sebseb01
Copy link

Sebseb01 commented Jun 7, 2020

I'll try to configure your project for using etesync with a screen reader.

But i not found the value for "uid" or "authToken" for the config

I think i have set correctly set all other value

Thanks in advance for your help

@jrvarma
Copy link
Owner

jrvarma commented Jun 7, 2020

The easiest solution is to use example.py in pyetesync the python client library for EteSync which you would anyway have installed in order to use the EteSync backend. You can run example.py using only the parameters that you have already set: email, servicePassword, userPassword, and remoteUrl, and use that code to determine uid and authToken. (Incidentally running example.py is the best way to check that the first four parameters are correct.)

authToken

In line 27, the authToken is fetched from the remote server, and there is a comment before this line saying that ''Token should be saved instead of requested every time". You can edit example.py to print this token so that you can copy it into your config.py.

uid

When you run example.py without any optional arguments, it lists out the uid of all the journals present in that account. One of these would be the calendar. Again, you should copy this uid into your config.py.

I am adding a link to this page in the Readme file for the benefit of other users.

@jrvarma jrvarma closed this as completed Jun 7, 2020
@BlueDrink9
Copy link

BlueDrink9 commented Nov 26, 2021

Example.py no longer exists. It was here

@jrvarma
Copy link
Owner

jrvarma commented Nov 26, 2021

The following code is based on the old example.py. I tested it today on my self-hosted etesync account. I hope it works for you.

import etesync as api
import json

email = "your etesync email address"
servicePassword = "the password used to login to etesync"
remoteUrl = "your etesync server"
userPassword = "your encryption password from which encryption key is derived"

authToken = api.Authenticator(remoteUrl).get_auth_token(email, servicePassword)
print("Authentication token is", authToken)

etesync = api.EteSync(email, authToken, remote=remoteUrl)
print("Deriving key. Very slow operation")
etesync.derive_key(userPassword)
print("Syncing. Will take time")
etesync.sync()
print("Printing UID and other details of your calendars")
for entry in etesync.list():
    content = json.loads(entry.content)
    if content['type'] == "CALENDAR":
        print("UID = {}\nVersion=  {}".format(entry.uid, entry.version))
        for item in content:
            print("{} = {}".format(item, content[item]))
        print()

@BlueDrink9
Copy link

Thank you for that! I'm having trouble getting the authToken. For whatever reason, my password isn't being accepted. But this new example will surely be useful to others!

@BlueDrink9
Copy link

Also for others who use the default etesync server, you can use api.API_URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants