Skip to content

Commit

Permalink
fix activation bug using the wrong command number because of the onio…
Browse files Browse the repository at this point in the history
…n version commit
  • Loading branch information
nyxnor committed Oct 17, 2021
1 parent 85f95ba commit 3958e6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ The goal of this project:

Descentralization from a single point of failure:
* **Kernel** from predominant `Linux` to also `BSD`.
* **Shell** from predominant `bash` to also any POSIX shell such as `ksh`, `(y,d)ash)` and `zsh` (emulating sh).
* **Shell** from predominant `bash` to also any POSIX shell such as `ksh`, `(y,d)ash` and `zsh` (emulating sh).
* **Service manager** from predominant `systemd` to also `Runit`, `OpenRC`.

Editing the tor configuration file (torrc) is not difficult, but automation solves problem of misconfiguration and having:
* less time spent
* complete uniformity
*

## Features

Expand Down Expand Up @@ -201,8 +200,8 @@ zsh --emulate sh -c onionservice-tui

## To-do

* improve backup method
* [getopts](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getopts.html)
* support for different services managers
* Bash completion [official package](https://github.com/scop/bash-completion/) and [debian guide](http://web.archive.org/web/20200507173259/https://debian-administration.org/article/317/An_introduction_to_bash_completion_part_2)
* [Whonix HS Guide](https://www.whonix.org/wiki/Onion_Services#Security_Recommendations). Important: This is not whonix and whonix is more secure as it has different access control over workstation and gateway, use that for maximum security and anonymity. This is just to get the best I can and implement it. Also, Whonix-anon is no Tails, check it out too.
* Support VirtualPort 443 for web servers
15 changes: 7 additions & 8 deletions onionservice-cli
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
## sh onionservice-cli COMMAND [REQ_OPTION] <OPTIONAL>
##
## INCLUDE .onionrc
ONIONSERVICE_PWD=
ONIONSERVICE_PWD="/home/nyxnor/Documents/git/onionservice"
[ ! -z "${ONIONSERVICE_PWD}" ] || { printf "\033[1;31mThe variable ONIONSERVICE_PWD is empty!\nRun: sh setup.sh\n\033[0m"; exit 1; }
. "${ONIONSERVICE_PWD}"/.onionrc

Expand Down Expand Up @@ -271,8 +271,8 @@ case "${COMMAND}" in
## This measures avoid using the same local port for different services
## grep torrc TARGET to see if port is already in use and by which service, reading the file in reverse
## Required
VIRTPORT="${4}"; [ -z "${VIRTPORT}" ] && error_msg "VIRTPORT is missing"
TARGET="${5}" ## optional, if null then map to 127.0.0.1:VIRTPORT
VIRTPORT="${5}"; [ -z "${VIRTPORT}" ] && error_msg "VIRTPORT is missing"
TARGET="${6}" ## optional, if null then map to 127.0.0.1:VIRTPORT
TARGET=${TARGET:-127.0.0.1:${VIRTPORT}}
TARGET_ADDR=${TARGET%%:*}
TARGET_PORT=${TARGET##*:}
Expand All @@ -283,8 +283,8 @@ case "${COMMAND}" in
[ "${TARGET_ALREADY_INSERTED}" -gt 0 ] && error_msg "TARGET=${TARGET} is being used by the service: ${TARGET_ALREADY_INSERTED_SERVICE}\nINFO: Choose another port or disable the service that is using the wanted port"
is_integer "${VIRTPORT}"; is_addr_port "${TARGET}" "TARGET"
## Optional
VIRTPORT2="${6}"
TARGET2="${7}"
VIRTPORT2="${7}"
TARGET2="${8}"
if [ ! -z "${VIRTPORT2}" ]; then
TARGET2=${TARGET2:-127.0.0.1:${VIRTPORT2}}
TARGET2_ADDR=${TARGET2%%:*}
Expand All @@ -308,8 +308,8 @@ case "${COMMAND}" in
;;

unix|UNIX)
VIRTPORT="${4}"; [ -z "${VIRTPORT}" ] && error_msg "VIRTPORT is missing"
VIRTPORT2="${5}"; [ ! -z "${VIRTPORT2}" ] && is_integer "${VIRTPORT2}" ## var not mandatory
VIRTPORT="${5}"; [ -z "${VIRTPORT}" ] && error_msg "VIRTPORT is missing"
VIRTPORT2="${6}"; [ ! -z "${VIRTPORT2}" ] && is_integer "${VIRTPORT2}" ## var not mandatory
is_integer "${VIRTPORT}"

## delete any old entry for that servive
Expand Down Expand Up @@ -837,7 +837,6 @@ sudo systemctl reload apache
printf %s" sudo scp -r ${SCP_TARGET_FULL} ${HS_BK_DIR}/${HS_BK_TAR}\n"
;;


## full backup needede to restore all of your hidden services and client keys
## folders/files included: <torrc>, <DataDir>/services/, <DataDir>/onion_auth/
## scp instructions to export backup to remote host
Expand Down

0 comments on commit 3958e6d

Please sign in to comment.