DominoVagrant / demo

Apache License 2.0
0 stars 3 forks source link

Streamline Domino Server Setup #2

Open JoelProminic opened 2 years ago

JoelProminic commented 2 years ago

We reviewed this project yesterday, and there were some manual steps that we want to improve:

JoelProminic commented 2 years ago

@dpastov, I did a test with DominoVagrant/demo, but it failed because I didn't have the Genesis JAR:

domino-vm: Running: script: Copy Genesis-0.6.14.jar to /local/dominodata/JavaAddin/Genesis
domino-vm: cp: cannot stat ‘/home/vagrant/dist/Genesis-0.6.14.jar’: No such file or directory
domino-vm: chown: cannot access ‘/local/dominodata/JavaAddin/Genesis/Genesis-0.6.14.jar’: No such file or directory

Where can I get this for now? If it is a public project, we could download it from a release.

JoelProminic commented 2 years ago

I fixed the Java logic in SDKMAN_Setup.sh. Currently it is using the "zulu" (Azul) JDKs.

I also added a line to update /etc/hosts

@JustinProminic, @dpastov, I made some other "minor" updates to the Vagrantfile as I was going through a test. We can revert these if they cause problems for other users.

I have updates ready for the CrossCertifyNotesID class. I'll test this after lunch and commit them if they are working. This code has examples to read credentials form setup.json. I'm planning to make some updates to the project structure to make it easier to work with the code in Moonshine.

JoelProminic commented 2 years ago

I added CrossCertifyNotesID.java. This is updated to read setup.json to get the credentials for the generated server. The current syntax is:

# starting server - not required
# names.nsf already existed for me - running CreateNamesDatabase.jar did not make a difference for me
cd /local/notesjava
java -jar /vagrant/build/libs/CrossCertifyNotesID.jar user.id 

Unfortunately, this is still prompting me for the password. I think I am probably making a silly mistake when creating the session, but I haven't figured it out yet. I'll revisit this later today if I have time, but I need to work on other tasks for a while.

I also added a .javaproj and build.gradle so that this project can open in Moonshine. You may also need to setup src/main/java. I'm thinking about moving dist-src instead, but for now you can just create a symlink:

mkdir -p src/main
cd src/main
ln -s ../../dist-src java

I added code to build.gradle to build a jar for each main class in dist-src/net/prominic/domino/vagrant. The JARs can be generated with gradle clean jarIndividual, or individually with jar<ClasName> (i.e. gradle jarCheckNotesUser).

JoelProminic commented 2 years ago

On further investigation, I see the password prompt is triggering on the reg.crossCertify line. If I add a getDatabase line, I see that it doesn't trigger a password check (but it does in CheckDatabase.jar. I'm out of time for today, so I'll revisit it on Monday (unless you want to take a look, @dpastov ).

JoelProminic commented 2 years ago

I see that the recertify method reports:

This method prompts for the ID password.

I suspect the same thing is happening for crossCertify.

I confirmed that we can work around the password prompt with the yes command. If we want this solution, we would need to parse the password from setup.json - we have used a command line JSON library in another project:

yes "`-command-to-get-password`" | java -jar /vagrant/build/libs/CrossCertifyNotesID.jar user.id 
dpastov commented 2 years ago

@dpastov, I did a test with DominoVagrant/demo, but it failed because I didn't have the Genesis JAR:

domino-vm: Running: script: Copy Genesis-0.6.14.jar to /local/dominodata/JavaAddin/Genesis
domino-vm: cp: cannot stat ‘/home/vagrant/dist/Genesis-0.6.14.jar’: No such file or directory
domino-vm: chown: cannot access ‘/local/dominodata/JavaAddin/Genesis/Genesis-0.6.14.jar’: No such file or directory

Where can I get this for now? If it is a public project, we could download it from a release.

That is fixed (I commited/pushed) file to repo.

JoelProminic commented 2 years ago

Great, this works for me now, and I can access the server from my Notes client without any more steps on the Vagrant side. @dpastov, does this work in your test? I'll ask @JesseProminic to test this as well (I'll send an email with more information).

I updated README.md to reflect my changes. We should probably improve the instructions further depending on the target audience, but I think this is good enough for now.

Some optional remaining tasks:

Other remaining tasks for Moonshine integration (will be done in separate issues):