[tor-bugs] #13089 [Onionoo]: use an embedded web server/servlet engine for Onionoo

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Oct 2 08:57:59 UTC 2014


#13089: use an embedded web server/servlet engine for Onionoo
-----------------------------+----------------------------
     Reporter:  iwakeh       |      Owner:
         Type:  enhancement  |     Status:  needs_revision
     Priority:  minor        |  Milestone:
    Component:  Onionoo      |    Version:
   Resolution:               |   Keywords:
Actual Points:               |  Parent ID:
       Points:               |
-----------------------------+----------------------------

Comment (by karsten):

 Replying to [comment:14 iwakeh]:
 > Thanks, for all your suggestions!
 >
 > > I made some tweaks in my
 [https://gitweb.torproject.org/user/karsten/onionoo.git/shortlog/refs/heads/task-13089
 task-13089 branch] that are supposed to be squashed with your commit.
 > >
 > This branch looks fine. I added two patches based on this branch.

 Cool!  Added them to my branch and added two more.  (Weren't you planning
 to create a Git repository somewhere?)

 > > Here are some more comments for things I didn't fix/change yet:
 > >  - Your first command line for the backend above should be `java
 -Xmx4096M -jar dist/onionoo-1.1.1.jar`.
 > This is correct; I changed it in the INSTALL suggestions.

 Okay.

 > >  - I didn't manage to start the server with your second command line.
 Logs contain this line: "Web application not found onionoo-1.1.1.war".
 Hmm.  Maybe we're not supposed to create a .war for the front-end, but
 also a .jar?!...
 > >
 > We don't need a jar here. I changed jetty.xml in such a way that the war
 > can be started and (this wasn't the case initially) the starting is
 independent of the actual path, name, and version of the war.

 Okay.  (I didn't test this, but decided to give it another try when
 setting up the Onionoo mirror.)

 > >  - Do you mind updating `vagrant/bootstrap.sh` by removing Tomcat
 specifics and installing `libjetty8-java`?  Anything else that needs
 changing?
 > >
 > The package is named 'jetty8' here.

 IIRC, that package attempts to start an actual server, which we don't
 need, because we're starting our own server.  I could be wrong though.
 But in theory, the fewer/smaller packages we need, the better.

 > I think, this is not only an update. With the embedded-one-jar-one-war
 setting
 > we are free to choose a new setup.
 > It might also be a good idea (with the upcoming mirrors in mind)
 > to make path setting for 'in', 'out', etc. configurable? => new task?
 > Should the vagrant-setup first of all reflect the main-onionoo server
 > or a good test setup or a general setup?
 > Maybe, the documentation should be extended to describe the possible
 options.
 > Another new task?

 Fine questions.  How about we update the Vagrant setup in this branch to
 be as similar to the Jetty-based production environment as possible,
 regardless of the setup on the main Onionoo instance?  I'd like us to try
 out Jetty on the mirrors, and if that goes well, switch the main instance
 to Jetty, too.

 > >  - Would you also want to update `INSTALL` by replacing the last
 section with new instructions?
 >
 > Patch with suggestions is attached.

 Thanks, applied to my branch.

 > >  - It seems that the `run` Ant target is not required anymore, and
 `bin/update.sh` needs updating, too.
 > I removed the 'run' task. And I think update.sh could be removed, too?
 You decide.

 Sure, I'm also fine with removing it.

 > >  - Are really all `jetty8-*.jar` files required?  Did you try taking
 out some of them?
 > I think so, as I only added them incrementally; but no guarantee ;-)

 Okay.

 > >  - I wonder if copying `logback.xml` can be avoided in `build.xml`.
 Or if possible, is it possible to avoid copying it to directories which
 otherwise contain files under version control (`etc/`)?
 > Removed the copying.

 Thanks.

 > >  - Can you explain why you switched from `<lib>` to
 `<zipgroupfileset>` and from `<classes>` to `<fileset>`?  I assume this is
 related to all-in-one jars?
 > Yes, it's the classpath: we need some classes/jars in the initial
 startup
 > (e.g. jetty-stuff and logging) and inside the web-app. Adding them to
 the
 > initial classpath seemed the best way to have all classes and
 dependencies in one place.
 > As we have an embedded server and only one web-app, this should be ok.

 Okay.

 > >  - Should we exclude test classes from generated .jar and .war files?
 I think I found test classes in both of them.
 > I only found some junit test classes in the war and added the necessary
 exclusions.

 Thanks.

 > >  - Should both back-end and front-end really log to the same files, or
 should we separate those?
 > Of course, they shouldn't ;-) Initially I thought they would be started
 in different folders and hence have separate logs.
 > Now, I made the logbase path configurable on the command line (cf.
 INSTALL patch).

 Looks good.  Should we also suggest paths for running/logging back-end and
 front-end?

 I might have more feedback when trying to deploy this branch on a mirror.
 Similarly, maybe you'll have more tweaks when trying the same.  I'd say
 let's merge when both of us successfully got this running.

 Thanks!

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/13089#comment:15>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list