Commit Graph

48 Commits

Author SHA1 Message Date
meeh
48877079ca OSX Launcher: Log all events for debugging 2018-10-11 11:50:00 +00:00
meeh
d6fc0adb56 Mac OSX Launcher: Removed dmgconfig.py, added public domain to sharedqueue.h and updated xcode for the dmgconfig.py removal. 2018-09-30 13:42:32 +00:00
meeh
5041883d5a Mac OSX Launcher: Update readme regarding Oracle's downlad url. 2018-09-30 11:37:12 +00:00
meeh
5ed701dff3 Mac OSX Launcher: updates in logging, remove timestamp from Objc's MLog 2018-09-30 11:34:20 +00:00
meeh
410f9df4e4 Mac OSX Launcher: The launcher will now write the pid of the router to a file like the old wrapper did. 2018-09-30 11:29:21 +00:00
meeh
b5497ef72e Mac OSX Launcher: Cancel stream that can cause high cpu load on router stop. 2018-09-30 11:02:28 +00:00
meeh
2233f7f47b Mac OSX Launcher:
* Update readme about event manager
  * RouterTask can now detect a running router by scanning processes&arguments for i2p.jar
  * The logger will log to OSX's default: ~/Library/Logs/I2P/[whatever].log
2018-09-30 09:40:43 +00:00
meeh
36b758f2c0 Mac OSX Launcher: Removing unused/change-in-plans files 2018-09-30 09:37:51 +00:00
meeh
ae0d420f5f Mac OSX Launcher:
* Added script to check for latest java via xcode
  * Updated xcode project metadata files
  * Update dmg create script
  * Make xcode write version.h under build
  * Added template for version.h
2018-09-30 09:35:28 +00:00
meeh
b40b987c0f Mac OSX Launcher:
* Fixed issue with >> and compilers in C++ in subprocess.hpp
  * Added queue for logger
  * Misc
2018-09-30 09:32:49 +00:00
meeh
e8d371ed9b Mac OSX Launcher: C api of the logger to become available for Swift/Objective-C 2018-09-30 09:31:29 +00:00
meeh
5a0017a8fe Mac OSX Launcher: Adding a logger library I wrote a good while ago, refactored it to work with the launcher. 2018-09-30 09:30:39 +00:00
meeh
22a0f396e6 Mac OS X Launcher:
* Enabled Apple's "Hardened Runtime", however unsecure memory had to be allowed to spawn java etc.
  * Updated docs about Event Manager code
  * Make the launcher handle cases where extract is incomplete or invalid
  * Bugfixes as always
2018-09-26 20:42:58 +00:00
meeh
7a72049e28 Mac OS X Launcher:
* Bugfixes as always
  * Added Sparkle (native updater, https://sparkle-project.org/ )
  * The launcher will now extract and overwrite older versions if found
  * Rewrite of the java extraction part (to enable overwrite)
  * Move more functionality to use EventManager as it works quite well
  * Added check for updates menu item
2018-09-23 03:33:29 +00:00
meeh
3b38f5a161 Mac OS X Launcher:
* In general bugfixes
  * Introduced event manager for better control flow
  * Splitted RouterStatusView to own file
  * Added shell script to setup and produce dmg file
2018-09-22 22:13:40 +00:00
meeh
70fa2dae0a Mac OS X Launcher: Let version detection etc happen even a router is already started. 2018-09-20 03:27:37 +00:00
meeh
85ebb2f847 Mac OS X Launcher: Removed unused header file. 2018-09-20 03:22:41 +00:00
meeh
e8decff5cd Mac OS X Launcher: more cleanup and some bugfixes. 2018-09-20 03:20:39 +00:00
meeh
3c0a8cf4ab Mac OSX Launcher: A lot of bugfixes, refactoring and cleanup. 2018-09-20 02:38:44 +00:00
meeh
eb81cadac0 OSX Launcher: Removing script for old build system 2018-09-19 19:12:26 +00:00
meeh
e046418f8f Cleaning up the code base, remove dead code and failed attempts. 2018-09-19 17:00:17 +00:00
meeh
9b958e4427 Moving replace function to strutil.hpp 2018-09-19 16:03:39 +00:00
meeh
281c5f579f Bugfixes, improvements, more error handling and stability to the osx launcher. 2018-09-19 00:37:16 +00:00
meeh
f76874ac19 Adding XCode workspace & Xcode project, and some files missing from last commit.
Please note that Xcode project embedds the packing script (meaning it runs "ant" - zip files, and moves it to bundle)
2018-09-18 15:39:32 +00:00
meeh
7615b9236b Adding all new code, removed a lot obsolete code and fixed import paths etc.
Mac OS X launcher:
* UI built on Swift
  * Why?
    * Apple seems to on purpose make it harder to get into Objective-C these days
    * Swift is compiled to native code, but has easiness of Javascript in programming
    * Perfect for the OS X UI, many guides & tutorials as well
* "Backend" in Objective-C++ / C++14
  * Why?
    * Originally written in Objective-C / C++14 with C++17 backports
    * Only for backend because of the time the development takes
    *

Short summary of features:

* Java
  * It can detect java from:
    * JAVA_HOME environment variable
    * "Internet Plug-Ins" Apple stuff
    * By the /usr/libexec/java_home binary helper
  * It can unpack a new version of I2P
    * Unpacks to ~/Library/I2P
    * Can check currently unpacked version in ~/Library/I2P via i2p.jar's "net.i2p.CoreVersion"

  * User Interface (a popover, see https://youtu.be/k8L3lQ5rUq0 for example of this concept)
    * Router control tab view
      * It can start the router
      * It can stop the router
      * It can detect already running router, then avoid fireing up one
      * It can show basic information about the router state & version
    * Log view tab (not yet done)
  * While left-click triggers popover, right-click draws a minimal context menu
2018-09-18 15:36:38 +00:00
meeh
1bddf5527a Commiting XCode's image/resources library alone since it's massive with blobs. 2018-09-18 15:20:21 +00:00
meeh
beede9505e Preparing for XCode project. Removing now obsolete files. 2018-09-18 15:19:23 +00:00
meeh
8bebda2e35 Remove duplicated file. 2018-08-18 15:47:35 +00:00
meeh
f9fbc76dd0 Code changes:
* Port check to see if i2p is already running.
* All buttons in the menu should work now.
* Rewrote some C++ to Objective-C, which fits better with the integration.
* Misc cleanup.
* Made the launch of router repeatable.
2018-07-24 16:26:40 +00:00
meeh
2ee1a212c8 Added BufferedOutputStream to BaseExtractor for better performance. 2018-07-24 16:23:08 +00:00
meeh
fe41dec699 Adding OSX graphics. 2018-07-24 16:21:53 +00:00
meeh
a92993e05b Added some more header files, and fixed much of the build system. 2018-07-13 10:10:04 +00:00
meeh
8c78d4f83e A functional programming "library" (some headers with some magic love found in scala) 2018-07-13 10:09:08 +00:00
meeh
c8490a3140 Starting to get stable and usable. Basically everything is based on callbacks. 2018-07-13 09:11:46 +00:00
meeh
6d0f80fa1e Fixed a load of issues related to my "sync" approach, and Mac OSX's "async" API. 2018-07-13 06:30:16 +00:00
meeh
21b3864dfd Moved some logic to C++, which will extract i2p if it's not already,
and then secondly fire up the router in a second java process when 
extraction is completed. Gonna use "optional" type in C++ to make
global variables a bit less painful to use.
2018-07-08 13:16:07 +00:00
meeh
27a0d4e51e Removing some Scala classes for the Mac OSX laucher,
since the C++ code replaces it's functionallity.
2018-07-08 13:12:51 +00:00
meeh
d4dd0ea982 Adjustments in Scala code to adopt to work with the Obj-C++ code. 2018-06-30 13:11:17 +00:00
meeh
0b01cc5070 Adding codebase for the Objective-C++ part of the Mac OS X launcher/wrapper. 2018-06-30 13:10:06 +00:00
meeh
5f81a8de59 Mac OS X Launcher - reborn - ALPHA!
TLDR;
Howto? ant osxLauncher
Privacy Notes? If you don't got SBT, a bash script will trigger
               download of SBT for you with task osxLauncher.
Results? open ./launchers/output
"Binary" App Bundle name: I2P.app
Runtime base directory? ~/Library/I2P
Runtime config directory? untouched.

After talk on IRC with zzz, I rewrote the logic since we could
start with a simple deploy, for a faster alpha version ready :)

SBT will build a zip file from the content of pkg-temp, which
CompleteDeployment.scala will again unzip in runtime. Right now
it's quite basic, but the plan is to add version detection, so
it's capable of upgrading a already deployed I2P base directory.

OSXDeployment.scala is renamed to PartialDeployment.scala for usage
in the browser bundle launcher, since it's going to be a subset of
the files found in pkg-temp.

A Info.plist is added to the launchers/macosx which is added to the
application bundle under building. Note that this differ from the one
in Start i2p router.app that's been here for years now.
2018-05-05 23:34:35 +00:00
meeh
70e994fcf3 Some changes, after much testing I find it best to spawn an sub java
process for I2P rather than trying to load Router via reflection or
anything runtime fancy stuff. Shell script is implemented in SBT now,
and can now link to download JRE script and so on.
2018-05-02 03:39:14 +00:00
meeh
f6c8e44329 Jar deployment, SBT hacking, and more related to launcher code.
Some refactoring, bugfixing, and self awareness of launcher jar.
2018-05-01 11:15:11 +00:00
meeh
345e7414e6 Change current directory to base directory before starting the router. 2018-05-01 03:43:41 +00:00
meeh
975d8a069a Cleaned up in SBT build file. Sorted assignments, task definitions and such. 2018-05-01 03:21:04 +00:00
meeh
a3a8ee1329 Major update for the OSX Launcher code. Now it will bundle
installer resources with the fat jar (we add an exclusion list later)
which the base directory will be built(or updated if lacking files) upon
startup of the I2P router. This is done by the OSXDeployment class which
is an extension for the DeployProfile class written for Mac OS X.

Since the app bundle itself should be R/O, we use ~/Library/I2P as base path,
and continue using ~/Library/Application Support/i2p as config path. The BB
code will have other paths.
2018-05-01 02:54:36 +00:00
meeh
4f47fab139 Removed unused resources directory hopefully,
And aslo added an IconHelper autoplugin which
will generate Mac OS X valid ICNS images.
2018-04-24 05:01:25 +00:00
meeh
8adf55a568 Still WIP, but I've added a new sbt plugin named
sbt-native-packager for future rpm/deb/windows and 
maybe even OSX packages. Also, the macosx sbt project 
now has a task named buildAppBundleTask and which will 
produce an I2P.app and copy over needed directories/jars/wars
which later needs to be extracted to an writeable area which
would be i2p base directory in runtime.

The MacOSXRouterLauncherApp contains more information about how 
the executable in the OS X bundle will locate our R/O i2pbase so 
it can copy it to a writable area. The R/O is also to ensure valid
signature on the bundle.

At last, this approach is done casue letting an Mach-O binary load
libjvm.dylib was proved unstable, so MacOSXRouterLauncherApp will 
rather use an JNI module to load the needed glue with the 
Mac OS X system.
2018-04-24 04:18:21 +00:00
meeh
8c10ec9db3 Realised a better way to handle the build process of both the
Browser Bundle i2p launcher, as well as the upcoming Mac OS X
i2p launcher. They share some few properties and how code has
to be managed for both system's update managers and so on.
More details will be documentated in README.md files as well as
in those commit messages I now write :)
2018-04-22 23:13:32 +00:00