diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..506cc54 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:latest +RUN apk update && apk add firefox make curl musl-locales dbus-x11 font-ubuntu-nerd jq --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing +ADD . /src +WORKDIR /src +RUN make profile.tgz # && \ +RUN chown -R 1000:1000 /src/build/profile # && \ +RUN chmod -R +w /src/build/profile +RUN ls -lah /src/build/profile +#USER 1000 +CMD sh -c 'cd build/profile && ./i2pbrowser.sh' \ No newline at end of file diff --git a/Makefile b/Makefile index 134ad38..cc42e47 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,7 @@ profile: build/profile/user.js build/profile/prefs.js build/profile/bookmarks.ht profile.tgz: .version profile # $(eval PROFILE_VERSION := $(shell cat src/profile/version.txt)) @echo "building profile tarball $(PROFILE_VERSION)" - bash -c 'ls I2P && cp -rv build/I2P build/profile/I2P'; true + sh -c 'ls I2P && cp -rv build/I2P build/profile/I2P'; true install -m755 src/unix/i2pbrowser.sh build/profile/i2pbrowser.sh cd build && tar -czf profile-$(PROFILE_VERSION).tgz profile && cp profile-$(PROFILE_VERSION).tgz ../ @@ -129,7 +129,7 @@ app-profile: .version build/app-profile/user.js build/app-profile/prefs.js build app-profile.tgz: app-profile # $(eval PROFILE_VERSION := $(shell cat src/app-profile/version.txt)) @echo "building app-profile tarball $(PROFILE_VERSION)" - bash -c 'ls I2P && cp -rv build/I2P build/app-profile/I2P'; true + sh -c 'ls I2P && cp -rv build/I2P build/app-profile/I2P'; true install -m755 src/unix/i2pconfig.sh build/app-profile/i2pconfig.sh cd build && tar -czf app-profile-$(PROFILE_VERSION).tgz app-profile && cp app-profile-$(PROFILE_VERSION).tgz ../ @@ -152,13 +152,15 @@ copy-app-xpi: build/NoScript.xpi build/HTTPSEverywhere.xpi build/i2prhz@eyedeeka cp build/HTTPSEverywhere.xpi "build/app-profile/extensions/https-everywhere-eff@eff.org.xpi" cp build/i2prhz@eyedeekay.github.io.xpi build/app-profile/extensions/i2prhz@eyedeekay.github.io.xpi -build/i2prhz@eyedeekay.github.io.xpi: +build-extensions: build/i2prhz@eyedeekay.github.io.xpi build/NoScript.xpi build/HTTPSEverywhere.xpi + +build/i2prhz@eyedeekay.github.io.xpi: i2psetproxy.url curl -L `cat i2psetproxy.url` > build/i2prhz@eyedeekay.github.io.xpi build/NoScript.xpi: NoScript.url curl -L `cat NoScript.url` > build/NoScript.xpi -build/HTTPSEverywhere.xpi : HTTPSEverywhere.url +build/HTTPSEverywhere.xpi: HTTPSEverywhere.url curl -L `cat HTTPSEverywhere.url` > build/HTTPSEverywhere.xpi clean-extensions: @@ -175,6 +177,8 @@ NoScript.url: i2psetproxy.url: @echo "https://addons.mozilla.org/firefox/downloads/file/3784917/"`./amo-version.sh i2pipb-rhizome-variant`"/i2prhz@eyedeekay.github.io" > i2psetproxy.url +#i2ppb@eyedeekay.github.io.xpi + build/profile/extensions: build/profile mkdir -p build/profile/extensions @@ -254,3 +258,17 @@ $(GOPATH)/src/i2pgit.org/idk/su3-tools/su3-tools: su3: $(GOPATH)/src/i2pgit.org/idk/su3-tools/su3-tools $(GOPATH)/src/i2pgit.org/idk/su3-tools/su3-tools -name "I2P-Profile-Installer-$(PROFILE_VERSION)" -signer "$(SIGNER)" -version "$(I2P_VERSION)" + +docker: + docker build -t geti2p/i2p.firefox . + +xhost: + xhost + local:docker + +run: docker xhost + docker run -it --rm \ + --net=host \ + -e DISPLAY=unix$(DISPLAY) \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + geti2p/i2p.firefox firefox --profile /src/build/profile + \ No newline at end of file diff --git a/README.md b/README.md index 6e62640..0f9fff3 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,25 @@ With that dependency satisfied, you can then run: to build the signing tool if necessary and then package the installer in a signed update file. +Docker Support +-------------- + +You can use a Docker container to install this browser profile as well. In order +to do this, you can run the commands: + + xhost + local:docker + docker run -it --rm \ + --net=host \ + -e DISPLAY=unix$(DISPLAY) \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + geti2p/i2p.firefox firefox --profile /src/build/profile + +To build and run the container locally, clone this repository and run the + + make run + +target. + Issues ------ diff --git a/src/unix/i2pbrowser.sh b/src/unix/i2pbrowser.sh index 41766ad..5bb33f6 100755 --- a/src/unix/i2pbrowser.sh +++ b/src/unix/i2pbrowser.sh @@ -40,4 +40,5 @@ if [ -z $FIREFOX ]; then exit 1 fi -$FIREFOX --profile "$BROWSING_PROFILE" $@ +echo $FIREFOX --profile "$BROWSING_PROFILE" $@ +$FIREFOX --profile "$BROWSING_PROFILE" $@ \ No newline at end of file