Open moorsey opened 3 years ago
Thank you! Can you use this to keep autodoist running in the background and on system startup?
Yes correct, I have this running on my home server, set and forget
Getting to know a bit about docker would be your starting point though, depends on your OS etc
Thanks for this.
fixed in #31
Pull request #31 has been included in the latest master release. Thanks for the help @obbardc! Closing this tracker for now.
Thanks for making someing proper for this @obbardc
Forgive me though, I'm not sure how to run it now. Can it now be ran with variables for API key etc?
I've ran as follows so far:
git clone https://github.com/Hoffelhas/autodoist.git
cd autodoist
docker build . --tag autodoist:latest
docker run -it autodoist:latest
The last command fails of course, as the API key is missing
Sorry for the noob understanding level here!
Thanks for making someing proper for this @obbardc
Forgive me though, I'm not sure how to run it now. Can it now be ran with variables for API key etc?
I've ran as follows so far:
git clone https://github.com/Hoffelhas/autodoist.git cd autodoist docker build . --tag autodoist:latest docker run -it autodoist:latest
The last command fails of course, as the API key is missing
Sorry for the noob understanding level here!
Hey, building is optional, you can just run it as follows:
docker run -it -e TODOIST_API_KEY=??? ghcr.io/hoffelhas/autodoist:latest --label Next --hide_future=8
untested but it should work. I personally run it with docker-compose like:
version: "3.7"
services:
autodoist:
image: ghcr.io/hoffelhas/autodoist:latest
container_name: autodoist
env_file: secrets/autodoist.env
command: --label Next --hide_future=8
restart: unless-stopped
I didn't manage to update the README due to lack of time, maybe you could do that in a PR ?
Thanks, I will add to the readme for sure, once I have a full grasp of it!
Do you have a list of the variables accepted? Not entirely sure how to glean this from the code, regen (although think this is disabled currently) and end of day for example
In your compose, I assume the .env file just has TODOIST_API_KEY=asdfg
inside?
I tried a docker run, but get an API error currently, possibly not an issue with the docker as such
docker run -it -e TODOIST_API_KEY=*** ghcr.io/hoffelhas/autodoist:latest --label next --hide_future=2
2023-01-24 06:55:29 INFO You are running with the following functionalities:
Next action labelling mode: Enabled
Regenerate sub-tasks mode: Disabled
Shifted end-of-day mode: Disabled
2023-01-24 06:55:32 INFO Autodoist has successfully connected to Todoist!
2023-01-24 06:55:32 INFO SQLite DB has successfully initialized!
2023-01-24 06:55:37 ERROR Error trying to sync with Todoist API: 400 Client Error: Bad Request for url: https://api.todoist.com/sync/v9/sync
Traceback (most recent call last):
File "/usr/src/app/./autodoist.py", line 521, in sync
response.raise_for_status()
File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.todoist.com/sync/v9/sync
Reopening for now, this might be related to #34
Just dropping my working docker-compose here for reference
version: "3.7"
services:
autodoist:
image: ghcr.io/Hoffelhas/autodoist:latest
container_name: autodoist
command: -l=next -hf=2 -a=1234567890**apikey**abcdefg
restart: unless-stopped
Sorry, not sure if this is the best way to get this info added to the readme, bit lost on the whole github thing
Anyway, I have successfully created this app inside a docker container, running happily
Guide assumes you have docker installed
dockerfile
with the following contents:Note, replace the last line with your API key and required options. Each option must be in quotes and separated with a comma
docker build -t autodoist-image .
, whereautodoist-image
is the name that will be given to your new docker imageThe python files will be downloaded and then the requirements.txt will be processed, to install pre-requisites for autodoist inside the image
Replacing docker options as needed
You can now watch the logs of the container, to check for errors, or if it is running happliy