mirror of
https://github.com/casjaysdevdocker/tor-browser
synced 2025-01-18 00:34:21 -05:00
🦈🏠🐜❗ Initial Commit ❗🐜🦈🏠
This commit is contained in:
commit
dcbfa78f2d
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Files to ignore
|
||||||
|
.gitkeep
|
||||||
|
.gitignore
|
||||||
|
.node_modules/**
|
93
.gitignore
vendored
Normal file
93
.gitignore
vendored
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
# gitignore created on 10/16/22 at 11:25
|
||||||
|
# Disable reminder in prompt
|
||||||
|
ignoredirmessage
|
||||||
|
|
||||||
|
# OS generated files
|
||||||
|
### Linux ###
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# Linux trash folder which might appear on any partition or disk
|
||||||
|
.Trash-*
|
||||||
|
|
||||||
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
|
.nfs*
|
||||||
|
|
||||||
|
### macOS ###
|
||||||
|
# General
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
.com.apple.timemachine.donotpresent
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
### macOS Patch ###
|
||||||
|
# iCloud generated files
|
||||||
|
*.icloud
|
||||||
|
|
||||||
|
### Windows ###
|
||||||
|
# Windows thumbnail cache files
|
||||||
|
Thumbs.db
|
||||||
|
Thumbs.db:encryptable
|
||||||
|
ehthumbs.db
|
||||||
|
ehthumbs_vista.db
|
||||||
|
|
||||||
|
# Dump file
|
||||||
|
*.stackdump
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
[Dd]esktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msix
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
# Other
|
||||||
|
**/.installed
|
||||||
|
|
||||||
|
# ignore commit message
|
||||||
|
**/.gitcommit
|
||||||
|
|
||||||
|
#ignore .failed
|
||||||
|
**/.build_failed
|
||||||
|
|
||||||
|
# ignore .bak files
|
||||||
|
**/*.bak
|
||||||
|
|
||||||
|
# ignore .no_push files
|
||||||
|
**/.no_push
|
||||||
|
|
||||||
|
# ignore .no_git files
|
||||||
|
**/.no_git
|
||||||
|
|
122
Dockerfile
Normal file
122
Dockerfile
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
FROM casjaysdevdocker/debian:latest AS build
|
||||||
|
|
||||||
|
ARG DEBIAN_VERSION="bullseye"
|
||||||
|
|
||||||
|
ARG DEFAULT_DATA_DIR="/home/x11user/.local/share/torbrowser/Browser/TorBrowser/Data/Browser" \
|
||||||
|
DEFAULT_CONF_DIR="/usr/local/share/template-files/config" \
|
||||||
|
DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults"
|
||||||
|
|
||||||
|
ENV LANG=en_US.utf8 \
|
||||||
|
TZ="America/New_York" \
|
||||||
|
SHELL="/bin/bash" \
|
||||||
|
TERM="xterm-256color" \
|
||||||
|
DEBIAN_FRONTEND="noninteractive" \
|
||||||
|
TOR_BROWSER_VERSION="11.5.4"
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
rm -Rf "/etc/apt/sources.list" ; \
|
||||||
|
mkdir -p "${DEFAULT_DATA_DIR}" "${DEFAULT_CONF_DIR}" "${DEFAULT_TEMPLATE_DIR}" "/etc/sudoers.d" "/tmp/tor-profile"; \
|
||||||
|
echo 'export DEBIAN_FRONTEND="noninteractive"' >"/etc/profile.d/apt.sh" && chmod 755 "/etc/profile.d/apt.sh" && \
|
||||||
|
echo "deb http://deb.debian.org/debian ${DEBIAN_VERSION} main contrib non-free" >>"/etc/apt/sources.list" ; \
|
||||||
|
echo "deb http://deb.debian.org/debian ${DEBIAN_VERSION}-updates main contrib non-free" >>"/etc/apt/sources.list" ; \
|
||||||
|
echo "deb http://deb.debian.org/debian-security/ ${DEBIAN_VERSION}-security main contrib non-free" >>"/etc/apt/sources.list" ; \
|
||||||
|
apt-get update -yy && apt-get upgrade -yy && apt-get install -yy \
|
||||||
|
bash \
|
||||||
|
sudo \
|
||||||
|
tini \
|
||||||
|
x11-apps \
|
||||||
|
xz-utils \
|
||||||
|
iproute2 \
|
||||||
|
firefox-esr && \
|
||||||
|
apt-get remove firefox-esr -yy && \
|
||||||
|
useradd --shell /bin/bash --create-home --home-dir /home/x11user x11user && \
|
||||||
|
usermod -a -G audio,video x11user && \
|
||||||
|
echo "x11user ALL=(ALL) NOPASSWD: ALL" >"/etc/sudoers.d/x11user" && \
|
||||||
|
apt-get clean ; \
|
||||||
|
rm -rf /lib/systemd/system/multi-user.target.wants/* ; \
|
||||||
|
rm -rf /etc/systemd/system/*.wants/* ; \
|
||||||
|
rm -rf /lib/systemd/system/local-fs.target.wants/* ; \
|
||||||
|
rm -rf /lib/systemd/system/sockets.target.wants/*udev* ; \
|
||||||
|
rm -rf /lib/systemd/system/sockets.target.wants/*initctl* ; \
|
||||||
|
rm -rf /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* ; \
|
||||||
|
rm -rf /lib/systemd/system/systemd-update-utmp*
|
||||||
|
|
||||||
|
COPY ./bin/. /usr/local/bin/
|
||||||
|
COPY ./config/. ${DEFAULT_CONF_DIR}/
|
||||||
|
COPY ./data/. /tmp/tor-profile/
|
||||||
|
|
||||||
|
RUN install-tor-browser && \
|
||||||
|
cp -Rf /tmp/tor-profile/tor/. ${DEFAULT_DATA_DIR}/ && \
|
||||||
|
chown -Rf x11user:x11user "/home/x11user"
|
||||||
|
|
||||||
|
RUN echo 'Running cleanup' ; \
|
||||||
|
update-alternatives --install /bin/sh sh /bin/bash 1 ; \
|
||||||
|
rm -Rf /usr/share/doc/* /usr/share/info/* ; \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ; \
|
||||||
|
rm -Rf /usr/local/bin/.gitkeep /config /data /var/lib/apt/lists/* ; \
|
||||||
|
rm -rf /lib/systemd/system/multi-user.target.wants/* ; \
|
||||||
|
rm -rf /etc/systemd/system/*.wants/* ; \
|
||||||
|
rm -rf /lib/systemd/system/local-fs.target.wants/* ; \
|
||||||
|
rm -rf /lib/systemd/system/sockets.target.wants/*udev* ; \
|
||||||
|
rm -rf /lib/systemd/system/sockets.target.wants/*initctl* ; \
|
||||||
|
rm -rf /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* ; \
|
||||||
|
rm -rf /lib/systemd/system/systemd-update-utmp* ; \
|
||||||
|
if [ -d "/lib/systemd/system/sysinit.target.wants" ]; then cd "/lib/systemd/system/sysinit.target.wants" && rm $(ls | grep -v systemd-tmpfiles-setup) ; fi
|
||||||
|
|
||||||
|
#FROM scratch
|
||||||
|
|
||||||
|
ARG PHP_SERVER="php" \
|
||||||
|
NODE_VERSION="14" \
|
||||||
|
NODE_MANAGER="system" \
|
||||||
|
SERVICE_PORT="" \
|
||||||
|
EXPOSE_PORTS="" \
|
||||||
|
LICENSE="MIT" \
|
||||||
|
IMAGE_NAME="tor-browser" \
|
||||||
|
BUILD_VERSION="latest" \
|
||||||
|
TIMEZONE="America/New_York" \
|
||||||
|
BUILD_DATE="2022-10-15"
|
||||||
|
|
||||||
|
LABEL maintainer="CasjaysDev <docker-admin@casjaysdev.com>" \
|
||||||
|
org.opencontainers.image.vendor="CasjaysDev" \
|
||||||
|
org.opencontainers.image.authors="CasjaysDev" \
|
||||||
|
org.opencontainers.image.vcs-type="Git" \
|
||||||
|
org.opencontainers.image.name="${IMAGE_NAME}" \
|
||||||
|
org.opencontainers.image.base.name="${IMAGE_NAME}" \
|
||||||
|
org.opencontainers.image.license="${LICENSE}" \
|
||||||
|
org.opencontainers.image.vcs-ref="${BUILD_VERSION}" \
|
||||||
|
org.opencontainers.image.build-date="${BUILD_DATE}" \
|
||||||
|
org.opencontainers.image.version="${BUILD_VERSION}" \
|
||||||
|
org.opencontainers.image.schema-version="${BUILD_VERSION}" \
|
||||||
|
org.opencontainers.image.url="https://hub.docker.com/r/casjaysdevdocker/${IMAGE_NAME}" \
|
||||||
|
org.opencontainers.image.vcs-url="https://github.com/casjaysdevdocker/${IMAGE_NAME}" \
|
||||||
|
org.opencontainers.image.url.source="https://github.com/casjaysdevdocker/${IMAGE_NAME}" \
|
||||||
|
org.opencontainers.image.documentation="https://hub.docker.com/r/casjaysdevdocker/${IMAGE_NAME}" \
|
||||||
|
org.opencontainers.image.description="Containerized version of ${IMAGE_NAME}"
|
||||||
|
|
||||||
|
ENV LANG=en_US.utf8 \
|
||||||
|
ENV=~/.bashrc \
|
||||||
|
SHELL="/bin/bash" \
|
||||||
|
PORT="${SERVICE_PORT}" \
|
||||||
|
TERM="xterm-256color" \
|
||||||
|
PHP_SERVER="${PHP_SERVER}" \
|
||||||
|
NODE_VERSION="${NODE_VERSION}" \
|
||||||
|
NODE_MANAGER="${NODE_MANAGER}" \
|
||||||
|
CONTAINER_NAME="${IMAGE_NAME}" \
|
||||||
|
TZ="${TZ:-America/New_York}" \
|
||||||
|
TIMEZONE="${TZ:-$TIMEZONE}" \
|
||||||
|
HOSTNAME="casjaysdev-${IMAGE_NAME}" \
|
||||||
|
USER="x11user"
|
||||||
|
|
||||||
|
#COPY --from=build /. /
|
||||||
|
|
||||||
|
USER x11user
|
||||||
|
WORKDIR /home/x11user
|
||||||
|
|
||||||
|
VOLUME [ "/tmp/.X11-unix", "${HOME}/.Xauthority", ]
|
||||||
|
|
||||||
|
EXPOSE $EXPOSE_PORTS
|
||||||
|
|
||||||
|
CMD [ "$@" ]
|
||||||
|
ENTRYPOINT [ "tini", "-p", "SIGTERM", "--", "/usr/local/bin/entrypoint-tor-browser.sh" ]
|
||||||
|
HEALTHCHECK --start-period=1m --interval=2m --timeout=3s CMD [ "/usr/local/bin/entrypoint-tor-browser.sh", "healthcheck" ]
|
||||||
|
|
13
LICENSE.md
Normal file
13
LICENSE.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
Version 2, December 2004
|
||||||
|
|
||||||
|
Copyright (C) 2022 casjay <git-admin@casjaysdev.com>
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim or modified
|
||||||
|
copies of this license document, and changing it is allowed as long
|
||||||
|
as the name is changed.
|
||||||
|
|
||||||
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
1. You just DO WHAT THE FUCK YOU WANT TO.
|
36
README.md
Normal file
36
README.md
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
## 👋 Welcome to tor-browser 🚀
|
||||||
|
|
||||||
|
tor-browser README
|
||||||
|
|
||||||
|
|
||||||
|
## Install my system scripts
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sudo bash -c "$(curl -q -LSsf "https://github.com/systemmgr/installer/raw/main/install.sh")"
|
||||||
|
sudo systemmgr --config && sudo systemmgr install scripts
|
||||||
|
```
|
||||||
|
|
||||||
|
## Get source files
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dockermgr download src tor-browser
|
||||||
|
```
|
||||||
|
|
||||||
|
OR
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone "https://github.com/casjaysdevdocker/tor-browser" "$HOME/Projects/github/casjaysdevdocker/tor-browser"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Build container
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd "$HOME/Projects/github/casjaysdevdocker/tor-browser"
|
||||||
|
buildx
|
||||||
|
```
|
||||||
|
|
||||||
|
## Authors
|
||||||
|
|
||||||
|
🤖 casjay: [Github](https://github.com/casjay) [Docker](https://hub.docker.com/r/casjay) 🤖
|
||||||
|
📽 dockermgr: [Github](https://github.com/dockermgr) [Docker](https://hub.docker.com/r/dockermgr) 📽
|
||||||
|
⛵ CasjaysDev Docker: [Github](https://github.com/casjaysdevdocker) [Docker](https://hub.docker.com/r/casjaysdevdocker) ⛵
|
150
bin/entrypoint-tor-browser.sh
Executable file
150
bin/entrypoint-tor-browser.sh
Executable file
@ -0,0 +1,150 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck shell=bash
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
##@Version : 202210152122-git
|
||||||
|
# @@Author : Jason Hempstead
|
||||||
|
# @@Contact : jason@casjaysdev.com
|
||||||
|
# @@License : WTFPL
|
||||||
|
# @@ReadME : entrypoint-tor-browser.sh --help
|
||||||
|
# @@Copyright : Copyright: (c) 2022 Jason Hempstead, Casjays Developments
|
||||||
|
# @@Created : Saturday, Oct 15, 2022 21:22 EDT
|
||||||
|
# @@File : entrypoint-tor-browser.sh
|
||||||
|
# @@Description :
|
||||||
|
# @@Changelog : New script
|
||||||
|
# @@TODO : Better documentation
|
||||||
|
# @@Other :
|
||||||
|
# @@Resource :
|
||||||
|
# @@Terminal App : no
|
||||||
|
# @@sudo/root : no
|
||||||
|
# @@Template : other/docker-entrypoint
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# Set bash options
|
||||||
|
[ -n "$DEBUG" ] && set -x
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
APPNAME="$(basename "$0" 2>/dev/null)"
|
||||||
|
VERSION="202210152122-git"
|
||||||
|
HOME="${USER_HOME:-$HOME}"
|
||||||
|
USER="${SUDO_USER:-$USER}"
|
||||||
|
RUN_USER="${SUDO_USER:-$USER}"
|
||||||
|
SCRIPT_SRC_DIR="${BASH_SOURCE%/*}"
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# Set functions
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
__exec_command() {
|
||||||
|
local exitCode=0
|
||||||
|
local cmd="${*:-bash -l}"
|
||||||
|
echo "Executing command: $cmd"
|
||||||
|
eval $cmd || exitCode=10
|
||||||
|
[ "$exitCode" = 0 ] || exitCode=10
|
||||||
|
return ${exitCode:-$?}
|
||||||
|
}
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
__heath_check() {
|
||||||
|
local status=0
|
||||||
|
local health="Good"
|
||||||
|
#__pgrep "bash" || status=$(($status + 1))
|
||||||
|
#__curl "http://localhost/server-health" || status=$(($status + 1))
|
||||||
|
[ "$status" -eq 0 ] || health="Errors reported see docker logs --follow $CONTAINER_NAME"
|
||||||
|
echo "$(uname -s) $(uname -m) is running and the health is: $health"
|
||||||
|
return ${status:-$?}
|
||||||
|
}
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# Additional functions
|
||||||
|
__pgrep() { ps aux 2>/dev/null | grep -F "$@" | grep -qv 'grep' || return 10; }
|
||||||
|
__find() { find "$1" -mindepth 1 -type f,d 2>/dev/null | grep '^' || return 10; }
|
||||||
|
__curl() { curl -q -LSsf -o /dev/null -s -w "200" "$@" 2>/dev/null || return 10; }
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
__certbot() {
|
||||||
|
[ -n "$SSL_CERT_BOT" ] && type -P certbot &>/dev/null || { export SSL_CERT_BOT="" return 10; }
|
||||||
|
certbot certonly --webroot -w "${WWW_ROOT_DIR:-/data/htdocs/www}" -d $DOMANNAME -d $DOMANNAME \
|
||||||
|
--put-all-related-files-into "$SSL_DIR" –key-path "$SSL_KEY" –fullchain-path "$SSL_CERT"
|
||||||
|
}
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
__heath_check() {
|
||||||
|
local status=0 health="Good"
|
||||||
|
__pgrep "$SERVICE" || status=$(($status + 1))
|
||||||
|
#__curl "http://localhost/server-health" || status=$(($status + 1))
|
||||||
|
[ "$status" -eq 0 ] || health="Errors reported see docker logs --follow $CONTAINER_NAME"
|
||||||
|
echo "$(uname -s) $(uname -m) is running and the health is: $health"
|
||||||
|
return ${status:-$?}
|
||||||
|
}
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# Define default variables - do not change these - redifine with -e or set under Additional
|
||||||
|
SERVICE="$CONTAINER_NAME"
|
||||||
|
LANG="${LANG:-C.UTF-8}"
|
||||||
|
DOMANNAME="${DOMANNAME:-}"
|
||||||
|
DISPLAY="${DISPLAY:-:0.0}"
|
||||||
|
TZ="${TZ:-America/New_York}"
|
||||||
|
HTTP_PORT="${HTTP_PORT:-80}"
|
||||||
|
HTTPS_PORT="${HTTPS_PORT:-443}"
|
||||||
|
SERVICE_PORT="${SERVICE_PORT:-}"
|
||||||
|
HOSTNAME="${HOSTNAME:-casjaysdev-bin}"
|
||||||
|
HOSTADMIN="${HOSTADMIN:-root@${DOMANNAME:-$HOSTNAME}}"
|
||||||
|
SSL_CERT_BOT="${SSL_CERT_BOT:-false}"
|
||||||
|
SSL_ENABLED="${SSL_ENABLED:-false}"
|
||||||
|
SSL_DIR="${SSL_DIR:-/config/ssl}"
|
||||||
|
SSL_CA="${SSL_CA:-$SSL_DIR/ca.crt}"
|
||||||
|
SSL_KEY="${SSL_KEY:-$SSL_DIR/server.key}"
|
||||||
|
SSL_CERT="${SSL_CERT:-$SSL_DIR/server.crt}"
|
||||||
|
SSL_CONTAINER_DIR="${SSL_CONTAINER_DIR:-/etc/ssl/CA}"
|
||||||
|
WWW_ROOT_DIR="${WWW_ROOT_DIR:-/data/htdocs}"
|
||||||
|
LOCAL_BIN_DIR="${LOCAL_BIN_DIR:-/usr/local/bin}"
|
||||||
|
DEFAULT_DATA_DIR="${DEFAULT_CONF_DIR:-/usr/local/share/template-files/data}"
|
||||||
|
DEFAULT_CONF_DIR="${DEFAULT_CONF_DIR:-/usr/local/share/template-files/config}"
|
||||||
|
DEFAULT_TEMPLATE_DIR="${DEFAULT_TEMPLATE_DIR:-/usr/local/share/template-files/defaults}"
|
||||||
|
CONTAINER_IP_ADDRESS="$(ip a | grep 'inet' | grep -v '127.0.0.1' | awk '{print $2}' | sed 's|/*||g')"
|
||||||
|
export DISPLAY
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
[ "$(whoami)" = "root" ] && cd "/root" || cd "${HOME:-/tmp}"
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# Set timezone
|
||||||
|
[ -n "${TZ}" ] && echo "${TZ}" | sudo tee "/etc/timezone"
|
||||||
|
[ -f "/usr/share/zoneinfo/${TZ}" ] && sudo ln -sf "/usr/share/zoneinfo/${TZ}" "/etc/localtime"
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# Set hostname
|
||||||
|
if [ -n "${HOSTNAME}" ]; then
|
||||||
|
echo "${HOSTNAME}" | sudo tee "/etc/hostname"
|
||||||
|
echo "127.0.0.1 ${HOSTNAME} localhost ${HOSTNAME}.local" | sudo tee "/etc/hosts"
|
||||||
|
fi
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# Add domain to hosts file
|
||||||
|
if [ -n "$DOMANNAME" ]; then
|
||||||
|
echo "${HOSTNAME}.${DOMANNAME:-local}" | sudo tee "/etc/hostname"
|
||||||
|
echo "127.0.0.1 ${HOSTNAME} localhost ${HOSTNAME}.local" | sudo tee "/etc/hosts"
|
||||||
|
echo "${CONTAINER_IP_ADDRESS:-127.0.0.1} ${HOSTNAME}.${DOMANNAME}" | sudo tee -a "/etc/hosts"
|
||||||
|
fi
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# Additional commands
|
||||||
|
[ -f "/tmp/.Xauthority" ] && ln -sf "/tmp/.Xauthority" "$HOME/.Xauthority"
|
||||||
|
[ -f "/home/user/.Xauthority" ] && ln -sf "/home/user/.Xauthority" "$HOME/.Xauthority"
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
case "$1" in
|
||||||
|
--help) # Help message
|
||||||
|
echo 'Docker container for '$APPNAME''
|
||||||
|
echo "Usage: $APPNAME [healthcheck, bash, command]"
|
||||||
|
echo "Failed command will have exit code 10"
|
||||||
|
echo ""
|
||||||
|
exit ${exitCode:-$?}
|
||||||
|
;;
|
||||||
|
|
||||||
|
healthcheck) # Docker healthcheck
|
||||||
|
__heath_check || exitCode=10
|
||||||
|
exit ${exitCode:-$?}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*/bin/sh | */bin/bash | bash | shell | sh) # Launch shell
|
||||||
|
shift 1
|
||||||
|
__exec_command "${@:-/bin/bash}"
|
||||||
|
exit ${exitCode:-$?}
|
||||||
|
;;
|
||||||
|
|
||||||
|
*) # Execute primary command
|
||||||
|
exec tor-browser "$@"
|
||||||
|
[ -f "/tmp/init.pid" ] ||{ touch "/tmp/init.pid" && bash -l; }
|
||||||
|
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# end of entrypoint
|
||||||
|
exit ${exitCode:-$?}
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
37
bin/install-tor-browser
Executable file
37
bin/install-tor-browser
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
# shellcheck shell=sh
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
##@Version : 202210152147-git
|
||||||
|
# @@Author : Jason Hempstead
|
||||||
|
# @@Contact : jason@casjaysdev.com
|
||||||
|
# @@License : LICENSE.md
|
||||||
|
# @@ReadME : start-tor-browser --help
|
||||||
|
# @@Copyright : Copyright: (c) 2022 Jason Hempstead, Casjays Developments
|
||||||
|
# @@Created : Saturday, Oct 15, 2022 21:47 EDT
|
||||||
|
# @@File : start-tor-browser
|
||||||
|
# @@Description :
|
||||||
|
# @@Changelog : New script
|
||||||
|
# @@TODO : Better documentation
|
||||||
|
# @@Other :
|
||||||
|
# @@Resource :
|
||||||
|
# @@Terminal App : no
|
||||||
|
# @@sudo/root : no
|
||||||
|
# @@Template : other/start-service
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# Overwrite variables
|
||||||
|
TOR_BROWSER_VERSION="${TOR_BROWSER_VERSION:-11.5.4}"
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# Actions based on env
|
||||||
|
[ -d "/home/x11user/.local/share/torbrowser" ] || mkdir -p "/home/x11user/.local/share/torbrowser"
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
if [ "$(uname -m)" = "aarch64" ]; then
|
||||||
|
curl -q -LSsf "https://sourceforge.net/projects/tor-browser-ports/files/${TOR_BROWSER_VERSION}/tor-browser-linux-arm64-${TOR_BROWSER_VERSION}_en-US.tar.xz" -o "/tmp/torbrowser.tar.xz"
|
||||||
|
tar --strip 1 -xvJf "/tmp/torbrowser.tar.xz" -C "/home/x11user/.local/share/torbrowser"
|
||||||
|
elif [ "$(uname -m)" = "x86_64" ]; then
|
||||||
|
curl -q -LSsf "https://www.torproject.org/dist/torbrowser/${TOR_BROWSER_VERSION}/tor-browser-linux64-${TOR_BROWSER_VERSION}_en-US.tar.xz" -o "/tmp/torbrowser.tar.xz"
|
||||||
|
tar --strip 1 -xvJf "/tmp/torbrowser.tar.xz" -C "/home/x11user/.local/share/torbrowser"
|
||||||
|
else
|
||||||
|
echo "Unsupported platform"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
31
bin/tor-browser
Executable file
31
bin/tor-browser
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
DEFAULT_START="${DEFAULT_START:-http://check.torproject.org}"
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
[ "$1" = "" ] && shift 1
|
||||||
|
[ "$1" = " " ] && shift 1
|
||||||
|
[ "$1" = "torbrowser" ] && shift 1
|
||||||
|
[ "$1" = "tor-browser" ] && shift 1
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
if [ -f "/tmp/torbrowser.pid" ]; then
|
||||||
|
echo "tor is already running"
|
||||||
|
elif [ -z "$DISPLAY" ]; then
|
||||||
|
echo 'The DISPLAY variable is not set please run' 1>&2
|
||||||
|
echo 'docker run -ti -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v "$HOME/.Xauthority:/home/x11user/.Xauthority"' 1>&2
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
trap '[ -f "/tmp/torbrowser.pid" ] && rm -Rf "/tmp/torbrowser.pid"' EXIT
|
||||||
|
touch "/tmp/torbrowser.pid"
|
||||||
|
eval "/home/x11user/.local/share/torbrowser/Browser/firefox" "${1:-$DEFAULT_START}" &
|
||||||
|
pid="$!" && sleep 30
|
||||||
|
if [ -n "$(pgrep firefox)" ]; then
|
||||||
|
echo 'Started tor-browser: '$pid''
|
||||||
|
wait -f "$pid"
|
||||||
|
rm -Rf "/tmp/torbrowser.pid"
|
||||||
|
else
|
||||||
|
echo "Failed to start torbrowser"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
0
config/.gitkeep
Normal file
0
config/.gitkeep
Normal file
0
data/.gitkeep
Normal file
0
data/.gitkeep
Normal file
101
data/tor/profile.default/prefs.js
Normal file
101
data/tor/profile.default/prefs.js
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
// Mozilla User Preferences
|
||||||
|
|
||||||
|
// DO NOT EDIT THIS FILE.
|
||||||
|
//
|
||||||
|
// If you make changes to this file while the application is running,
|
||||||
|
// the changes will be overwritten when the application exits.
|
||||||
|
//
|
||||||
|
// To change a preference value, you can either:
|
||||||
|
// - modify it via the UI (e.g. via about:config in the browser); or
|
||||||
|
// - set it within a user.js file in your profile.
|
||||||
|
|
||||||
|
user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1665946423);
|
||||||
|
user_pref("app.update.lastUpdateTime.background-update-timer", 1665946183);
|
||||||
|
user_pref("app.update.lastUpdateTime.browser-cleanup-thumbnails", 1665945934);
|
||||||
|
user_pref("app.update.lastUpdateTime.search-engine-update-timer", 1665946063);
|
||||||
|
user_pref("app.update.lastUpdateTime.services-settings-poll-changes", 1665946303);
|
||||||
|
user_pref("app.update.lastUpdateTime.xpi-signature-verification", 1665946543);
|
||||||
|
user_pref("browser.bookmarks.addedImportButton", true);
|
||||||
|
user_pref("browser.contentblocking.category", "standard");
|
||||||
|
user_pref("browser.ctrlTab.sortByRecentlyUsed", true);
|
||||||
|
user_pref("browser.display.background_color", "#000000");
|
||||||
|
user_pref("browser.display.foreground_color", "#ffffff");
|
||||||
|
user_pref("browser.download.viewableInternally.typeWasRegistered.svg", true);
|
||||||
|
user_pref("browser.download.viewableInternally.typeWasRegistered.webp", true);
|
||||||
|
user_pref("browser.download.viewableInternally.typeWasRegistered.xml", true);
|
||||||
|
user_pref("browser.laterrun.bookkeeping.profileCreationTime", 1665945904);
|
||||||
|
user_pref("browser.laterrun.bookkeeping.sessionCount", 4);
|
||||||
|
user_pref("browser.laterrun.enabled", true);
|
||||||
|
user_pref("browser.migration.version", 116);
|
||||||
|
user_pref("browser.newtabpage.activity-stream.impressionId", "{9360d693-1972-4838-bcf4-6e735712d69e}");
|
||||||
|
user_pref("browser.newtabpage.storageVersion", 1);
|
||||||
|
user_pref("browser.onboarding.seen-tourset-version", 5);
|
||||||
|
user_pref("browser.onboarding.tour-type", "new");
|
||||||
|
user_pref("browser.pageActions.persistedActions", "{\"ids\":[\"bookmark\"],\"idsInUrlbar\":[\"bookmark\"],\"idsInUrlbarPreProton\":[],\"version\":1}");
|
||||||
|
user_pref("browser.pagethumbnails.storage_version", 3);
|
||||||
|
user_pref("browser.places.importBookmarksHTML", false);
|
||||||
|
user_pref("browser.proton.toolbar.version", 3);
|
||||||
|
user_pref("browser.startup.homepage_override.buildID", "20220607050101");
|
||||||
|
user_pref("browser.startup.homepage_override.mstone", "91.13.0");
|
||||||
|
user_pref("browser.startup.homepage_override.torbrowser.version", "11.5.4");
|
||||||
|
user_pref("browser.startup.lastColdStartupCheck", 1665948394);
|
||||||
|
user_pref("browser.theme.toolbar-theme", 0);
|
||||||
|
user_pref("browser.uiCustomization.state", "{\"placements\":{\"widget-overflow-fixed-list\":[],\"nav-bar\":[\"back-button\",\"forward-button\",\"stop-reload-button\",\"urlbar-container\",\"torbutton-button\",\"security-level-button\",\"new-identity-button\",\"save-to-pocket-button\",\"downloads-button\",\"fxa-toolbar-menu-button\"],\"toolbar-menubar\":[\"menubar-items\"],\"TabsToolbar\":[\"tabbrowser-tabs\",\"new-tab-button\",\"alltabs-button\"],\"PersonalToolbar\":[\"import-button\",\"personal-bookmarks\"],\"PanelUI-contents\":[\"home-button\",\"edit-controls\",\"zoom-controls\",\"new-window-button\",\"save-page-button\",\"print-button\",\"bookmarks-menu-button\",\"history-panelmenu\",\"find-button\",\"preferences-button\",\"add-ons-button\",\"developer-button\"],\"addon-bar\":[\"addonbar-closebutton\",\"status-bar\"]},\"seen\":[\"developer-button\",\"_73a6fe31-595d-460b-a920-fcc0f8843232_-browser-action\"],\"dirtyAreaCache\":[\"PersonalToolbar\",\"nav-bar\",\"TabsToolbar\",\"toolbar-menubar\"],\"currentVersion\":17,\"currentTorVersion\":1,\"newElementCount\":1}");
|
||||||
|
user_pref("browser.urlbar.placeholderName.private", "DuckDuckGo");
|
||||||
|
user_pref("distribution.iniFile.exists.appversion", "91.13.0");
|
||||||
|
user_pref("distribution.iniFile.exists.value", false);
|
||||||
|
user_pref("doh-rollout.doneFirstRun", true);
|
||||||
|
user_pref("doh-rollout.home-region", "US");
|
||||||
|
user_pref("dom.security.https_only_mode_ever_enabled", true);
|
||||||
|
user_pref("extensions.activeThemeID", "firefox-compact-dark@mozilla.org");
|
||||||
|
user_pref("extensions.blocklist.pingCountVersion", 0);
|
||||||
|
user_pref("extensions.databaseSchema", 33);
|
||||||
|
user_pref("extensions.incognito.migrated", true);
|
||||||
|
user_pref("extensions.lastAppBuildId", "20220607050101");
|
||||||
|
user_pref("extensions.lastAppVersion", "91.13.0");
|
||||||
|
user_pref("extensions.lastPlatformVersion", "91.13.0");
|
||||||
|
user_pref("extensions.lastTorBrowserVersion", "11.5.4");
|
||||||
|
user_pref("extensions.systemAddonSet", "{\"schema\":1,\"addons\":{}}");
|
||||||
|
user_pref("extensions.torbutton.cookiejar_migrated", true);
|
||||||
|
user_pref("extensions.torbutton.noscript_inited", true);
|
||||||
|
user_pref("extensions.torbutton.pref_fixup_version", 1);
|
||||||
|
user_pref("extensions.torbutton.security_slider_migration", 2);
|
||||||
|
user_pref("extensions.torbutton.startup", true);
|
||||||
|
user_pref("extensions.torlauncher.prompt_at_startup", false);
|
||||||
|
user_pref("extensions.torlauncher.should_remove_meek_helper_profiles", false);
|
||||||
|
user_pref("extensions.torlauncher.torrc_fixup_version", 2);
|
||||||
|
user_pref("extensions.ui.dictionary.hidden", true);
|
||||||
|
user_pref("extensions.ui.lastCategory", "addons://list/theme");
|
||||||
|
user_pref("extensions.ui.locale.hidden", true);
|
||||||
|
user_pref("extensions.webextensions.ExtensionStorageIDB.migrated.{73a6fe31-595d-460b-a920-fcc0f8843232}", true);
|
||||||
|
user_pref("extensions.webextensions.uuids", "{\"{73a6fe31-595d-460b-a920-fcc0f8843232}\":\"033f01fc-2e95-498a-949e-0e804cc4eb9d\",\"onboarding@mozilla.org\":\"b5b376df-e7c5-4567-b556-88b430e220b3\",\"default-theme@mozilla.org\":\"4136ecbd-a68a-4059-aaa4-fce3ec33a351\",\"ddg@search.mozilla.org\":\"a2316d16-6a4d-4525-b737-383aedc307ce\",\"youtube@search.mozilla.org\":\"ee8a8158-1f30-4805-8d7e-56c2256959f2\",\"google@search.mozilla.org\":\"f2fbedb0-300f-416e-ad58-a1bae780b8fc\",\"blockchair@search.mozilla.org\":\"51b04477-7f0c-44dc-8a9b-3b7ba2cb48b4\",\"ddg-onion@search.mozilla.org\":\"c48149f5-c048-4f45-a062-28cf7760083f\",\"startpage@search.mozilla.org\":\"234a9043-b867-4b9d-8f9b-1b3afa743836\",\"twitter@search.mozilla.org\":\"0bd4d415-426b-4c24-bcb7-fd2b0e69ee9c\",\"wikipedia@search.mozilla.org\":\"3e7d4c03-4cde-4700-9f35-086e85e2c780\",\"yahoo@search.mozilla.org\":\"e8c7e821-9f34-4c0f-b7a9-7b6849103c1c\",\"firefox-compact-dark@mozilla.org\":\"17b38e93-e6ed-4075-8947-93e367085161\"}");
|
||||||
|
user_pref("fission.experiment.max-origins.last-disqualified", 0);
|
||||||
|
user_pref("fission.experiment.max-origins.last-qualified", 1665946495);
|
||||||
|
user_pref("fission.experiment.max-origins.qualified", true);
|
||||||
|
user_pref("gfx.blacklist.layers.opengl", 4);
|
||||||
|
user_pref("gfx.blacklist.layers.opengl.failureid", "FEATURE_FAILURE_SOFTWARE_GL");
|
||||||
|
user_pref("idle.lastDailyNotification", 1665946401);
|
||||||
|
user_pref("media.gmp-manager.buildID", "20220607050101");
|
||||||
|
user_pref("media.gmp-manager.lastCheck", 1665946130);
|
||||||
|
user_pref("media.gmp.storage.version.observed", 1);
|
||||||
|
user_pref("network.trr.blocklist_cleanup_done", true);
|
||||||
|
user_pref("pdfjs.enabledCache.state", true);
|
||||||
|
user_pref("pdfjs.migrationVersion", 2);
|
||||||
|
user_pref("places.database.lastMaintenance", 1665946401);
|
||||||
|
user_pref("places.history.enabled", false);
|
||||||
|
user_pref("privacy.history.custom", true);
|
||||||
|
user_pref("privacy.purge_trackers.date_in_cookie_database", "0");
|
||||||
|
user_pref("privacy.sanitize.pending", "[]");
|
||||||
|
user_pref("security.sandbox.content.tempDirSuffix", "9b4f0bc4-0a2f-47c6-86f3-dd3e3116389d");
|
||||||
|
user_pref("storage.vacuum.last.index", 0);
|
||||||
|
user_pref("storage.vacuum.last.places.sqlite", 1665946401);
|
||||||
|
user_pref("toolkit.startup.last_success", 1665948391);
|
||||||
|
user_pref("toolkit.telemetry.cachedClientID", "0edfabe6-79e7-4e90-863e-09052d11ad10");
|
||||||
|
user_pref("toolkit.telemetry.reportingpolicy.firstRun", false);
|
||||||
|
user_pref("torbrowser.settings.bridges.builtin_type", "");
|
||||||
|
user_pref("torbrowser.settings.bridges.enabled", false);
|
||||||
|
user_pref("torbrowser.settings.bridges.source", -1);
|
||||||
|
user_pref("torbrowser.settings.enabled", true);
|
||||||
|
user_pref("torbrowser.settings.firewall.enabled", false);
|
||||||
|
user_pref("torbrowser.settings.proxy.enabled", false);
|
||||||
|
user_pref("torbrowser.settings.quickstart.enabled", true);
|
9
data/tor/profiles.ini
Normal file
9
data/tor/profiles.ini
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[General]
|
||||||
|
StartWithLastProfile=1
|
||||||
|
|
||||||
|
[Profile0]
|
||||||
|
Name=default
|
||||||
|
IsRelative=1
|
||||||
|
Path=profile.default
|
||||||
|
Default=1
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user