-
Notifications
You must be signed in to change notification settings - Fork 90
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
Bug 201: Docker support for building and running #381
base: master
Are you sure you want to change the base?
Conversation
To actually compile, I had to make a change to build.xml (presumably because I don't know enough about java) which I did not include. Similarly, I created an "entrypoint" file which specified the CLASSPATH (and didn't use any of non-relevant code paths from the davmail shell script). The build.xml patch is shown below: diff --git a/build.xml b/build.xml index d1a967c7..869f4a10 100644 --- a/build.xml +++ b/build.xml @@ -119,6 +119,9 @@ <exclude name="davmail/exchange/auth/*Interactive*" unless="is.javafx"/> <classpath> <path refid="classpath"/> + <fileset dir="/usr/share/java"> + <include name="**/*.jar" /> + </fileset> </classpath> </javac> </target>
@SethRobertson : To format your above post for GitHub properly, you should put three backticks (```) on a line by itself before and then again after your patch (diff output). P.S. This is awesome! Thank you! |
…ing and running git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@3614 3d1905a2-6b24-0410-a738-b14d5a86fcbd
Here is how I achieved headless (in docker), even working with oauth2: Running headlessConnect to your vps (or equivalent) and run the commands below:
Then save the server config from here as
(note that this will expose port 1025 and 1143 for everyone to use, change to your likings) For a proper setup, make sure to move the But wait.... Oauth2 doesn't work on headless right?Running in headless mode does not support logging in using oauth2. So what I did is that I ran the same steps above on my normal computer (which can run the GUI):
And then start the container using
Now that you started the container, there should be a new file called Next, try to connect with your email client, e.g. thunderbird, and set receiving (IMAP) to After pressing connect on the email client, the GUI from davmail should show instructions on how to authenticate. After following those instructions, stopping the docker container and running |
Awesome, just one quick note: after first connection "something it doesn't matter" password does matter, as we use the provided password to encrypt refresh token. This is to make sure davmail.properties does not contain exploitable secrets and also make sure noone else can connect to your DavMail instance. |
I just re-did the whole thing and everything is working now 🙏 |
@Robin-Sch wrote:
So the
What does that environment variable do and where is it referenced? I don't see it referenced anywhere in the code except for in the Assuming setting this environment variable actually does something, changing
in the
would allow the same Docker image to be used for both states. I think you could then override the value of What do you think, @Robin-Sch ? Also, I think you're supposed to use the |
It was in the entrypoint so I just changed it. I have no idea what it does/if it even impacts anything The thing is, there is indeed this For the Makefile I guess it would work? But I didn't try it. Also entrypoint would need +x regardless as it's executed by docker when the container starts |
To actually compile, I had to make a change to build.xml (presumably because I don't know enough about java) which I did not include. Similarly, I created an "entrypoint" file which specified the CLASSPATH (and didn't use any of non-relevant code paths from the davmail shell script).
The build.xml patch is shown below:
diff --git a/build.xml b/build.xml
index d1a967c7..869f4a10 100644
--- a/build.xml
+++ b/build.xml
@@ -119,6 +119,9 @@