[tor-commits] [tor/release-0.4.4] Merge branch 'maint-0.4.3' into maint-0.4.4

2020-08-10 Thread nickm
commit 7d80bf80fe9017e04fff4b588f49d0393332ebee
Merge: c1b440f760 f3fcc89d05
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:07 2020 -0400

Merge branch 'maint-0.4.3' into maint-0.4.4

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.3] Merge branch 'maint-0.3.5' into maint-0.4.2

2020-08-10 Thread nickm
commit 68f8250cbb6f1844e7f16f5f1bc8063b8bbfdf14
Merge: 352991c843 e873c7e893
Author: Nick Mathewson 
Date:   Mon Aug 10 19:32:49 2020 -0400

Merge branch 'maint-0.3.5' into maint-0.4.2

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.4] Merge branch 'maint-0.4.2' into maint-0.4.3

2020-08-10 Thread nickm
commit f3fcc89d055811065bd9fe723b4d71b755b82edc
Merge: 39d5e7c764 68f8250cbb
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:06 2020 -0400

Merge branch 'maint-0.4.2' into maint-0.4.3

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.4] Try to set up a minimal gitlab CI script

2020-08-10 Thread nickm
commit 057f40f3d8e64389be40f26de6b634f2b8aab0d4
Author: Nick Mathewson 
Date:   Mon Aug 10 16:10:12 2020 -0400

Try to set up a minimal gitlab CI script

This is based on @eighthave's templates, and the work we've been
doing to present a uniform testing environment.
---
 .gitlab-ci.yml | 120 ++---
 1 file changed, 107 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8d6c5f418..fc160ffaea 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,111 @@
-image: debian:stable
+# This file controls how gitlab validates Tor commits and merge requests.
+#
+# It is primarily based on a set of scripts and configurations by
+# Hans-Christoph Steiner.  It only copies parts of those scripts and
+# configurations for now.  If you want a new piece of functionality
+# (more debians, more fedoras, android support) then you shouldn't
+# start from scratch: have a look at the original ticket, at
+# https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
+#
+# The file to copy from is
+# 
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
+#
+# Having said that, if there is anything really stupid here, don't
+# blame it on Hans-Christoph! Tor probably added it on their own.
+#
+# Copyright 2020, The Tor Project, Inc.
+# See LICENSE for licence information.
 
-before_script:
-- apt-get update -qq
-- apt-get upgrade -qy
+# These variables are set everywhere, unconditionally.
+variables:
+  TERM: "ansi"
+  DEBUG_CI: "yes"
 
-build:
+# This template is for exporting ephemeral things from the scripts.  By
+# convention we expect our scripts to copy stuff into artifacts/, rather than
+# having a big list of files that be treated as artifacts.
+.artifacts-template: 
+  artifacts:
+name: 
"${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
+expire_in: 1 week
+when: always
+paths:
+  - artifacts/
+
+.apt-template:  |
+  export LC_ALL=C.UTF-8
+  echo Etc/UTC > /etc/timezone
+  mkdir -p apt-cache
+  export APT_CACHE_DIR="$(pwd)/apt-cache"
+  echo 'quiet "1";' \
+   'APT::Install-Recommends "0";' \
+   'APT::Install-Suggests "0";' \
+   'APT::Acquire::Retries "20";' \
+   'APT::Get::Assume-Yes "true";' \
+   'Dpkg::Use-Pty "0";' \
+   "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
+>> /etc/apt/apt.conf.d/99gitlab
+  apt-get update -qq
+  apt-get upgrade -qy
+
+.debian-template: 
+  <<: *artifacts-template
+  variables:
+DEBIAN_FRONTEND: "noninteractive"
+  cache:
+key: apt
+paths:
+  - apt-cache
+  before_script:
+- *apt-template
+- apt-get install
+automake
+build-essential
+git
+libevent-dev
+liblzma-dev
+libscrypt-dev
+libseccomp-dev
+libssl-dev
+pkg-config
+python3
+zlib1g-dev
+- if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
+- if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
+
+debian-minimal:
+  image: debian:stable
+  <<: *debian-template
   script:
-- apt-get install -qy --fix-missing automake build-essential
-  libevent-dev libssl-dev zlib1g-dev
-  libseccomp-dev liblzma-dev libscrypt-dev
-- ./autogen.sh
-- ./configure --disable-asciidoc --enable-fatal-warnings
-  --disable-silent-rules
-- make check || (e=$?; cat test-suite.log; exit $e)
-- make install
+- ./scripts/ci/ci-driver.sh
+
+###
+# Temporarily diabled. This one just takes too long to finish right now!
+# Maybe we need to divide the call to ./src/test/test into a few segments,
+# that all end in similar amount of time?
+#debian-hardened:
+#  image: debian:testing
+#  <<: *debian-template
+#  variables:
+#HARDENING: "yes"
+#  script:
+#- ./scripts/ci/ci-driver.sh
 
+debian-distcheck:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DISTCHECK: "yes"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh
+
+debian-docs:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DOXYGEN: "no"
+ASCIIDOC: "no"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.4] Merge branch 'maint-0.4.4' into release-0.4.4

2020-08-10 Thread nickm
commit 16b830ed52e70e9d1b4e808f88970003fc2a45f6
Merge: 561ba475e9 7d80bf80fe
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:07 2020 -0400

Merge branch 'maint-0.4.4' into release-0.4.4

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.4] Merge branch 'maint-0.3.5' into maint-0.4.2

2020-08-10 Thread nickm
commit 68f8250cbb6f1844e7f16f5f1bc8063b8bbfdf14
Merge: 352991c843 e873c7e893
Author: Nick Mathewson 
Date:   Mon Aug 10 19:32:49 2020 -0400

Merge branch 'maint-0.3.5' into maint-0.4.2

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.4] Add a shareable continuous-integration script.

2020-08-10 Thread nickm
commit cb027b392f0f93d543cad1689e407b5fd71c2dec
Author: Nick Mathewson 
Date:   Mon Aug 10 15:58:28 2020 -0400

Add a shareable continuous-integration script.

Eventually this should be used by every one of our CI scripts.
---
 scripts/ci/ci-driver.sh | 424 
 1 file changed, 424 insertions(+)

diff --git a/scripts/ci/ci-driver.sh b/scripts/ci/ci-driver.sh
new file mode 100755
index 00..50728a137e
--- /dev/null
+++ b/scripts/ci/ci-driver.sh
@@ -0,0 +1,424 @@
+#!/bin/bash
+
+# This script is used to build Tor for continuous integration.  It should
+# be kept the same for all supported Tor versions.
+#
+# It's subject to the regular Tor license; see LICENSE for copying
+# information.
+
+set -o errexit
+set -o nounset
+
+# Options for this script.
+DEBUG_CI="${DEBUG_CI:-no}"
+COLOR_CI="${COLOR_CI:-yes}"
+
+# Options for which CI system this is.
+ON_GITLAB="${ON_GITLAB:-yes}"
+
+# Options for how to build Tor.  All should be yes/no.
+FATAL_WARNINGS="${FATAL_WARNINGS:-yes}"
+HARDENING="${HARDENING:-no}"
+COVERAGE="${COVERAGE:-no}"
+RUST="${RUST:-no}"
+DOXYGEN="${DOXYGEN:-no}"
+ASCIIDOC="${ASCIIDOC:-no}"
+
+# Options for which tests to run.   All should be yes/no.
+CHECK="${CHECK:-yes}"
+STEM="${STEM:-no}"
+CHUTNEY="${CHUTNEY:-no}"
+DISTCHECK="${DISTCHECK:-no}"
+
+# Options for where the Tor source is.
+CI_SRCDIR="${CI_SRCDIR:-.}"
+
+# Options for where to build.
+CI_BUILDDIR="${CI_BUILDDIR:-./build}"
+
+# How parallel should we run make?
+MAKE_J_OPT="${MAKE_J_OPT:--j4}"
+# Should we stop after make finds an error?
+MAKE_K_OPT="${MAKE_K_OPT:--k}"
+
+# What make target should we use for chutney?
+CHUTNEY_MAKE_TARGET="${CHUTNEY_MAKE_TARGET:-test-network}"
+
+# Where do we find our additional testing tools?
+CHUTNEY_PATH="${CHUTNEY_PATH:-}"
+STEM_PATH="${STEM_PATH:-}"
+
+#
+# Preliminary functions.
+
+# Terminal coloring/emphasis stuff.
+if [[ "${COLOR_CI}" == "yes" ]]; then
+T_RED=$(tput setaf 1 || true)
+T_GREEN=$(tput setaf 2 || true)
+T_DIM=$(tput dim || true)
+T_BOLD=$(tput bold || true)
+T_RESET=$(tput sgr0 || true)
+else
+T_RED=
+T_GREEN=
+T_DIM=
+T_BOLD=
+T_RESET=
+fi
+
+function error()
+{
+echo "${T_BOLD}${T_RED}ERROR:${T_RESET} $*" 1>&2
+}
+function die()
+{
+echo "${T_BOLD}${T_RED}FATAL ERROR:${T_RESET} $*" 1>&2
+exit 1
+}
+function hooray()
+{
+echo "${T_BOLD}${T_GREEN}$*${T_RESET}"
+}
+
+if [[ "${DEBUG_CI}" == "yes" ]]; then
+function debug()
+{
+echo "${T_DIM}(debug): $*${T_RESET}"
+}
+else
+function debug()
+{
+:
+}
+fi
+
+function yes_or_no()
+{
+local varname="$1"
+local value="${!varname}"
+debug "${varname} is ${value}"
+if [[ "${value}" != 'yes' && "${value}" != 'no' ]]; then
+die "${varname} must be 'yes' or 'no'.  Got unexpected value ${value}".
+fi
+}
+
+function incompatible()
+{
+local varname1="$1"
+local varname2="$2"
+local val1="${!varname1}"
+local val2="${!varname2}"
+if [[ "${val1}" = 'yes' && "${val2}" = 'yes' ]]; then
+die "Cannot set both ${varname1} and ${varname2}: they are 
incompatible."
+fi
+}
+
+function runcmd()
+{
+echo "${T_BOLD}\$ $*${T_RESET}"
+if ! "$@" ; then
+error "command '$*' has failed."
+return 1
+fi
+}
+
+function show_git_version()
+{
+local tool="$1"
+local dir="$2"
+local version="?"
+if [[ -e "$dir/.git" ]] ; then
+version=$(cd "$dir"; git rev-parse HEAD)
+fi
+echo "${T_BOLD}$tool:${T_RESET} $version"
+}
+
+if [[ "${ON_GITLAB}" == "yes" ]]; then
+function start_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_start:%s:%s\r\e[0K" "$stamp" "$label"
+   echo "${T_BOLD}${T_GREEN}= $label${T_RESET}"
+}
+function end_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_end:%s:%s\r\e[0K" "$stamp" "$label"
+}
+else
+function start_section()
+{
+   true
+}
+function end_section()
+{
+   true
+}
+fi
+
+if [[ "$*" == "" ]]; then
+RUN_STAGE_CONFIGURE="yes"
+RUN_STAGE_BUILD="yes"
+RUN_STAGE_TEST="yes"
+else
+RUN_STAGE_CONFIGURE="no"
+RUN_STAGE_BUILD="no"
+RUN_STAGE_TEST="no"
+
+for stage in "$@"; do
+   case "$stage" in
+   configure)
+   RUN_STAGE_CONFIGURE="yes"
+   ;;
+   build)
+   RUN_STAGE_BUILD="yes"
+   ;;
+   test)
+   RUN_STAGE_TEST="yes"
+   ;;
+   *)
+   error "Unknown stage $stage"
+   ;;
+   esac
+done
+fi
+
+#
+# Validate inputs.
+
+debug Validating inputs
+yes_or_no DEBUG_CI

[tor-commits] [tor/release-0.4.2] Add a shareable continuous-integration script.

2020-08-10 Thread nickm
commit cb027b392f0f93d543cad1689e407b5fd71c2dec
Author: Nick Mathewson 
Date:   Mon Aug 10 15:58:28 2020 -0400

Add a shareable continuous-integration script.

Eventually this should be used by every one of our CI scripts.
---
 scripts/ci/ci-driver.sh | 424 
 1 file changed, 424 insertions(+)

diff --git a/scripts/ci/ci-driver.sh b/scripts/ci/ci-driver.sh
new file mode 100755
index 00..50728a137e
--- /dev/null
+++ b/scripts/ci/ci-driver.sh
@@ -0,0 +1,424 @@
+#!/bin/bash
+
+# This script is used to build Tor for continuous integration.  It should
+# be kept the same for all supported Tor versions.
+#
+# It's subject to the regular Tor license; see LICENSE for copying
+# information.
+
+set -o errexit
+set -o nounset
+
+# Options for this script.
+DEBUG_CI="${DEBUG_CI:-no}"
+COLOR_CI="${COLOR_CI:-yes}"
+
+# Options for which CI system this is.
+ON_GITLAB="${ON_GITLAB:-yes}"
+
+# Options for how to build Tor.  All should be yes/no.
+FATAL_WARNINGS="${FATAL_WARNINGS:-yes}"
+HARDENING="${HARDENING:-no}"
+COVERAGE="${COVERAGE:-no}"
+RUST="${RUST:-no}"
+DOXYGEN="${DOXYGEN:-no}"
+ASCIIDOC="${ASCIIDOC:-no}"
+
+# Options for which tests to run.   All should be yes/no.
+CHECK="${CHECK:-yes}"
+STEM="${STEM:-no}"
+CHUTNEY="${CHUTNEY:-no}"
+DISTCHECK="${DISTCHECK:-no}"
+
+# Options for where the Tor source is.
+CI_SRCDIR="${CI_SRCDIR:-.}"
+
+# Options for where to build.
+CI_BUILDDIR="${CI_BUILDDIR:-./build}"
+
+# How parallel should we run make?
+MAKE_J_OPT="${MAKE_J_OPT:--j4}"
+# Should we stop after make finds an error?
+MAKE_K_OPT="${MAKE_K_OPT:--k}"
+
+# What make target should we use for chutney?
+CHUTNEY_MAKE_TARGET="${CHUTNEY_MAKE_TARGET:-test-network}"
+
+# Where do we find our additional testing tools?
+CHUTNEY_PATH="${CHUTNEY_PATH:-}"
+STEM_PATH="${STEM_PATH:-}"
+
+#
+# Preliminary functions.
+
+# Terminal coloring/emphasis stuff.
+if [[ "${COLOR_CI}" == "yes" ]]; then
+T_RED=$(tput setaf 1 || true)
+T_GREEN=$(tput setaf 2 || true)
+T_DIM=$(tput dim || true)
+T_BOLD=$(tput bold || true)
+T_RESET=$(tput sgr0 || true)
+else
+T_RED=
+T_GREEN=
+T_DIM=
+T_BOLD=
+T_RESET=
+fi
+
+function error()
+{
+echo "${T_BOLD}${T_RED}ERROR:${T_RESET} $*" 1>&2
+}
+function die()
+{
+echo "${T_BOLD}${T_RED}FATAL ERROR:${T_RESET} $*" 1>&2
+exit 1
+}
+function hooray()
+{
+echo "${T_BOLD}${T_GREEN}$*${T_RESET}"
+}
+
+if [[ "${DEBUG_CI}" == "yes" ]]; then
+function debug()
+{
+echo "${T_DIM}(debug): $*${T_RESET}"
+}
+else
+function debug()
+{
+:
+}
+fi
+
+function yes_or_no()
+{
+local varname="$1"
+local value="${!varname}"
+debug "${varname} is ${value}"
+if [[ "${value}" != 'yes' && "${value}" != 'no' ]]; then
+die "${varname} must be 'yes' or 'no'.  Got unexpected value ${value}".
+fi
+}
+
+function incompatible()
+{
+local varname1="$1"
+local varname2="$2"
+local val1="${!varname1}"
+local val2="${!varname2}"
+if [[ "${val1}" = 'yes' && "${val2}" = 'yes' ]]; then
+die "Cannot set both ${varname1} and ${varname2}: they are 
incompatible."
+fi
+}
+
+function runcmd()
+{
+echo "${T_BOLD}\$ $*${T_RESET}"
+if ! "$@" ; then
+error "command '$*' has failed."
+return 1
+fi
+}
+
+function show_git_version()
+{
+local tool="$1"
+local dir="$2"
+local version="?"
+if [[ -e "$dir/.git" ]] ; then
+version=$(cd "$dir"; git rev-parse HEAD)
+fi
+echo "${T_BOLD}$tool:${T_RESET} $version"
+}
+
+if [[ "${ON_GITLAB}" == "yes" ]]; then
+function start_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_start:%s:%s\r\e[0K" "$stamp" "$label"
+   echo "${T_BOLD}${T_GREEN}= $label${T_RESET}"
+}
+function end_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_end:%s:%s\r\e[0K" "$stamp" "$label"
+}
+else
+function start_section()
+{
+   true
+}
+function end_section()
+{
+   true
+}
+fi
+
+if [[ "$*" == "" ]]; then
+RUN_STAGE_CONFIGURE="yes"
+RUN_STAGE_BUILD="yes"
+RUN_STAGE_TEST="yes"
+else
+RUN_STAGE_CONFIGURE="no"
+RUN_STAGE_BUILD="no"
+RUN_STAGE_TEST="no"
+
+for stage in "$@"; do
+   case "$stage" in
+   configure)
+   RUN_STAGE_CONFIGURE="yes"
+   ;;
+   build)
+   RUN_STAGE_BUILD="yes"
+   ;;
+   test)
+   RUN_STAGE_TEST="yes"
+   ;;
+   *)
+   error "Unknown stage $stage"
+   ;;
+   esac
+done
+fi
+
+#
+# Validate inputs.
+
+debug Validating inputs
+yes_or_no DEBUG_CI

[tor-commits] [tor/release-0.3.5] Add a shareable continuous-integration script.

2020-08-10 Thread nickm
commit cb027b392f0f93d543cad1689e407b5fd71c2dec
Author: Nick Mathewson 
Date:   Mon Aug 10 15:58:28 2020 -0400

Add a shareable continuous-integration script.

Eventually this should be used by every one of our CI scripts.
---
 scripts/ci/ci-driver.sh | 424 
 1 file changed, 424 insertions(+)

diff --git a/scripts/ci/ci-driver.sh b/scripts/ci/ci-driver.sh
new file mode 100755
index 00..50728a137e
--- /dev/null
+++ b/scripts/ci/ci-driver.sh
@@ -0,0 +1,424 @@
+#!/bin/bash
+
+# This script is used to build Tor for continuous integration.  It should
+# be kept the same for all supported Tor versions.
+#
+# It's subject to the regular Tor license; see LICENSE for copying
+# information.
+
+set -o errexit
+set -o nounset
+
+# Options for this script.
+DEBUG_CI="${DEBUG_CI:-no}"
+COLOR_CI="${COLOR_CI:-yes}"
+
+# Options for which CI system this is.
+ON_GITLAB="${ON_GITLAB:-yes}"
+
+# Options for how to build Tor.  All should be yes/no.
+FATAL_WARNINGS="${FATAL_WARNINGS:-yes}"
+HARDENING="${HARDENING:-no}"
+COVERAGE="${COVERAGE:-no}"
+RUST="${RUST:-no}"
+DOXYGEN="${DOXYGEN:-no}"
+ASCIIDOC="${ASCIIDOC:-no}"
+
+# Options for which tests to run.   All should be yes/no.
+CHECK="${CHECK:-yes}"
+STEM="${STEM:-no}"
+CHUTNEY="${CHUTNEY:-no}"
+DISTCHECK="${DISTCHECK:-no}"
+
+# Options for where the Tor source is.
+CI_SRCDIR="${CI_SRCDIR:-.}"
+
+# Options for where to build.
+CI_BUILDDIR="${CI_BUILDDIR:-./build}"
+
+# How parallel should we run make?
+MAKE_J_OPT="${MAKE_J_OPT:--j4}"
+# Should we stop after make finds an error?
+MAKE_K_OPT="${MAKE_K_OPT:--k}"
+
+# What make target should we use for chutney?
+CHUTNEY_MAKE_TARGET="${CHUTNEY_MAKE_TARGET:-test-network}"
+
+# Where do we find our additional testing tools?
+CHUTNEY_PATH="${CHUTNEY_PATH:-}"
+STEM_PATH="${STEM_PATH:-}"
+
+#
+# Preliminary functions.
+
+# Terminal coloring/emphasis stuff.
+if [[ "${COLOR_CI}" == "yes" ]]; then
+T_RED=$(tput setaf 1 || true)
+T_GREEN=$(tput setaf 2 || true)
+T_DIM=$(tput dim || true)
+T_BOLD=$(tput bold || true)
+T_RESET=$(tput sgr0 || true)
+else
+T_RED=
+T_GREEN=
+T_DIM=
+T_BOLD=
+T_RESET=
+fi
+
+function error()
+{
+echo "${T_BOLD}${T_RED}ERROR:${T_RESET} $*" 1>&2
+}
+function die()
+{
+echo "${T_BOLD}${T_RED}FATAL ERROR:${T_RESET} $*" 1>&2
+exit 1
+}
+function hooray()
+{
+echo "${T_BOLD}${T_GREEN}$*${T_RESET}"
+}
+
+if [[ "${DEBUG_CI}" == "yes" ]]; then
+function debug()
+{
+echo "${T_DIM}(debug): $*${T_RESET}"
+}
+else
+function debug()
+{
+:
+}
+fi
+
+function yes_or_no()
+{
+local varname="$1"
+local value="${!varname}"
+debug "${varname} is ${value}"
+if [[ "${value}" != 'yes' && "${value}" != 'no' ]]; then
+die "${varname} must be 'yes' or 'no'.  Got unexpected value ${value}".
+fi
+}
+
+function incompatible()
+{
+local varname1="$1"
+local varname2="$2"
+local val1="${!varname1}"
+local val2="${!varname2}"
+if [[ "${val1}" = 'yes' && "${val2}" = 'yes' ]]; then
+die "Cannot set both ${varname1} and ${varname2}: they are 
incompatible."
+fi
+}
+
+function runcmd()
+{
+echo "${T_BOLD}\$ $*${T_RESET}"
+if ! "$@" ; then
+error "command '$*' has failed."
+return 1
+fi
+}
+
+function show_git_version()
+{
+local tool="$1"
+local dir="$2"
+local version="?"
+if [[ -e "$dir/.git" ]] ; then
+version=$(cd "$dir"; git rev-parse HEAD)
+fi
+echo "${T_BOLD}$tool:${T_RESET} $version"
+}
+
+if [[ "${ON_GITLAB}" == "yes" ]]; then
+function start_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_start:%s:%s\r\e[0K" "$stamp" "$label"
+   echo "${T_BOLD}${T_GREEN}= $label${T_RESET}"
+}
+function end_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_end:%s:%s\r\e[0K" "$stamp" "$label"
+}
+else
+function start_section()
+{
+   true
+}
+function end_section()
+{
+   true
+}
+fi
+
+if [[ "$*" == "" ]]; then
+RUN_STAGE_CONFIGURE="yes"
+RUN_STAGE_BUILD="yes"
+RUN_STAGE_TEST="yes"
+else
+RUN_STAGE_CONFIGURE="no"
+RUN_STAGE_BUILD="no"
+RUN_STAGE_TEST="no"
+
+for stage in "$@"; do
+   case "$stage" in
+   configure)
+   RUN_STAGE_CONFIGURE="yes"
+   ;;
+   build)
+   RUN_STAGE_BUILD="yes"
+   ;;
+   test)
+   RUN_STAGE_TEST="yes"
+   ;;
+   *)
+   error "Unknown stage $stage"
+   ;;
+   esac
+done
+fi
+
+#
+# Validate inputs.
+
+debug Validating inputs
+yes_or_no DEBUG_CI

[tor-commits] [tor/master] Merge branch 'maint-0.3.5' into maint-0.4.2

2020-08-10 Thread nickm
commit 68f8250cbb6f1844e7f16f5f1bc8063b8bbfdf14
Merge: 352991c843 e873c7e893
Author: Nick Mathewson 
Date:   Mon Aug 10 19:32:49 2020 -0400

Merge branch 'maint-0.3.5' into maint-0.4.2

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.5] small code tweaks to try to work around debian stable complaints

2020-08-10 Thread nickm
commit e873c7e893987f5ad90ef401e6f986c62b4fc42d
Author: Nick Mathewson 
Date:   Mon Aug 10 17:36:21 2020 -0400

small code tweaks to try to work around debian stable complaints
---
 src/feature/rend/rendclient.c | 4 ++--
 src/lib/net/address.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index cde954da95..5c9dbea8e3 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -261,8 +261,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
 > MAX_NICKNAME_LEN)) {
   goto perm_err;
 }
-strncpy(tmp, rendcirc->build_state->chosen_exit->nickname,
-(MAX_NICKNAME_LEN+1)); /* nul pads */
+strlcpy(tmp, rendcirc->build_state->chosen_exit->nickname,
+sizeof(tmp));
 memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie,
REND_COOKIE_LEN);
 dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN;
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 076ca3eb34..69004ddb0e 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -337,7 +337,7 @@ tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t 
len, int decorate)
   break;
 case AF_INET6:
   /* Shortest addr [ :: ] + \0 */
-  if (len < (3 + (decorate ? 2 : 0)))
+  if (len < (3 + (decorate ? 2u : 0u)))
 return NULL;
 
   if (decorate)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.3] Merge branch 'maint-0.4.3' into release-0.4.3

2020-08-10 Thread nickm
commit ffe240951e44faafd21c3811c34cfeae4792488e
Merge: 44546aeb3f f3fcc89d05
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:07 2020 -0400

Merge branch 'maint-0.4.3' into release-0.4.3

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.3] Try to set up a minimal gitlab CI script

2020-08-10 Thread nickm
commit 057f40f3d8e64389be40f26de6b634f2b8aab0d4
Author: Nick Mathewson 
Date:   Mon Aug 10 16:10:12 2020 -0400

Try to set up a minimal gitlab CI script

This is based on @eighthave's templates, and the work we've been
doing to present a uniform testing environment.
---
 .gitlab-ci.yml | 120 ++---
 1 file changed, 107 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8d6c5f418..fc160ffaea 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,111 @@
-image: debian:stable
+# This file controls how gitlab validates Tor commits and merge requests.
+#
+# It is primarily based on a set of scripts and configurations by
+# Hans-Christoph Steiner.  It only copies parts of those scripts and
+# configurations for now.  If you want a new piece of functionality
+# (more debians, more fedoras, android support) then you shouldn't
+# start from scratch: have a look at the original ticket, at
+# https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
+#
+# The file to copy from is
+# 
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
+#
+# Having said that, if there is anything really stupid here, don't
+# blame it on Hans-Christoph! Tor probably added it on their own.
+#
+# Copyright 2020, The Tor Project, Inc.
+# See LICENSE for licence information.
 
-before_script:
-- apt-get update -qq
-- apt-get upgrade -qy
+# These variables are set everywhere, unconditionally.
+variables:
+  TERM: "ansi"
+  DEBUG_CI: "yes"
 
-build:
+# This template is for exporting ephemeral things from the scripts.  By
+# convention we expect our scripts to copy stuff into artifacts/, rather than
+# having a big list of files that be treated as artifacts.
+.artifacts-template: 
+  artifacts:
+name: 
"${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
+expire_in: 1 week
+when: always
+paths:
+  - artifacts/
+
+.apt-template:  |
+  export LC_ALL=C.UTF-8
+  echo Etc/UTC > /etc/timezone
+  mkdir -p apt-cache
+  export APT_CACHE_DIR="$(pwd)/apt-cache"
+  echo 'quiet "1";' \
+   'APT::Install-Recommends "0";' \
+   'APT::Install-Suggests "0";' \
+   'APT::Acquire::Retries "20";' \
+   'APT::Get::Assume-Yes "true";' \
+   'Dpkg::Use-Pty "0";' \
+   "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
+>> /etc/apt/apt.conf.d/99gitlab
+  apt-get update -qq
+  apt-get upgrade -qy
+
+.debian-template: 
+  <<: *artifacts-template
+  variables:
+DEBIAN_FRONTEND: "noninteractive"
+  cache:
+key: apt
+paths:
+  - apt-cache
+  before_script:
+- *apt-template
+- apt-get install
+automake
+build-essential
+git
+libevent-dev
+liblzma-dev
+libscrypt-dev
+libseccomp-dev
+libssl-dev
+pkg-config
+python3
+zlib1g-dev
+- if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
+- if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
+
+debian-minimal:
+  image: debian:stable
+  <<: *debian-template
   script:
-- apt-get install -qy --fix-missing automake build-essential
-  libevent-dev libssl-dev zlib1g-dev
-  libseccomp-dev liblzma-dev libscrypt-dev
-- ./autogen.sh
-- ./configure --disable-asciidoc --enable-fatal-warnings
-  --disable-silent-rules
-- make check || (e=$?; cat test-suite.log; exit $e)
-- make install
+- ./scripts/ci/ci-driver.sh
+
+###
+# Temporarily diabled. This one just takes too long to finish right now!
+# Maybe we need to divide the call to ./src/test/test into a few segments,
+# that all end in similar amount of time?
+#debian-hardened:
+#  image: debian:testing
+#  <<: *debian-template
+#  variables:
+#HARDENING: "yes"
+#  script:
+#- ./scripts/ci/ci-driver.sh
 
+debian-distcheck:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DISTCHECK: "yes"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh
+
+debian-docs:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DOXYGEN: "no"
+ASCIIDOC: "no"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.3] Merge branch 'maint-0.4.2' into maint-0.4.3

2020-08-10 Thread nickm
commit f3fcc89d055811065bd9fe723b4d71b755b82edc
Merge: 39d5e7c764 68f8250cbb
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:06 2020 -0400

Merge branch 'maint-0.4.2' into maint-0.4.3

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.3] Add a shareable continuous-integration script.

2020-08-10 Thread nickm
commit cb027b392f0f93d543cad1689e407b5fd71c2dec
Author: Nick Mathewson 
Date:   Mon Aug 10 15:58:28 2020 -0400

Add a shareable continuous-integration script.

Eventually this should be used by every one of our CI scripts.
---
 scripts/ci/ci-driver.sh | 424 
 1 file changed, 424 insertions(+)

diff --git a/scripts/ci/ci-driver.sh b/scripts/ci/ci-driver.sh
new file mode 100755
index 00..50728a137e
--- /dev/null
+++ b/scripts/ci/ci-driver.sh
@@ -0,0 +1,424 @@
+#!/bin/bash
+
+# This script is used to build Tor for continuous integration.  It should
+# be kept the same for all supported Tor versions.
+#
+# It's subject to the regular Tor license; see LICENSE for copying
+# information.
+
+set -o errexit
+set -o nounset
+
+# Options for this script.
+DEBUG_CI="${DEBUG_CI:-no}"
+COLOR_CI="${COLOR_CI:-yes}"
+
+# Options for which CI system this is.
+ON_GITLAB="${ON_GITLAB:-yes}"
+
+# Options for how to build Tor.  All should be yes/no.
+FATAL_WARNINGS="${FATAL_WARNINGS:-yes}"
+HARDENING="${HARDENING:-no}"
+COVERAGE="${COVERAGE:-no}"
+RUST="${RUST:-no}"
+DOXYGEN="${DOXYGEN:-no}"
+ASCIIDOC="${ASCIIDOC:-no}"
+
+# Options for which tests to run.   All should be yes/no.
+CHECK="${CHECK:-yes}"
+STEM="${STEM:-no}"
+CHUTNEY="${CHUTNEY:-no}"
+DISTCHECK="${DISTCHECK:-no}"
+
+# Options for where the Tor source is.
+CI_SRCDIR="${CI_SRCDIR:-.}"
+
+# Options for where to build.
+CI_BUILDDIR="${CI_BUILDDIR:-./build}"
+
+# How parallel should we run make?
+MAKE_J_OPT="${MAKE_J_OPT:--j4}"
+# Should we stop after make finds an error?
+MAKE_K_OPT="${MAKE_K_OPT:--k}"
+
+# What make target should we use for chutney?
+CHUTNEY_MAKE_TARGET="${CHUTNEY_MAKE_TARGET:-test-network}"
+
+# Where do we find our additional testing tools?
+CHUTNEY_PATH="${CHUTNEY_PATH:-}"
+STEM_PATH="${STEM_PATH:-}"
+
+#
+# Preliminary functions.
+
+# Terminal coloring/emphasis stuff.
+if [[ "${COLOR_CI}" == "yes" ]]; then
+T_RED=$(tput setaf 1 || true)
+T_GREEN=$(tput setaf 2 || true)
+T_DIM=$(tput dim || true)
+T_BOLD=$(tput bold || true)
+T_RESET=$(tput sgr0 || true)
+else
+T_RED=
+T_GREEN=
+T_DIM=
+T_BOLD=
+T_RESET=
+fi
+
+function error()
+{
+echo "${T_BOLD}${T_RED}ERROR:${T_RESET} $*" 1>&2
+}
+function die()
+{
+echo "${T_BOLD}${T_RED}FATAL ERROR:${T_RESET} $*" 1>&2
+exit 1
+}
+function hooray()
+{
+echo "${T_BOLD}${T_GREEN}$*${T_RESET}"
+}
+
+if [[ "${DEBUG_CI}" == "yes" ]]; then
+function debug()
+{
+echo "${T_DIM}(debug): $*${T_RESET}"
+}
+else
+function debug()
+{
+:
+}
+fi
+
+function yes_or_no()
+{
+local varname="$1"
+local value="${!varname}"
+debug "${varname} is ${value}"
+if [[ "${value}" != 'yes' && "${value}" != 'no' ]]; then
+die "${varname} must be 'yes' or 'no'.  Got unexpected value ${value}".
+fi
+}
+
+function incompatible()
+{
+local varname1="$1"
+local varname2="$2"
+local val1="${!varname1}"
+local val2="${!varname2}"
+if [[ "${val1}" = 'yes' && "${val2}" = 'yes' ]]; then
+die "Cannot set both ${varname1} and ${varname2}: they are 
incompatible."
+fi
+}
+
+function runcmd()
+{
+echo "${T_BOLD}\$ $*${T_RESET}"
+if ! "$@" ; then
+error "command '$*' has failed."
+return 1
+fi
+}
+
+function show_git_version()
+{
+local tool="$1"
+local dir="$2"
+local version="?"
+if [[ -e "$dir/.git" ]] ; then
+version=$(cd "$dir"; git rev-parse HEAD)
+fi
+echo "${T_BOLD}$tool:${T_RESET} $version"
+}
+
+if [[ "${ON_GITLAB}" == "yes" ]]; then
+function start_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_start:%s:%s\r\e[0K" "$stamp" "$label"
+   echo "${T_BOLD}${T_GREEN}= $label${T_RESET}"
+}
+function end_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_end:%s:%s\r\e[0K" "$stamp" "$label"
+}
+else
+function start_section()
+{
+   true
+}
+function end_section()
+{
+   true
+}
+fi
+
+if [[ "$*" == "" ]]; then
+RUN_STAGE_CONFIGURE="yes"
+RUN_STAGE_BUILD="yes"
+RUN_STAGE_TEST="yes"
+else
+RUN_STAGE_CONFIGURE="no"
+RUN_STAGE_BUILD="no"
+RUN_STAGE_TEST="no"
+
+for stage in "$@"; do
+   case "$stage" in
+   configure)
+   RUN_STAGE_CONFIGURE="yes"
+   ;;
+   build)
+   RUN_STAGE_BUILD="yes"
+   ;;
+   test)
+   RUN_STAGE_TEST="yes"
+   ;;
+   *)
+   error "Unknown stage $stage"
+   ;;
+   esac
+done
+fi
+
+#
+# Validate inputs.
+
+debug Validating inputs
+yes_or_no DEBUG_CI

[tor-commits] [tor/master] Merge branch 'maint-0.4.3' into maint-0.4.4

2020-08-10 Thread nickm
commit 7d80bf80fe9017e04fff4b588f49d0393332ebee
Merge: c1b440f760 f3fcc89d05
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:07 2020 -0400

Merge branch 'maint-0.4.3' into maint-0.4.4

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.2] small code tweaks to try to work around debian stable complaints

2020-08-10 Thread nickm
commit e873c7e893987f5ad90ef401e6f986c62b4fc42d
Author: Nick Mathewson 
Date:   Mon Aug 10 17:36:21 2020 -0400

small code tweaks to try to work around debian stable complaints
---
 src/feature/rend/rendclient.c | 4 ++--
 src/lib/net/address.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index cde954da95..5c9dbea8e3 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -261,8 +261,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
 > MAX_NICKNAME_LEN)) {
   goto perm_err;
 }
-strncpy(tmp, rendcirc->build_state->chosen_exit->nickname,
-(MAX_NICKNAME_LEN+1)); /* nul pads */
+strlcpy(tmp, rendcirc->build_state->chosen_exit->nickname,
+sizeof(tmp));
 memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie,
REND_COOKIE_LEN);
 dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN;
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 076ca3eb34..69004ddb0e 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -337,7 +337,7 @@ tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t 
len, int decorate)
   break;
 case AF_INET6:
   /* Shortest addr [ :: ] + \0 */
-  if (len < (3 + (decorate ? 2 : 0)))
+  if (len < (3 + (decorate ? 2u : 0u)))
 return NULL;
 
   if (decorate)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Try to set up a minimal gitlab CI script

2020-08-10 Thread nickm
commit 057f40f3d8e64389be40f26de6b634f2b8aab0d4
Author: Nick Mathewson 
Date:   Mon Aug 10 16:10:12 2020 -0400

Try to set up a minimal gitlab CI script

This is based on @eighthave's templates, and the work we've been
doing to present a uniform testing environment.
---
 .gitlab-ci.yml | 120 ++---
 1 file changed, 107 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8d6c5f418..fc160ffaea 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,111 @@
-image: debian:stable
+# This file controls how gitlab validates Tor commits and merge requests.
+#
+# It is primarily based on a set of scripts and configurations by
+# Hans-Christoph Steiner.  It only copies parts of those scripts and
+# configurations for now.  If you want a new piece of functionality
+# (more debians, more fedoras, android support) then you shouldn't
+# start from scratch: have a look at the original ticket, at
+# https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
+#
+# The file to copy from is
+# 
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
+#
+# Having said that, if there is anything really stupid here, don't
+# blame it on Hans-Christoph! Tor probably added it on their own.
+#
+# Copyright 2020, The Tor Project, Inc.
+# See LICENSE for licence information.
 
-before_script:
-- apt-get update -qq
-- apt-get upgrade -qy
+# These variables are set everywhere, unconditionally.
+variables:
+  TERM: "ansi"
+  DEBUG_CI: "yes"
 
-build:
+# This template is for exporting ephemeral things from the scripts.  By
+# convention we expect our scripts to copy stuff into artifacts/, rather than
+# having a big list of files that be treated as artifacts.
+.artifacts-template: 
+  artifacts:
+name: 
"${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
+expire_in: 1 week
+when: always
+paths:
+  - artifacts/
+
+.apt-template:  |
+  export LC_ALL=C.UTF-8
+  echo Etc/UTC > /etc/timezone
+  mkdir -p apt-cache
+  export APT_CACHE_DIR="$(pwd)/apt-cache"
+  echo 'quiet "1";' \
+   'APT::Install-Recommends "0";' \
+   'APT::Install-Suggests "0";' \
+   'APT::Acquire::Retries "20";' \
+   'APT::Get::Assume-Yes "true";' \
+   'Dpkg::Use-Pty "0";' \
+   "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
+>> /etc/apt/apt.conf.d/99gitlab
+  apt-get update -qq
+  apt-get upgrade -qy
+
+.debian-template: 
+  <<: *artifacts-template
+  variables:
+DEBIAN_FRONTEND: "noninteractive"
+  cache:
+key: apt
+paths:
+  - apt-cache
+  before_script:
+- *apt-template
+- apt-get install
+automake
+build-essential
+git
+libevent-dev
+liblzma-dev
+libscrypt-dev
+libseccomp-dev
+libssl-dev
+pkg-config
+python3
+zlib1g-dev
+- if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
+- if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
+
+debian-minimal:
+  image: debian:stable
+  <<: *debian-template
   script:
-- apt-get install -qy --fix-missing automake build-essential
-  libevent-dev libssl-dev zlib1g-dev
-  libseccomp-dev liblzma-dev libscrypt-dev
-- ./autogen.sh
-- ./configure --disable-asciidoc --enable-fatal-warnings
-  --disable-silent-rules
-- make check || (e=$?; cat test-suite.log; exit $e)
-- make install
+- ./scripts/ci/ci-driver.sh
+
+###
+# Temporarily diabled. This one just takes too long to finish right now!
+# Maybe we need to divide the call to ./src/test/test into a few segments,
+# that all end in similar amount of time?
+#debian-hardened:
+#  image: debian:testing
+#  <<: *debian-template
+#  variables:
+#HARDENING: "yes"
+#  script:
+#- ./scripts/ci/ci-driver.sh
 
+debian-distcheck:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DISTCHECK: "yes"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh
+
+debian-docs:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DOXYGEN: "no"
+ASCIIDOC: "no"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.4] small code tweaks to try to work around debian stable complaints

2020-08-10 Thread nickm
commit e873c7e893987f5ad90ef401e6f986c62b4fc42d
Author: Nick Mathewson 
Date:   Mon Aug 10 17:36:21 2020 -0400

small code tweaks to try to work around debian stable complaints
---
 src/feature/rend/rendclient.c | 4 ++--
 src/lib/net/address.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index cde954da95..5c9dbea8e3 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -261,8 +261,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
 > MAX_NICKNAME_LEN)) {
   goto perm_err;
 }
-strncpy(tmp, rendcirc->build_state->chosen_exit->nickname,
-(MAX_NICKNAME_LEN+1)); /* nul pads */
+strlcpy(tmp, rendcirc->build_state->chosen_exit->nickname,
+sizeof(tmp));
 memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie,
REND_COOKIE_LEN);
 dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN;
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 076ca3eb34..69004ddb0e 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -337,7 +337,7 @@ tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t 
len, int decorate)
   break;
 case AF_INET6:
   /* Shortest addr [ :: ] + \0 */
-  if (len < (3 + (decorate ? 2 : 0)))
+  if (len < (3 + (decorate ? 2u : 0u)))
 return NULL;
 
   if (decorate)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.2] Merge branch 'maint-0.4.2' into release-0.4.2

2020-08-10 Thread nickm
commit 28bbe09b80cc0c18f71a51603469bf211bfe2a12
Merge: 1f54007161 68f8250cbb
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:06 2020 -0400

Merge branch 'maint-0.4.2' into release-0.4.2

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.2] Merge branch 'maint-0.3.5' into maint-0.4.2

2020-08-10 Thread nickm
commit 68f8250cbb6f1844e7f16f5f1bc8063b8bbfdf14
Merge: 352991c843 e873c7e893
Author: Nick Mathewson 
Date:   Mon Aug 10 19:32:49 2020 -0400

Merge branch 'maint-0.3.5' into maint-0.4.2

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.2] Try to set up a minimal gitlab CI script

2020-08-10 Thread nickm
commit 057f40f3d8e64389be40f26de6b634f2b8aab0d4
Author: Nick Mathewson 
Date:   Mon Aug 10 16:10:12 2020 -0400

Try to set up a minimal gitlab CI script

This is based on @eighthave's templates, and the work we've been
doing to present a uniform testing environment.
---
 .gitlab-ci.yml | 120 ++---
 1 file changed, 107 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8d6c5f418..fc160ffaea 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,111 @@
-image: debian:stable
+# This file controls how gitlab validates Tor commits and merge requests.
+#
+# It is primarily based on a set of scripts and configurations by
+# Hans-Christoph Steiner.  It only copies parts of those scripts and
+# configurations for now.  If you want a new piece of functionality
+# (more debians, more fedoras, android support) then you shouldn't
+# start from scratch: have a look at the original ticket, at
+# https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
+#
+# The file to copy from is
+# 
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
+#
+# Having said that, if there is anything really stupid here, don't
+# blame it on Hans-Christoph! Tor probably added it on their own.
+#
+# Copyright 2020, The Tor Project, Inc.
+# See LICENSE for licence information.
 
-before_script:
-- apt-get update -qq
-- apt-get upgrade -qy
+# These variables are set everywhere, unconditionally.
+variables:
+  TERM: "ansi"
+  DEBUG_CI: "yes"
 
-build:
+# This template is for exporting ephemeral things from the scripts.  By
+# convention we expect our scripts to copy stuff into artifacts/, rather than
+# having a big list of files that be treated as artifacts.
+.artifacts-template: 
+  artifacts:
+name: 
"${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
+expire_in: 1 week
+when: always
+paths:
+  - artifacts/
+
+.apt-template:  |
+  export LC_ALL=C.UTF-8
+  echo Etc/UTC > /etc/timezone
+  mkdir -p apt-cache
+  export APT_CACHE_DIR="$(pwd)/apt-cache"
+  echo 'quiet "1";' \
+   'APT::Install-Recommends "0";' \
+   'APT::Install-Suggests "0";' \
+   'APT::Acquire::Retries "20";' \
+   'APT::Get::Assume-Yes "true";' \
+   'Dpkg::Use-Pty "0";' \
+   "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
+>> /etc/apt/apt.conf.d/99gitlab
+  apt-get update -qq
+  apt-get upgrade -qy
+
+.debian-template: 
+  <<: *artifacts-template
+  variables:
+DEBIAN_FRONTEND: "noninteractive"
+  cache:
+key: apt
+paths:
+  - apt-cache
+  before_script:
+- *apt-template
+- apt-get install
+automake
+build-essential
+git
+libevent-dev
+liblzma-dev
+libscrypt-dev
+libseccomp-dev
+libssl-dev
+pkg-config
+python3
+zlib1g-dev
+- if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
+- if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
+
+debian-minimal:
+  image: debian:stable
+  <<: *debian-template
   script:
-- apt-get install -qy --fix-missing automake build-essential
-  libevent-dev libssl-dev zlib1g-dev
-  libseccomp-dev liblzma-dev libscrypt-dev
-- ./autogen.sh
-- ./configure --disable-asciidoc --enable-fatal-warnings
-  --disable-silent-rules
-- make check || (e=$?; cat test-suite.log; exit $e)
-- make install
+- ./scripts/ci/ci-driver.sh
+
+###
+# Temporarily diabled. This one just takes too long to finish right now!
+# Maybe we need to divide the call to ./src/test/test into a few segments,
+# that all end in similar amount of time?
+#debian-hardened:
+#  image: debian:testing
+#  <<: *debian-template
+#  variables:
+#HARDENING: "yes"
+#  script:
+#- ./scripts/ci/ci-driver.sh
 
+debian-distcheck:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DISTCHECK: "yes"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh
+
+debian-docs:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DOXYGEN: "no"
+ASCIIDOC: "no"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.4.3] small code tweaks to try to work around debian stable complaints

2020-08-10 Thread nickm
commit e873c7e893987f5ad90ef401e6f986c62b4fc42d
Author: Nick Mathewson 
Date:   Mon Aug 10 17:36:21 2020 -0400

small code tweaks to try to work around debian stable complaints
---
 src/feature/rend/rendclient.c | 4 ++--
 src/lib/net/address.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index cde954da95..5c9dbea8e3 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -261,8 +261,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
 > MAX_NICKNAME_LEN)) {
   goto perm_err;
 }
-strncpy(tmp, rendcirc->build_state->chosen_exit->nickname,
-(MAX_NICKNAME_LEN+1)); /* nul pads */
+strlcpy(tmp, rendcirc->build_state->chosen_exit->nickname,
+sizeof(tmp));
 memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie,
REND_COOKIE_LEN);
 dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN;
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 076ca3eb34..69004ddb0e 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -337,7 +337,7 @@ tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t 
len, int decorate)
   break;
 case AF_INET6:
   /* Shortest addr [ :: ] + \0 */
-  if (len < (3 + (decorate ? 2 : 0)))
+  if (len < (3 + (decorate ? 2u : 0u)))
 return NULL;
 
   if (decorate)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.4.4'

2020-08-10 Thread nickm
commit 069946852a5f847e92062cd1b2a56c20935592b2
Merge: 3eb9331133 7d80bf80fe
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:07 2020 -0400

Merge branch 'maint-0.4.4'

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Add a shareable continuous-integration script.

2020-08-10 Thread nickm
commit cb027b392f0f93d543cad1689e407b5fd71c2dec
Author: Nick Mathewson 
Date:   Mon Aug 10 15:58:28 2020 -0400

Add a shareable continuous-integration script.

Eventually this should be used by every one of our CI scripts.
---
 scripts/ci/ci-driver.sh | 424 
 1 file changed, 424 insertions(+)

diff --git a/scripts/ci/ci-driver.sh b/scripts/ci/ci-driver.sh
new file mode 100755
index 00..50728a137e
--- /dev/null
+++ b/scripts/ci/ci-driver.sh
@@ -0,0 +1,424 @@
+#!/bin/bash
+
+# This script is used to build Tor for continuous integration.  It should
+# be kept the same for all supported Tor versions.
+#
+# It's subject to the regular Tor license; see LICENSE for copying
+# information.
+
+set -o errexit
+set -o nounset
+
+# Options for this script.
+DEBUG_CI="${DEBUG_CI:-no}"
+COLOR_CI="${COLOR_CI:-yes}"
+
+# Options for which CI system this is.
+ON_GITLAB="${ON_GITLAB:-yes}"
+
+# Options for how to build Tor.  All should be yes/no.
+FATAL_WARNINGS="${FATAL_WARNINGS:-yes}"
+HARDENING="${HARDENING:-no}"
+COVERAGE="${COVERAGE:-no}"
+RUST="${RUST:-no}"
+DOXYGEN="${DOXYGEN:-no}"
+ASCIIDOC="${ASCIIDOC:-no}"
+
+# Options for which tests to run.   All should be yes/no.
+CHECK="${CHECK:-yes}"
+STEM="${STEM:-no}"
+CHUTNEY="${CHUTNEY:-no}"
+DISTCHECK="${DISTCHECK:-no}"
+
+# Options for where the Tor source is.
+CI_SRCDIR="${CI_SRCDIR:-.}"
+
+# Options for where to build.
+CI_BUILDDIR="${CI_BUILDDIR:-./build}"
+
+# How parallel should we run make?
+MAKE_J_OPT="${MAKE_J_OPT:--j4}"
+# Should we stop after make finds an error?
+MAKE_K_OPT="${MAKE_K_OPT:--k}"
+
+# What make target should we use for chutney?
+CHUTNEY_MAKE_TARGET="${CHUTNEY_MAKE_TARGET:-test-network}"
+
+# Where do we find our additional testing tools?
+CHUTNEY_PATH="${CHUTNEY_PATH:-}"
+STEM_PATH="${STEM_PATH:-}"
+
+#
+# Preliminary functions.
+
+# Terminal coloring/emphasis stuff.
+if [[ "${COLOR_CI}" == "yes" ]]; then
+T_RED=$(tput setaf 1 || true)
+T_GREEN=$(tput setaf 2 || true)
+T_DIM=$(tput dim || true)
+T_BOLD=$(tput bold || true)
+T_RESET=$(tput sgr0 || true)
+else
+T_RED=
+T_GREEN=
+T_DIM=
+T_BOLD=
+T_RESET=
+fi
+
+function error()
+{
+echo "${T_BOLD}${T_RED}ERROR:${T_RESET} $*" 1>&2
+}
+function die()
+{
+echo "${T_BOLD}${T_RED}FATAL ERROR:${T_RESET} $*" 1>&2
+exit 1
+}
+function hooray()
+{
+echo "${T_BOLD}${T_GREEN}$*${T_RESET}"
+}
+
+if [[ "${DEBUG_CI}" == "yes" ]]; then
+function debug()
+{
+echo "${T_DIM}(debug): $*${T_RESET}"
+}
+else
+function debug()
+{
+:
+}
+fi
+
+function yes_or_no()
+{
+local varname="$1"
+local value="${!varname}"
+debug "${varname} is ${value}"
+if [[ "${value}" != 'yes' && "${value}" != 'no' ]]; then
+die "${varname} must be 'yes' or 'no'.  Got unexpected value ${value}".
+fi
+}
+
+function incompatible()
+{
+local varname1="$1"
+local varname2="$2"
+local val1="${!varname1}"
+local val2="${!varname2}"
+if [[ "${val1}" = 'yes' && "${val2}" = 'yes' ]]; then
+die "Cannot set both ${varname1} and ${varname2}: they are 
incompatible."
+fi
+}
+
+function runcmd()
+{
+echo "${T_BOLD}\$ $*${T_RESET}"
+if ! "$@" ; then
+error "command '$*' has failed."
+return 1
+fi
+}
+
+function show_git_version()
+{
+local tool="$1"
+local dir="$2"
+local version="?"
+if [[ -e "$dir/.git" ]] ; then
+version=$(cd "$dir"; git rev-parse HEAD)
+fi
+echo "${T_BOLD}$tool:${T_RESET} $version"
+}
+
+if [[ "${ON_GITLAB}" == "yes" ]]; then
+function start_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_start:%s:%s\r\e[0K" "$stamp" "$label"
+   echo "${T_BOLD}${T_GREEN}= $label${T_RESET}"
+}
+function end_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_end:%s:%s\r\e[0K" "$stamp" "$label"
+}
+else
+function start_section()
+{
+   true
+}
+function end_section()
+{
+   true
+}
+fi
+
+if [[ "$*" == "" ]]; then
+RUN_STAGE_CONFIGURE="yes"
+RUN_STAGE_BUILD="yes"
+RUN_STAGE_TEST="yes"
+else
+RUN_STAGE_CONFIGURE="no"
+RUN_STAGE_BUILD="no"
+RUN_STAGE_TEST="no"
+
+for stage in "$@"; do
+   case "$stage" in
+   configure)
+   RUN_STAGE_CONFIGURE="yes"
+   ;;
+   build)
+   RUN_STAGE_BUILD="yes"
+   ;;
+   test)
+   RUN_STAGE_TEST="yes"
+   ;;
+   *)
+   error "Unknown stage $stage"
+   ;;
+   esac
+done
+fi
+
+#
+# Validate inputs.
+
+debug Validating inputs
+yes_or_no DEBUG_CI

[tor-commits] [tor/maint-0.3.5] Try to set up a minimal gitlab CI script

2020-08-10 Thread nickm
commit 057f40f3d8e64389be40f26de6b634f2b8aab0d4
Author: Nick Mathewson 
Date:   Mon Aug 10 16:10:12 2020 -0400

Try to set up a minimal gitlab CI script

This is based on @eighthave's templates, and the work we've been
doing to present a uniform testing environment.
---
 .gitlab-ci.yml | 120 ++---
 1 file changed, 107 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8d6c5f418..fc160ffaea 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,111 @@
-image: debian:stable
+# This file controls how gitlab validates Tor commits and merge requests.
+#
+# It is primarily based on a set of scripts and configurations by
+# Hans-Christoph Steiner.  It only copies parts of those scripts and
+# configurations for now.  If you want a new piece of functionality
+# (more debians, more fedoras, android support) then you shouldn't
+# start from scratch: have a look at the original ticket, at
+# https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
+#
+# The file to copy from is
+# 
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
+#
+# Having said that, if there is anything really stupid here, don't
+# blame it on Hans-Christoph! Tor probably added it on their own.
+#
+# Copyright 2020, The Tor Project, Inc.
+# See LICENSE for licence information.
 
-before_script:
-- apt-get update -qq
-- apt-get upgrade -qy
+# These variables are set everywhere, unconditionally.
+variables:
+  TERM: "ansi"
+  DEBUG_CI: "yes"
 
-build:
+# This template is for exporting ephemeral things from the scripts.  By
+# convention we expect our scripts to copy stuff into artifacts/, rather than
+# having a big list of files that be treated as artifacts.
+.artifacts-template: 
+  artifacts:
+name: 
"${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
+expire_in: 1 week
+when: always
+paths:
+  - artifacts/
+
+.apt-template:  |
+  export LC_ALL=C.UTF-8
+  echo Etc/UTC > /etc/timezone
+  mkdir -p apt-cache
+  export APT_CACHE_DIR="$(pwd)/apt-cache"
+  echo 'quiet "1";' \
+   'APT::Install-Recommends "0";' \
+   'APT::Install-Suggests "0";' \
+   'APT::Acquire::Retries "20";' \
+   'APT::Get::Assume-Yes "true";' \
+   'Dpkg::Use-Pty "0";' \
+   "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
+>> /etc/apt/apt.conf.d/99gitlab
+  apt-get update -qq
+  apt-get upgrade -qy
+
+.debian-template: 
+  <<: *artifacts-template
+  variables:
+DEBIAN_FRONTEND: "noninteractive"
+  cache:
+key: apt
+paths:
+  - apt-cache
+  before_script:
+- *apt-template
+- apt-get install
+automake
+build-essential
+git
+libevent-dev
+liblzma-dev
+libscrypt-dev
+libseccomp-dev
+libssl-dev
+pkg-config
+python3
+zlib1g-dev
+- if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
+- if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
+
+debian-minimal:
+  image: debian:stable
+  <<: *debian-template
   script:
-- apt-get install -qy --fix-missing automake build-essential
-  libevent-dev libssl-dev zlib1g-dev
-  libseccomp-dev liblzma-dev libscrypt-dev
-- ./autogen.sh
-- ./configure --disable-asciidoc --enable-fatal-warnings
-  --disable-silent-rules
-- make check || (e=$?; cat test-suite.log; exit $e)
-- make install
+- ./scripts/ci/ci-driver.sh
+
+###
+# Temporarily diabled. This one just takes too long to finish right now!
+# Maybe we need to divide the call to ./src/test/test into a few segments,
+# that all end in similar amount of time?
+#debian-hardened:
+#  image: debian:testing
+#  <<: *debian-template
+#  variables:
+#HARDENING: "yes"
+#  script:
+#- ./scripts/ci/ci-driver.sh
 
+debian-distcheck:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DISTCHECK: "yes"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh
+
+debian-docs:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DOXYGEN: "no"
+ASCIIDOC: "no"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.5] Merge branch 'maint-0.3.5' into release-0.3.5

2020-08-10 Thread nickm
commit e748c1d1e7bd098cfbbf97aabb97e76d2c4c720b
Merge: 1279db39eb e873c7e893
Author: Nick Mathewson 
Date:   Mon Aug 10 19:31:56 2020 -0400

Merge branch 'maint-0.3.5' into release-0.3.5

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 src/lib/net/address.c |   2 +-
 4 files changed, 534 insertions(+), 16 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.4] small code tweaks to try to work around debian stable complaints

2020-08-10 Thread nickm
commit e873c7e893987f5ad90ef401e6f986c62b4fc42d
Author: Nick Mathewson 
Date:   Mon Aug 10 17:36:21 2020 -0400

small code tweaks to try to work around debian stable complaints
---
 src/feature/rend/rendclient.c | 4 ++--
 src/lib/net/address.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index cde954da95..5c9dbea8e3 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -261,8 +261,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
 > MAX_NICKNAME_LEN)) {
   goto perm_err;
 }
-strncpy(tmp, rendcirc->build_state->chosen_exit->nickname,
-(MAX_NICKNAME_LEN+1)); /* nul pads */
+strlcpy(tmp, rendcirc->build_state->chosen_exit->nickname,
+sizeof(tmp));
 memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie,
REND_COOKIE_LEN);
 dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN;
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 076ca3eb34..69004ddb0e 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -337,7 +337,7 @@ tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t 
len, int decorate)
   break;
 case AF_INET6:
   /* Shortest addr [ :: ] + \0 */
-  if (len < (3 + (decorate ? 2 : 0)))
+  if (len < (3 + (decorate ? 2u : 0u)))
 return NULL;
 
   if (decorate)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/release-0.3.5] Try to set up a minimal gitlab CI script

2020-08-10 Thread nickm
commit 057f40f3d8e64389be40f26de6b634f2b8aab0d4
Author: Nick Mathewson 
Date:   Mon Aug 10 16:10:12 2020 -0400

Try to set up a minimal gitlab CI script

This is based on @eighthave's templates, and the work we've been
doing to present a uniform testing environment.
---
 .gitlab-ci.yml | 120 ++---
 1 file changed, 107 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8d6c5f418..fc160ffaea 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,111 @@
-image: debian:stable
+# This file controls how gitlab validates Tor commits and merge requests.
+#
+# It is primarily based on a set of scripts and configurations by
+# Hans-Christoph Steiner.  It only copies parts of those scripts and
+# configurations for now.  If you want a new piece of functionality
+# (more debians, more fedoras, android support) then you shouldn't
+# start from scratch: have a look at the original ticket, at
+# https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
+#
+# The file to copy from is
+# 
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
+#
+# Having said that, if there is anything really stupid here, don't
+# blame it on Hans-Christoph! Tor probably added it on their own.
+#
+# Copyright 2020, The Tor Project, Inc.
+# See LICENSE for licence information.
 
-before_script:
-- apt-get update -qq
-- apt-get upgrade -qy
+# These variables are set everywhere, unconditionally.
+variables:
+  TERM: "ansi"
+  DEBUG_CI: "yes"
 
-build:
+# This template is for exporting ephemeral things from the scripts.  By
+# convention we expect our scripts to copy stuff into artifacts/, rather than
+# having a big list of files that be treated as artifacts.
+.artifacts-template: 
+  artifacts:
+name: 
"${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
+expire_in: 1 week
+when: always
+paths:
+  - artifacts/
+
+.apt-template:  |
+  export LC_ALL=C.UTF-8
+  echo Etc/UTC > /etc/timezone
+  mkdir -p apt-cache
+  export APT_CACHE_DIR="$(pwd)/apt-cache"
+  echo 'quiet "1";' \
+   'APT::Install-Recommends "0";' \
+   'APT::Install-Suggests "0";' \
+   'APT::Acquire::Retries "20";' \
+   'APT::Get::Assume-Yes "true";' \
+   'Dpkg::Use-Pty "0";' \
+   "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
+>> /etc/apt/apt.conf.d/99gitlab
+  apt-get update -qq
+  apt-get upgrade -qy
+
+.debian-template: 
+  <<: *artifacts-template
+  variables:
+DEBIAN_FRONTEND: "noninteractive"
+  cache:
+key: apt
+paths:
+  - apt-cache
+  before_script:
+- *apt-template
+- apt-get install
+automake
+build-essential
+git
+libevent-dev
+liblzma-dev
+libscrypt-dev
+libseccomp-dev
+libssl-dev
+pkg-config
+python3
+zlib1g-dev
+- if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
+- if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
+
+debian-minimal:
+  image: debian:stable
+  <<: *debian-template
   script:
-- apt-get install -qy --fix-missing automake build-essential
-  libevent-dev libssl-dev zlib1g-dev
-  libseccomp-dev liblzma-dev libscrypt-dev
-- ./autogen.sh
-- ./configure --disable-asciidoc --enable-fatal-warnings
-  --disable-silent-rules
-- make check || (e=$?; cat test-suite.log; exit $e)
-- make install
+- ./scripts/ci/ci-driver.sh
+
+###
+# Temporarily diabled. This one just takes too long to finish right now!
+# Maybe we need to divide the call to ./src/test/test into a few segments,
+# that all end in similar amount of time?
+#debian-hardened:
+#  image: debian:testing
+#  <<: *debian-template
+#  variables:
+#HARDENING: "yes"
+#  script:
+#- ./scripts/ci/ci-driver.sh
 
+debian-distcheck:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DISTCHECK: "yes"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh
+
+debian-docs:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DOXYGEN: "no"
+ASCIIDOC: "no"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'maint-0.4.2' into maint-0.4.3

2020-08-10 Thread nickm
commit f3fcc89d055811065bd9fe723b4d71b755b82edc
Merge: 39d5e7c764 68f8250cbb
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:06 2020 -0400

Merge branch 'maint-0.4.2' into maint-0.4.3

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.2] Merge branch 'maint-0.3.5' into maint-0.4.2

2020-08-10 Thread nickm
commit 68f8250cbb6f1844e7f16f5f1bc8063b8bbfdf14
Merge: 352991c843 e873c7e893
Author: Nick Mathewson 
Date:   Mon Aug 10 19:32:49 2020 -0400

Merge branch 'maint-0.3.5' into maint-0.4.2

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.3] small code tweaks to try to work around debian stable complaints

2020-08-10 Thread nickm
commit e873c7e893987f5ad90ef401e6f986c62b4fc42d
Author: Nick Mathewson 
Date:   Mon Aug 10 17:36:21 2020 -0400

small code tweaks to try to work around debian stable complaints
---
 src/feature/rend/rendclient.c | 4 ++--
 src/lib/net/address.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index cde954da95..5c9dbea8e3 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -261,8 +261,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
 > MAX_NICKNAME_LEN)) {
   goto perm_err;
 }
-strncpy(tmp, rendcirc->build_state->chosen_exit->nickname,
-(MAX_NICKNAME_LEN+1)); /* nul pads */
+strlcpy(tmp, rendcirc->build_state->chosen_exit->nickname,
+sizeof(tmp));
 memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie,
REND_COOKIE_LEN);
 dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN;
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 076ca3eb34..69004ddb0e 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -337,7 +337,7 @@ tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t 
len, int decorate)
   break;
 case AF_INET6:
   /* Shortest addr [ :: ] + \0 */
-  if (len < (3 + (decorate ? 2 : 0)))
+  if (len < (3 + (decorate ? 2u : 0u)))
 return NULL;
 
   if (decorate)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.3] Add a shareable continuous-integration script.

2020-08-10 Thread nickm
commit cb027b392f0f93d543cad1689e407b5fd71c2dec
Author: Nick Mathewson 
Date:   Mon Aug 10 15:58:28 2020 -0400

Add a shareable continuous-integration script.

Eventually this should be used by every one of our CI scripts.
---
 scripts/ci/ci-driver.sh | 424 
 1 file changed, 424 insertions(+)

diff --git a/scripts/ci/ci-driver.sh b/scripts/ci/ci-driver.sh
new file mode 100755
index 00..50728a137e
--- /dev/null
+++ b/scripts/ci/ci-driver.sh
@@ -0,0 +1,424 @@
+#!/bin/bash
+
+# This script is used to build Tor for continuous integration.  It should
+# be kept the same for all supported Tor versions.
+#
+# It's subject to the regular Tor license; see LICENSE for copying
+# information.
+
+set -o errexit
+set -o nounset
+
+# Options for this script.
+DEBUG_CI="${DEBUG_CI:-no}"
+COLOR_CI="${COLOR_CI:-yes}"
+
+# Options for which CI system this is.
+ON_GITLAB="${ON_GITLAB:-yes}"
+
+# Options for how to build Tor.  All should be yes/no.
+FATAL_WARNINGS="${FATAL_WARNINGS:-yes}"
+HARDENING="${HARDENING:-no}"
+COVERAGE="${COVERAGE:-no}"
+RUST="${RUST:-no}"
+DOXYGEN="${DOXYGEN:-no}"
+ASCIIDOC="${ASCIIDOC:-no}"
+
+# Options for which tests to run.   All should be yes/no.
+CHECK="${CHECK:-yes}"
+STEM="${STEM:-no}"
+CHUTNEY="${CHUTNEY:-no}"
+DISTCHECK="${DISTCHECK:-no}"
+
+# Options for where the Tor source is.
+CI_SRCDIR="${CI_SRCDIR:-.}"
+
+# Options for where to build.
+CI_BUILDDIR="${CI_BUILDDIR:-./build}"
+
+# How parallel should we run make?
+MAKE_J_OPT="${MAKE_J_OPT:--j4}"
+# Should we stop after make finds an error?
+MAKE_K_OPT="${MAKE_K_OPT:--k}"
+
+# What make target should we use for chutney?
+CHUTNEY_MAKE_TARGET="${CHUTNEY_MAKE_TARGET:-test-network}"
+
+# Where do we find our additional testing tools?
+CHUTNEY_PATH="${CHUTNEY_PATH:-}"
+STEM_PATH="${STEM_PATH:-}"
+
+#
+# Preliminary functions.
+
+# Terminal coloring/emphasis stuff.
+if [[ "${COLOR_CI}" == "yes" ]]; then
+T_RED=$(tput setaf 1 || true)
+T_GREEN=$(tput setaf 2 || true)
+T_DIM=$(tput dim || true)
+T_BOLD=$(tput bold || true)
+T_RESET=$(tput sgr0 || true)
+else
+T_RED=
+T_GREEN=
+T_DIM=
+T_BOLD=
+T_RESET=
+fi
+
+function error()
+{
+echo "${T_BOLD}${T_RED}ERROR:${T_RESET} $*" 1>&2
+}
+function die()
+{
+echo "${T_BOLD}${T_RED}FATAL ERROR:${T_RESET} $*" 1>&2
+exit 1
+}
+function hooray()
+{
+echo "${T_BOLD}${T_GREEN}$*${T_RESET}"
+}
+
+if [[ "${DEBUG_CI}" == "yes" ]]; then
+function debug()
+{
+echo "${T_DIM}(debug): $*${T_RESET}"
+}
+else
+function debug()
+{
+:
+}
+fi
+
+function yes_or_no()
+{
+local varname="$1"
+local value="${!varname}"
+debug "${varname} is ${value}"
+if [[ "${value}" != 'yes' && "${value}" != 'no' ]]; then
+die "${varname} must be 'yes' or 'no'.  Got unexpected value ${value}".
+fi
+}
+
+function incompatible()
+{
+local varname1="$1"
+local varname2="$2"
+local val1="${!varname1}"
+local val2="${!varname2}"
+if [[ "${val1}" = 'yes' && "${val2}" = 'yes' ]]; then
+die "Cannot set both ${varname1} and ${varname2}: they are 
incompatible."
+fi
+}
+
+function runcmd()
+{
+echo "${T_BOLD}\$ $*${T_RESET}"
+if ! "$@" ; then
+error "command '$*' has failed."
+return 1
+fi
+}
+
+function show_git_version()
+{
+local tool="$1"
+local dir="$2"
+local version="?"
+if [[ -e "$dir/.git" ]] ; then
+version=$(cd "$dir"; git rev-parse HEAD)
+fi
+echo "${T_BOLD}$tool:${T_RESET} $version"
+}
+
+if [[ "${ON_GITLAB}" == "yes" ]]; then
+function start_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_start:%s:%s\r\e[0K" "$stamp" "$label"
+   echo "${T_BOLD}${T_GREEN}= $label${T_RESET}"
+}
+function end_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_end:%s:%s\r\e[0K" "$stamp" "$label"
+}
+else
+function start_section()
+{
+   true
+}
+function end_section()
+{
+   true
+}
+fi
+
+if [[ "$*" == "" ]]; then
+RUN_STAGE_CONFIGURE="yes"
+RUN_STAGE_BUILD="yes"
+RUN_STAGE_TEST="yes"
+else
+RUN_STAGE_CONFIGURE="no"
+RUN_STAGE_BUILD="no"
+RUN_STAGE_TEST="no"
+
+for stage in "$@"; do
+   case "$stage" in
+   configure)
+   RUN_STAGE_CONFIGURE="yes"
+   ;;
+   build)
+   RUN_STAGE_BUILD="yes"
+   ;;
+   test)
+   RUN_STAGE_TEST="yes"
+   ;;
+   *)
+   error "Unknown stage $stage"
+   ;;
+   esac
+done
+fi
+
+#
+# Validate inputs.
+
+debug Validating inputs
+yes_or_no DEBUG_CI

[tor-commits] [tor/maint-0.4.4] Merge branch 'maint-0.3.5' into maint-0.4.2

2020-08-10 Thread nickm
commit 68f8250cbb6f1844e7f16f5f1bc8063b8bbfdf14
Merge: 352991c843 e873c7e893
Author: Nick Mathewson 
Date:   Mon Aug 10 19:32:49 2020 -0400

Merge branch 'maint-0.3.5' into maint-0.4.2

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.4] Try to set up a minimal gitlab CI script

2020-08-10 Thread nickm
commit 057f40f3d8e64389be40f26de6b634f2b8aab0d4
Author: Nick Mathewson 
Date:   Mon Aug 10 16:10:12 2020 -0400

Try to set up a minimal gitlab CI script

This is based on @eighthave's templates, and the work we've been
doing to present a uniform testing environment.
---
 .gitlab-ci.yml | 120 ++---
 1 file changed, 107 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8d6c5f418..fc160ffaea 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,111 @@
-image: debian:stable
+# This file controls how gitlab validates Tor commits and merge requests.
+#
+# It is primarily based on a set of scripts and configurations by
+# Hans-Christoph Steiner.  It only copies parts of those scripts and
+# configurations for now.  If you want a new piece of functionality
+# (more debians, more fedoras, android support) then you shouldn't
+# start from scratch: have a look at the original ticket, at
+# https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
+#
+# The file to copy from is
+# 
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
+#
+# Having said that, if there is anything really stupid here, don't
+# blame it on Hans-Christoph! Tor probably added it on their own.
+#
+# Copyright 2020, The Tor Project, Inc.
+# See LICENSE for licence information.
 
-before_script:
-- apt-get update -qq
-- apt-get upgrade -qy
+# These variables are set everywhere, unconditionally.
+variables:
+  TERM: "ansi"
+  DEBUG_CI: "yes"
 
-build:
+# This template is for exporting ephemeral things from the scripts.  By
+# convention we expect our scripts to copy stuff into artifacts/, rather than
+# having a big list of files that be treated as artifacts.
+.artifacts-template: 
+  artifacts:
+name: 
"${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
+expire_in: 1 week
+when: always
+paths:
+  - artifacts/
+
+.apt-template:  |
+  export LC_ALL=C.UTF-8
+  echo Etc/UTC > /etc/timezone
+  mkdir -p apt-cache
+  export APT_CACHE_DIR="$(pwd)/apt-cache"
+  echo 'quiet "1";' \
+   'APT::Install-Recommends "0";' \
+   'APT::Install-Suggests "0";' \
+   'APT::Acquire::Retries "20";' \
+   'APT::Get::Assume-Yes "true";' \
+   'Dpkg::Use-Pty "0";' \
+   "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
+>> /etc/apt/apt.conf.d/99gitlab
+  apt-get update -qq
+  apt-get upgrade -qy
+
+.debian-template: 
+  <<: *artifacts-template
+  variables:
+DEBIAN_FRONTEND: "noninteractive"
+  cache:
+key: apt
+paths:
+  - apt-cache
+  before_script:
+- *apt-template
+- apt-get install
+automake
+build-essential
+git
+libevent-dev
+liblzma-dev
+libscrypt-dev
+libseccomp-dev
+libssl-dev
+pkg-config
+python3
+zlib1g-dev
+- if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
+- if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
+
+debian-minimal:
+  image: debian:stable
+  <<: *debian-template
   script:
-- apt-get install -qy --fix-missing automake build-essential
-  libevent-dev libssl-dev zlib1g-dev
-  libseccomp-dev liblzma-dev libscrypt-dev
-- ./autogen.sh
-- ./configure --disable-asciidoc --enable-fatal-warnings
-  --disable-silent-rules
-- make check || (e=$?; cat test-suite.log; exit $e)
-- make install
+- ./scripts/ci/ci-driver.sh
+
+###
+# Temporarily diabled. This one just takes too long to finish right now!
+# Maybe we need to divide the call to ./src/test/test into a few segments,
+# that all end in similar amount of time?
+#debian-hardened:
+#  image: debian:testing
+#  <<: *debian-template
+#  variables:
+#HARDENING: "yes"
+#  script:
+#- ./scripts/ci/ci-driver.sh
 
+debian-distcheck:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DISTCHECK: "yes"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh
+
+debian-docs:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DOXYGEN: "no"
+ASCIIDOC: "no"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.5] small code tweaks to try to work around debian stable complaints

2020-08-10 Thread nickm
commit e873c7e893987f5ad90ef401e6f986c62b4fc42d
Author: Nick Mathewson 
Date:   Mon Aug 10 17:36:21 2020 -0400

small code tweaks to try to work around debian stable complaints
---
 src/feature/rend/rendclient.c | 4 ++--
 src/lib/net/address.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index cde954da95..5c9dbea8e3 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -261,8 +261,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
 > MAX_NICKNAME_LEN)) {
   goto perm_err;
 }
-strncpy(tmp, rendcirc->build_state->chosen_exit->nickname,
-(MAX_NICKNAME_LEN+1)); /* nul pads */
+strlcpy(tmp, rendcirc->build_state->chosen_exit->nickname,
+sizeof(tmp));
 memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie,
REND_COOKIE_LEN);
 dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN;
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 076ca3eb34..69004ddb0e 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -337,7 +337,7 @@ tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t 
len, int decorate)
   break;
 case AF_INET6:
   /* Shortest addr [ :: ] + \0 */
-  if (len < (3 + (decorate ? 2 : 0)))
+  if (len < (3 + (decorate ? 2u : 0u)))
 return NULL;
 
   if (decorate)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.4] Merge branch 'maint-0.4.3' into maint-0.4.4

2020-08-10 Thread nickm
commit 7d80bf80fe9017e04fff4b588f49d0393332ebee
Merge: c1b440f760 f3fcc89d05
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:07 2020 -0400

Merge branch 'maint-0.4.3' into maint-0.4.4

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.4] Merge branch 'maint-0.4.2' into maint-0.4.3

2020-08-10 Thread nickm
commit f3fcc89d055811065bd9fe723b4d71b755b82edc
Merge: 39d5e7c764 68f8250cbb
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:06 2020 -0400

Merge branch 'maint-0.4.2' into maint-0.4.3

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.4] Add a shareable continuous-integration script.

2020-08-10 Thread nickm
commit cb027b392f0f93d543cad1689e407b5fd71c2dec
Author: Nick Mathewson 
Date:   Mon Aug 10 15:58:28 2020 -0400

Add a shareable continuous-integration script.

Eventually this should be used by every one of our CI scripts.
---
 scripts/ci/ci-driver.sh | 424 
 1 file changed, 424 insertions(+)

diff --git a/scripts/ci/ci-driver.sh b/scripts/ci/ci-driver.sh
new file mode 100755
index 00..50728a137e
--- /dev/null
+++ b/scripts/ci/ci-driver.sh
@@ -0,0 +1,424 @@
+#!/bin/bash
+
+# This script is used to build Tor for continuous integration.  It should
+# be kept the same for all supported Tor versions.
+#
+# It's subject to the regular Tor license; see LICENSE for copying
+# information.
+
+set -o errexit
+set -o nounset
+
+# Options for this script.
+DEBUG_CI="${DEBUG_CI:-no}"
+COLOR_CI="${COLOR_CI:-yes}"
+
+# Options for which CI system this is.
+ON_GITLAB="${ON_GITLAB:-yes}"
+
+# Options for how to build Tor.  All should be yes/no.
+FATAL_WARNINGS="${FATAL_WARNINGS:-yes}"
+HARDENING="${HARDENING:-no}"
+COVERAGE="${COVERAGE:-no}"
+RUST="${RUST:-no}"
+DOXYGEN="${DOXYGEN:-no}"
+ASCIIDOC="${ASCIIDOC:-no}"
+
+# Options for which tests to run.   All should be yes/no.
+CHECK="${CHECK:-yes}"
+STEM="${STEM:-no}"
+CHUTNEY="${CHUTNEY:-no}"
+DISTCHECK="${DISTCHECK:-no}"
+
+# Options for where the Tor source is.
+CI_SRCDIR="${CI_SRCDIR:-.}"
+
+# Options for where to build.
+CI_BUILDDIR="${CI_BUILDDIR:-./build}"
+
+# How parallel should we run make?
+MAKE_J_OPT="${MAKE_J_OPT:--j4}"
+# Should we stop after make finds an error?
+MAKE_K_OPT="${MAKE_K_OPT:--k}"
+
+# What make target should we use for chutney?
+CHUTNEY_MAKE_TARGET="${CHUTNEY_MAKE_TARGET:-test-network}"
+
+# Where do we find our additional testing tools?
+CHUTNEY_PATH="${CHUTNEY_PATH:-}"
+STEM_PATH="${STEM_PATH:-}"
+
+#
+# Preliminary functions.
+
+# Terminal coloring/emphasis stuff.
+if [[ "${COLOR_CI}" == "yes" ]]; then
+T_RED=$(tput setaf 1 || true)
+T_GREEN=$(tput setaf 2 || true)
+T_DIM=$(tput dim || true)
+T_BOLD=$(tput bold || true)
+T_RESET=$(tput sgr0 || true)
+else
+T_RED=
+T_GREEN=
+T_DIM=
+T_BOLD=
+T_RESET=
+fi
+
+function error()
+{
+echo "${T_BOLD}${T_RED}ERROR:${T_RESET} $*" 1>&2
+}
+function die()
+{
+echo "${T_BOLD}${T_RED}FATAL ERROR:${T_RESET} $*" 1>&2
+exit 1
+}
+function hooray()
+{
+echo "${T_BOLD}${T_GREEN}$*${T_RESET}"
+}
+
+if [[ "${DEBUG_CI}" == "yes" ]]; then
+function debug()
+{
+echo "${T_DIM}(debug): $*${T_RESET}"
+}
+else
+function debug()
+{
+:
+}
+fi
+
+function yes_or_no()
+{
+local varname="$1"
+local value="${!varname}"
+debug "${varname} is ${value}"
+if [[ "${value}" != 'yes' && "${value}" != 'no' ]]; then
+die "${varname} must be 'yes' or 'no'.  Got unexpected value ${value}".
+fi
+}
+
+function incompatible()
+{
+local varname1="$1"
+local varname2="$2"
+local val1="${!varname1}"
+local val2="${!varname2}"
+if [[ "${val1}" = 'yes' && "${val2}" = 'yes' ]]; then
+die "Cannot set both ${varname1} and ${varname2}: they are 
incompatible."
+fi
+}
+
+function runcmd()
+{
+echo "${T_BOLD}\$ $*${T_RESET}"
+if ! "$@" ; then
+error "command '$*' has failed."
+return 1
+fi
+}
+
+function show_git_version()
+{
+local tool="$1"
+local dir="$2"
+local version="?"
+if [[ -e "$dir/.git" ]] ; then
+version=$(cd "$dir"; git rev-parse HEAD)
+fi
+echo "${T_BOLD}$tool:${T_RESET} $version"
+}
+
+if [[ "${ON_GITLAB}" == "yes" ]]; then
+function start_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_start:%s:%s\r\e[0K" "$stamp" "$label"
+   echo "${T_BOLD}${T_GREEN}= $label${T_RESET}"
+}
+function end_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_end:%s:%s\r\e[0K" "$stamp" "$label"
+}
+else
+function start_section()
+{
+   true
+}
+function end_section()
+{
+   true
+}
+fi
+
+if [[ "$*" == "" ]]; then
+RUN_STAGE_CONFIGURE="yes"
+RUN_STAGE_BUILD="yes"
+RUN_STAGE_TEST="yes"
+else
+RUN_STAGE_CONFIGURE="no"
+RUN_STAGE_BUILD="no"
+RUN_STAGE_TEST="no"
+
+for stage in "$@"; do
+   case "$stage" in
+   configure)
+   RUN_STAGE_CONFIGURE="yes"
+   ;;
+   build)
+   RUN_STAGE_BUILD="yes"
+   ;;
+   test)
+   RUN_STAGE_TEST="yes"
+   ;;
+   *)
+   error "Unknown stage $stage"
+   ;;
+   esac
+done
+fi
+
+#
+# Validate inputs.
+
+debug Validating inputs
+yes_or_no DEBUG_CI

[tor-commits] [tor/maint-0.4.3] Merge branch 'maint-0.4.2' into maint-0.4.3

2020-08-10 Thread nickm
commit f3fcc89d055811065bd9fe723b4d71b755b82edc
Merge: 39d5e7c764 68f8250cbb
Author: Nick Mathewson 
Date:   Mon Aug 10 19:33:06 2020 -0400

Merge branch 'maint-0.4.2' into maint-0.4.3

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] small code tweaks to try to work around debian stable complaints

2020-08-10 Thread nickm
commit e873c7e893987f5ad90ef401e6f986c62b4fc42d
Author: Nick Mathewson 
Date:   Mon Aug 10 17:36:21 2020 -0400

small code tweaks to try to work around debian stable complaints
---
 src/feature/rend/rendclient.c | 4 ++--
 src/lib/net/address.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index cde954da95..5c9dbea8e3 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -261,8 +261,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
 > MAX_NICKNAME_LEN)) {
   goto perm_err;
 }
-strncpy(tmp, rendcirc->build_state->chosen_exit->nickname,
-(MAX_NICKNAME_LEN+1)); /* nul pads */
+strlcpy(tmp, rendcirc->build_state->chosen_exit->nickname,
+sizeof(tmp));
 memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie,
REND_COOKIE_LEN);
 dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN;
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 076ca3eb34..69004ddb0e 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -337,7 +337,7 @@ tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t 
len, int decorate)
   break;
 case AF_INET6:
   /* Shortest addr [ :: ] + \0 */
-  if (len < (3 + (decorate ? 2 : 0)))
+  if (len < (3 + (decorate ? 2u : 0u)))
 return NULL;
 
   if (decorate)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.3] Merge branch 'maint-0.3.5' into maint-0.4.2

2020-08-10 Thread nickm
commit 68f8250cbb6f1844e7f16f5f1bc8063b8bbfdf14
Merge: 352991c843 e873c7e893
Author: Nick Mathewson 
Date:   Mon Aug 10 19:32:49 2020 -0400

Merge branch 'maint-0.3.5' into maint-0.4.2

 .gitlab-ci.yml| 120 ++--
 scripts/ci/ci-driver.sh   | 424 ++
 src/feature/rend/rendclient.c |   4 +-
 3 files changed, 533 insertions(+), 15 deletions(-)




___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.2] small code tweaks to try to work around debian stable complaints

2020-08-10 Thread nickm
commit e873c7e893987f5ad90ef401e6f986c62b4fc42d
Author: Nick Mathewson 
Date:   Mon Aug 10 17:36:21 2020 -0400

small code tweaks to try to work around debian stable complaints
---
 src/feature/rend/rendclient.c | 4 ++--
 src/lib/net/address.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index cde954da95..5c9dbea8e3 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -261,8 +261,8 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
 > MAX_NICKNAME_LEN)) {
   goto perm_err;
 }
-strncpy(tmp, rendcirc->build_state->chosen_exit->nickname,
-(MAX_NICKNAME_LEN+1)); /* nul pads */
+strlcpy(tmp, rendcirc->build_state->chosen_exit->nickname,
+sizeof(tmp));
 memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_data->rend_cookie,
REND_COOKIE_LEN);
 dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN;
diff --git a/src/lib/net/address.c b/src/lib/net/address.c
index 076ca3eb34..69004ddb0e 100644
--- a/src/lib/net/address.c
+++ b/src/lib/net/address.c
@@ -337,7 +337,7 @@ tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t 
len, int decorate)
   break;
 case AF_INET6:
   /* Shortest addr [ :: ] + \0 */
-  if (len < (3 + (decorate ? 2 : 0)))
+  if (len < (3 + (decorate ? 2u : 0u)))
 return NULL;
 
   if (decorate)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.4.3] Try to set up a minimal gitlab CI script

2020-08-10 Thread nickm
commit 057f40f3d8e64389be40f26de6b634f2b8aab0d4
Author: Nick Mathewson 
Date:   Mon Aug 10 16:10:12 2020 -0400

Try to set up a minimal gitlab CI script

This is based on @eighthave's templates, and the work we've been
doing to present a uniform testing environment.
---
 .gitlab-ci.yml | 120 ++---
 1 file changed, 107 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8d6c5f418..fc160ffaea 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,111 @@
-image: debian:stable
+# This file controls how gitlab validates Tor commits and merge requests.
+#
+# It is primarily based on a set of scripts and configurations by
+# Hans-Christoph Steiner.  It only copies parts of those scripts and
+# configurations for now.  If you want a new piece of functionality
+# (more debians, more fedoras, android support) then you shouldn't
+# start from scratch: have a look at the original ticket, at
+# https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
+#
+# The file to copy from is
+# 
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
+#
+# Having said that, if there is anything really stupid here, don't
+# blame it on Hans-Christoph! Tor probably added it on their own.
+#
+# Copyright 2020, The Tor Project, Inc.
+# See LICENSE for licence information.
 
-before_script:
-- apt-get update -qq
-- apt-get upgrade -qy
+# These variables are set everywhere, unconditionally.
+variables:
+  TERM: "ansi"
+  DEBUG_CI: "yes"
 
-build:
+# This template is for exporting ephemeral things from the scripts.  By
+# convention we expect our scripts to copy stuff into artifacts/, rather than
+# having a big list of files that be treated as artifacts.
+.artifacts-template: 
+  artifacts:
+name: 
"${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
+expire_in: 1 week
+when: always
+paths:
+  - artifacts/
+
+.apt-template:  |
+  export LC_ALL=C.UTF-8
+  echo Etc/UTC > /etc/timezone
+  mkdir -p apt-cache
+  export APT_CACHE_DIR="$(pwd)/apt-cache"
+  echo 'quiet "1";' \
+   'APT::Install-Recommends "0";' \
+   'APT::Install-Suggests "0";' \
+   'APT::Acquire::Retries "20";' \
+   'APT::Get::Assume-Yes "true";' \
+   'Dpkg::Use-Pty "0";' \
+   "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
+>> /etc/apt/apt.conf.d/99gitlab
+  apt-get update -qq
+  apt-get upgrade -qy
+
+.debian-template: 
+  <<: *artifacts-template
+  variables:
+DEBIAN_FRONTEND: "noninteractive"
+  cache:
+key: apt
+paths:
+  - apt-cache
+  before_script:
+- *apt-template
+- apt-get install
+automake
+build-essential
+git
+libevent-dev
+liblzma-dev
+libscrypt-dev
+libseccomp-dev
+libssl-dev
+pkg-config
+python3
+zlib1g-dev
+- if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
+- if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
+
+debian-minimal:
+  image: debian:stable
+  <<: *debian-template
   script:
-- apt-get install -qy --fix-missing automake build-essential
-  libevent-dev libssl-dev zlib1g-dev
-  libseccomp-dev liblzma-dev libscrypt-dev
-- ./autogen.sh
-- ./configure --disable-asciidoc --enable-fatal-warnings
-  --disable-silent-rules
-- make check || (e=$?; cat test-suite.log; exit $e)
-- make install
+- ./scripts/ci/ci-driver.sh
+
+###
+# Temporarily diabled. This one just takes too long to finish right now!
+# Maybe we need to divide the call to ./src/test/test into a few segments,
+# that all end in similar amount of time?
+#debian-hardened:
+#  image: debian:testing
+#  <<: *debian-template
+#  variables:
+#HARDENING: "yes"
+#  script:
+#- ./scripts/ci/ci-driver.sh
 
+debian-distcheck:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DISTCHECK: "yes"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh
+
+debian-docs:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DOXYGEN: "no"
+ASCIIDOC: "no"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/maint-0.3.5] Add a shareable continuous-integration script.

2020-08-10 Thread nickm
commit cb027b392f0f93d543cad1689e407b5fd71c2dec
Author: Nick Mathewson 
Date:   Mon Aug 10 15:58:28 2020 -0400

Add a shareable continuous-integration script.

Eventually this should be used by every one of our CI scripts.
---
 scripts/ci/ci-driver.sh | 424 
 1 file changed, 424 insertions(+)

diff --git a/scripts/ci/ci-driver.sh b/scripts/ci/ci-driver.sh
new file mode 100755
index 00..50728a137e
--- /dev/null
+++ b/scripts/ci/ci-driver.sh
@@ -0,0 +1,424 @@
+#!/bin/bash
+
+# This script is used to build Tor for continuous integration.  It should
+# be kept the same for all supported Tor versions.
+#
+# It's subject to the regular Tor license; see LICENSE for copying
+# information.
+
+set -o errexit
+set -o nounset
+
+# Options for this script.
+DEBUG_CI="${DEBUG_CI:-no}"
+COLOR_CI="${COLOR_CI:-yes}"
+
+# Options for which CI system this is.
+ON_GITLAB="${ON_GITLAB:-yes}"
+
+# Options for how to build Tor.  All should be yes/no.
+FATAL_WARNINGS="${FATAL_WARNINGS:-yes}"
+HARDENING="${HARDENING:-no}"
+COVERAGE="${COVERAGE:-no}"
+RUST="${RUST:-no}"
+DOXYGEN="${DOXYGEN:-no}"
+ASCIIDOC="${ASCIIDOC:-no}"
+
+# Options for which tests to run.   All should be yes/no.
+CHECK="${CHECK:-yes}"
+STEM="${STEM:-no}"
+CHUTNEY="${CHUTNEY:-no}"
+DISTCHECK="${DISTCHECK:-no}"
+
+# Options for where the Tor source is.
+CI_SRCDIR="${CI_SRCDIR:-.}"
+
+# Options for where to build.
+CI_BUILDDIR="${CI_BUILDDIR:-./build}"
+
+# How parallel should we run make?
+MAKE_J_OPT="${MAKE_J_OPT:--j4}"
+# Should we stop after make finds an error?
+MAKE_K_OPT="${MAKE_K_OPT:--k}"
+
+# What make target should we use for chutney?
+CHUTNEY_MAKE_TARGET="${CHUTNEY_MAKE_TARGET:-test-network}"
+
+# Where do we find our additional testing tools?
+CHUTNEY_PATH="${CHUTNEY_PATH:-}"
+STEM_PATH="${STEM_PATH:-}"
+
+#
+# Preliminary functions.
+
+# Terminal coloring/emphasis stuff.
+if [[ "${COLOR_CI}" == "yes" ]]; then
+T_RED=$(tput setaf 1 || true)
+T_GREEN=$(tput setaf 2 || true)
+T_DIM=$(tput dim || true)
+T_BOLD=$(tput bold || true)
+T_RESET=$(tput sgr0 || true)
+else
+T_RED=
+T_GREEN=
+T_DIM=
+T_BOLD=
+T_RESET=
+fi
+
+function error()
+{
+echo "${T_BOLD}${T_RED}ERROR:${T_RESET} $*" 1>&2
+}
+function die()
+{
+echo "${T_BOLD}${T_RED}FATAL ERROR:${T_RESET} $*" 1>&2
+exit 1
+}
+function hooray()
+{
+echo "${T_BOLD}${T_GREEN}$*${T_RESET}"
+}
+
+if [[ "${DEBUG_CI}" == "yes" ]]; then
+function debug()
+{
+echo "${T_DIM}(debug): $*${T_RESET}"
+}
+else
+function debug()
+{
+:
+}
+fi
+
+function yes_or_no()
+{
+local varname="$1"
+local value="${!varname}"
+debug "${varname} is ${value}"
+if [[ "${value}" != 'yes' && "${value}" != 'no' ]]; then
+die "${varname} must be 'yes' or 'no'.  Got unexpected value ${value}".
+fi
+}
+
+function incompatible()
+{
+local varname1="$1"
+local varname2="$2"
+local val1="${!varname1}"
+local val2="${!varname2}"
+if [[ "${val1}" = 'yes' && "${val2}" = 'yes' ]]; then
+die "Cannot set both ${varname1} and ${varname2}: they are 
incompatible."
+fi
+}
+
+function runcmd()
+{
+echo "${T_BOLD}\$ $*${T_RESET}"
+if ! "$@" ; then
+error "command '$*' has failed."
+return 1
+fi
+}
+
+function show_git_version()
+{
+local tool="$1"
+local dir="$2"
+local version="?"
+if [[ -e "$dir/.git" ]] ; then
+version=$(cd "$dir"; git rev-parse HEAD)
+fi
+echo "${T_BOLD}$tool:${T_RESET} $version"
+}
+
+if [[ "${ON_GITLAB}" == "yes" ]]; then
+function start_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_start:%s:%s\r\e[0K" "$stamp" "$label"
+   echo "${T_BOLD}${T_GREEN}= $label${T_RESET}"
+}
+function end_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_end:%s:%s\r\e[0K" "$stamp" "$label"
+}
+else
+function start_section()
+{
+   true
+}
+function end_section()
+{
+   true
+}
+fi
+
+if [[ "$*" == "" ]]; then
+RUN_STAGE_CONFIGURE="yes"
+RUN_STAGE_BUILD="yes"
+RUN_STAGE_TEST="yes"
+else
+RUN_STAGE_CONFIGURE="no"
+RUN_STAGE_BUILD="no"
+RUN_STAGE_TEST="no"
+
+for stage in "$@"; do
+   case "$stage" in
+   configure)
+   RUN_STAGE_CONFIGURE="yes"
+   ;;
+   build)
+   RUN_STAGE_BUILD="yes"
+   ;;
+   test)
+   RUN_STAGE_TEST="yes"
+   ;;
+   *)
+   error "Unknown stage $stage"
+   ;;
+   esac
+done
+fi
+
+#
+# Validate inputs.
+
+debug Validating inputs
+yes_or_no DEBUG_CI

[tor-commits] [tor/maint-0.4.2] Add a shareable continuous-integration script.

2020-08-10 Thread nickm
commit cb027b392f0f93d543cad1689e407b5fd71c2dec
Author: Nick Mathewson 
Date:   Mon Aug 10 15:58:28 2020 -0400

Add a shareable continuous-integration script.

Eventually this should be used by every one of our CI scripts.
---
 scripts/ci/ci-driver.sh | 424 
 1 file changed, 424 insertions(+)

diff --git a/scripts/ci/ci-driver.sh b/scripts/ci/ci-driver.sh
new file mode 100755
index 00..50728a137e
--- /dev/null
+++ b/scripts/ci/ci-driver.sh
@@ -0,0 +1,424 @@
+#!/bin/bash
+
+# This script is used to build Tor for continuous integration.  It should
+# be kept the same for all supported Tor versions.
+#
+# It's subject to the regular Tor license; see LICENSE for copying
+# information.
+
+set -o errexit
+set -o nounset
+
+# Options for this script.
+DEBUG_CI="${DEBUG_CI:-no}"
+COLOR_CI="${COLOR_CI:-yes}"
+
+# Options for which CI system this is.
+ON_GITLAB="${ON_GITLAB:-yes}"
+
+# Options for how to build Tor.  All should be yes/no.
+FATAL_WARNINGS="${FATAL_WARNINGS:-yes}"
+HARDENING="${HARDENING:-no}"
+COVERAGE="${COVERAGE:-no}"
+RUST="${RUST:-no}"
+DOXYGEN="${DOXYGEN:-no}"
+ASCIIDOC="${ASCIIDOC:-no}"
+
+# Options for which tests to run.   All should be yes/no.
+CHECK="${CHECK:-yes}"
+STEM="${STEM:-no}"
+CHUTNEY="${CHUTNEY:-no}"
+DISTCHECK="${DISTCHECK:-no}"
+
+# Options for where the Tor source is.
+CI_SRCDIR="${CI_SRCDIR:-.}"
+
+# Options for where to build.
+CI_BUILDDIR="${CI_BUILDDIR:-./build}"
+
+# How parallel should we run make?
+MAKE_J_OPT="${MAKE_J_OPT:--j4}"
+# Should we stop after make finds an error?
+MAKE_K_OPT="${MAKE_K_OPT:--k}"
+
+# What make target should we use for chutney?
+CHUTNEY_MAKE_TARGET="${CHUTNEY_MAKE_TARGET:-test-network}"
+
+# Where do we find our additional testing tools?
+CHUTNEY_PATH="${CHUTNEY_PATH:-}"
+STEM_PATH="${STEM_PATH:-}"
+
+#
+# Preliminary functions.
+
+# Terminal coloring/emphasis stuff.
+if [[ "${COLOR_CI}" == "yes" ]]; then
+T_RED=$(tput setaf 1 || true)
+T_GREEN=$(tput setaf 2 || true)
+T_DIM=$(tput dim || true)
+T_BOLD=$(tput bold || true)
+T_RESET=$(tput sgr0 || true)
+else
+T_RED=
+T_GREEN=
+T_DIM=
+T_BOLD=
+T_RESET=
+fi
+
+function error()
+{
+echo "${T_BOLD}${T_RED}ERROR:${T_RESET} $*" 1>&2
+}
+function die()
+{
+echo "${T_BOLD}${T_RED}FATAL ERROR:${T_RESET} $*" 1>&2
+exit 1
+}
+function hooray()
+{
+echo "${T_BOLD}${T_GREEN}$*${T_RESET}"
+}
+
+if [[ "${DEBUG_CI}" == "yes" ]]; then
+function debug()
+{
+echo "${T_DIM}(debug): $*${T_RESET}"
+}
+else
+function debug()
+{
+:
+}
+fi
+
+function yes_or_no()
+{
+local varname="$1"
+local value="${!varname}"
+debug "${varname} is ${value}"
+if [[ "${value}" != 'yes' && "${value}" != 'no' ]]; then
+die "${varname} must be 'yes' or 'no'.  Got unexpected value ${value}".
+fi
+}
+
+function incompatible()
+{
+local varname1="$1"
+local varname2="$2"
+local val1="${!varname1}"
+local val2="${!varname2}"
+if [[ "${val1}" = 'yes' && "${val2}" = 'yes' ]]; then
+die "Cannot set both ${varname1} and ${varname2}: they are 
incompatible."
+fi
+}
+
+function runcmd()
+{
+echo "${T_BOLD}\$ $*${T_RESET}"
+if ! "$@" ; then
+error "command '$*' has failed."
+return 1
+fi
+}
+
+function show_git_version()
+{
+local tool="$1"
+local dir="$2"
+local version="?"
+if [[ -e "$dir/.git" ]] ; then
+version=$(cd "$dir"; git rev-parse HEAD)
+fi
+echo "${T_BOLD}$tool:${T_RESET} $version"
+}
+
+if [[ "${ON_GITLAB}" == "yes" ]]; then
+function start_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_start:%s:%s\r\e[0K" "$stamp" "$label"
+   echo "${T_BOLD}${T_GREEN}= $label${T_RESET}"
+}
+function end_section()
+{
+   local label="$1"
+   local stamp
+   stamp=$(date +%s)
+   printf "section_end:%s:%s\r\e[0K" "$stamp" "$label"
+}
+else
+function start_section()
+{
+   true
+}
+function end_section()
+{
+   true
+}
+fi
+
+if [[ "$*" == "" ]]; then
+RUN_STAGE_CONFIGURE="yes"
+RUN_STAGE_BUILD="yes"
+RUN_STAGE_TEST="yes"
+else
+RUN_STAGE_CONFIGURE="no"
+RUN_STAGE_BUILD="no"
+RUN_STAGE_TEST="no"
+
+for stage in "$@"; do
+   case "$stage" in
+   configure)
+   RUN_STAGE_CONFIGURE="yes"
+   ;;
+   build)
+   RUN_STAGE_BUILD="yes"
+   ;;
+   test)
+   RUN_STAGE_TEST="yes"
+   ;;
+   *)
+   error "Unknown stage $stage"
+   ;;
+   esac
+done
+fi
+
+#
+# Validate inputs.
+
+debug Validating inputs
+yes_or_no DEBUG_CI

[tor-commits] [tor/maint-0.4.2] Try to set up a minimal gitlab CI script

2020-08-10 Thread nickm
commit 057f40f3d8e64389be40f26de6b634f2b8aab0d4
Author: Nick Mathewson 
Date:   Mon Aug 10 16:10:12 2020 -0400

Try to set up a minimal gitlab CI script

This is based on @eighthave's templates, and the work we've been
doing to present a uniform testing environment.
---
 .gitlab-ci.yml | 120 ++---
 1 file changed, 107 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e8d6c5f418..fc160ffaea 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,111 @@
-image: debian:stable
+# This file controls how gitlab validates Tor commits and merge requests.
+#
+# It is primarily based on a set of scripts and configurations by
+# Hans-Christoph Steiner.  It only copies parts of those scripts and
+# configurations for now.  If you want a new piece of functionality
+# (more debians, more fedoras, android support) then you shouldn't
+# start from scratch: have a look at the original ticket, at
+# https://gitlab.torproject.org/tpo/core/tor/-/issues/32193 !
+#
+# The file to copy from is
+# 
https://gitlab.torproject.org/tpo/core/tor/-/merge_requests/96/diffs#diff-content-587d266bb27a4dc3022bbed44dfa19849df3044c
+#
+# Having said that, if there is anything really stupid here, don't
+# blame it on Hans-Christoph! Tor probably added it on their own.
+#
+# Copyright 2020, The Tor Project, Inc.
+# See LICENSE for licence information.
 
-before_script:
-- apt-get update -qq
-- apt-get upgrade -qy
+# These variables are set everywhere, unconditionally.
+variables:
+  TERM: "ansi"
+  DEBUG_CI: "yes"
 
-build:
+# This template is for exporting ephemeral things from the scripts.  By
+# convention we expect our scripts to copy stuff into artifacts/, rather than
+# having a big list of files that be treated as artifacts.
+.artifacts-template: 
+  artifacts:
+name: 
"${CI_PROJECT_PATH}_${CI_JOB_STAGE}_${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}"
+expire_in: 1 week
+when: always
+paths:
+  - artifacts/
+
+.apt-template:  |
+  export LC_ALL=C.UTF-8
+  echo Etc/UTC > /etc/timezone
+  mkdir -p apt-cache
+  export APT_CACHE_DIR="$(pwd)/apt-cache"
+  echo 'quiet "1";' \
+   'APT::Install-Recommends "0";' \
+   'APT::Install-Suggests "0";' \
+   'APT::Acquire::Retries "20";' \
+   'APT::Get::Assume-Yes "true";' \
+   'Dpkg::Use-Pty "0";' \
+   "Dir::Cache::Archives \"${APT_CACHE_DIR}\"; " \
+>> /etc/apt/apt.conf.d/99gitlab
+  apt-get update -qq
+  apt-get upgrade -qy
+
+.debian-template: 
+  <<: *artifacts-template
+  variables:
+DEBIAN_FRONTEND: "noninteractive"
+  cache:
+key: apt
+paths:
+  - apt-cache
+  before_script:
+- *apt-template
+- apt-get install
+automake
+build-essential
+git
+libevent-dev
+liblzma-dev
+libscrypt-dev
+libseccomp-dev
+libssl-dev
+pkg-config
+python3
+zlib1g-dev
+- if [ "$ASCIIDOC" = yes ]; then apt-get install asciidoc xmlto; fi
+- if [ "$DOXYGEN" = yes ]; then apt-get install doxygen; fi
+
+debian-minimal:
+  image: debian:stable
+  <<: *debian-template
   script:
-- apt-get install -qy --fix-missing automake build-essential
-  libevent-dev libssl-dev zlib1g-dev
-  libseccomp-dev liblzma-dev libscrypt-dev
-- ./autogen.sh
-- ./configure --disable-asciidoc --enable-fatal-warnings
-  --disable-silent-rules
-- make check || (e=$?; cat test-suite.log; exit $e)
-- make install
+- ./scripts/ci/ci-driver.sh
+
+###
+# Temporarily diabled. This one just takes too long to finish right now!
+# Maybe we need to divide the call to ./src/test/test into a few segments,
+# that all end in similar amount of time?
+#debian-hardened:
+#  image: debian:testing
+#  <<: *debian-template
+#  variables:
+#HARDENING: "yes"
+#  script:
+#- ./scripts/ci/ci-driver.sh
 
+debian-distcheck:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DISTCHECK: "yes"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh
+
+debian-docs:
+  image: debian:stable
+  <<: *debian-template
+  variables:
+DOXYGEN: "no"
+ASCIIDOC: "no"
+CHECK: "no"
+  script:
+- ./scripts/ci/ci-driver.sh



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/communitytpo-contentspot] https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot

2020-08-10 Thread translation
commit 6536c4580d7ce0f9907f1feacefb9d6f178b135e
Author: Translation commit bot 
Date:   Mon Aug 10 20:45:10 2020 +


https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot
---
 contents+es.po | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/contents+es.po b/contents+es.po
index 5d549879df..4bcf756248 100644
--- a/contents+es.po
+++ b/contents+es.po
@@ -7468,11 +7468,15 @@ msgid ""
 "don't end up with your own IP range. Here is template you can use: "
 "[Inquiry](https://www.torservers.net/wiki/hoster/inquiry)"
 msgstr ""
+"El proceso en dos pasos usualmente ayuda para elevar tu solicitud a niveles "
+"más altos del personal de soporte, sin asustarlos demasiado pronto, incluso "
+"si no obtienes tu propio rango de IP. He aquí la plantilla que puedes usar: "
+"[Indagación](https://www.torservers.net/wiki/hoster/inquiry)"
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
 msgid "## Legal"
-msgstr ""
+msgstr "## Legal"
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
@@ -7481,6 +7485,9 @@ msgid ""
 " communication services in your country (and the country of your hosting "
 "provider!)."
 msgstr ""
+"### Asegúrate que conoces los párrafos legales relevantes para las 
compañías"
+" de telecomunicaciones en tu país (¡y en el país de tu proveedor de "
+"alojamiento!)."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
@@ -7489,6 +7496,9 @@ msgid ""
 "communication service providers from liability.  Please add your country's "
 "regulations to this list."
 msgstr ""
+"Al menos la mayoría de los países occidentales debieran tener regulaciones "
+"que excluyen de responsabilidad a los proveedores de servicios de "
+"comunicación. Por favor añade las regulaciones de tu país a esta lista."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
@@ -7497,6 +7507,10 @@ msgid ""
 "[EFF's Legal FAQ for Tor Operators](https://2019.www.torproject.org/eff/tor-;
 "legal-faq)  (a very good and relevant read for other countries as well)"
 msgstr ""
+"* EE.UU.: [DMCA 512](https://www.law.cornell.edu/uscode/text/17/512); mira "
+"[Preguntas Legales Más Fecuentes de la EFF para Operadores "
+"Tor](https://2019.www.torproject.org/eff/tor-legal-faq)  (una lectura muy "
+"buena y relevante para otros países también)"
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/communitytpo-contentspot] https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot

2020-08-10 Thread translation
commit 761923a6db98baed9f9ae69f15711c237f50cc15
Author: Translation commit bot 
Date:   Mon Aug 10 20:15:13 2020 +


https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot
---
 contents+es.po | 39 +++
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/contents+es.po b/contents+es.po
index 78e10c8c14..5d549879df 100644
--- a/contents+es.po
+++ b/contents+es.po
@@ -7332,16 +7332,20 @@ msgid ""
 "specific legal problems, issues, or questions, seek a complete review of "
 "your situation with a lawyer licensed to practice in your jurisdiction."
 msgstr ""
+"Por lo tanto, por favor no actúes solo sobre esta información; si tienes "
+"cualesquiera problemas legales específicos, cuestiones, o preguntas, busca "
+"una completa revisión de tu situación con un abogado licenciado para "
+"practicar en tu jurisdicción."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
 msgid "## Hosting"
-msgstr ""
+msgstr "## Alojamiento"
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
 msgid "### Tor at Universities: Find allies."
-msgstr ""
+msgstr "### Tor en Universidades: Encuentra aliados."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
@@ -7351,6 +7355,8 @@ msgid ""
 "Find some professors (or deans!) who like the idea of supporting and/or "
 "researching anonymity on the Internet."
 msgstr ""
+"Encuentra algunos profesores (¡o decanos!) a quienes les guste la idea de "
+"respaldar y/o investigar el anonimato en la Internet."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
@@ -7362,6 +7368,13 @@ msgid ""
 "resources, the university is forced to maintain an iron grip on all its "
 "addresses."
 msgstr ""
+"Si es posible, usa un rango extra de IP, cuyo contacto de abuso no vaya a "
+"través del equipo principal de abuso de la universidad. Idealmente, usa "
+"direcciones en las que no confíe la autenticación basada en IP que muchos "
+"servicios relacionados con bibliotecas usan -- si el espacio completo de "
+"direcciones IP de la universidad es \"confiable\" para acceder a estos "
+"recursos de biblioteca, la universidad es forzada a mantener una mano de "
+"hierro en todas sus direcciones."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
@@ -7369,11 +7382,13 @@ msgid ""
 "Also read [How do I make my University / ISP / etc happy with my exit "
 "node?](/relay/community-resources/tor-relay-universities/)"
 msgstr ""
+"También lee [¿Cómo hago felices a mi Universidad / ISP / etc con mi nodo 
de "
+"salida?](/relay/community-resources/tor-relay-universities/)"
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
 msgid "### Find Tor-friendly ISPs."
-msgstr ""
+msgstr "### Encuentra ISPs amigables con Tor."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
@@ -7381,6 +7396,8 @@ msgid ""
 "A good ISP is one that offers cheap bandwidth and is not being used by other"
 " members of the Tor community."
 msgstr ""
+"Un buen ISP es uno que ofrece ancho de banda barato y no está siendo usado "
+"por otros miembros de la comunidad Tor."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
@@ -7388,6 +7405,8 @@ msgid ""
 "Before you continue, you may ask the Tor community if your choice is a good "
 "one."
 msgstr ""
+"Antes de continuar, puedes preguntarle a la comunidad Tor si tu elección es "
+"buena."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 
(content/relay-operations/community-resources/tor-exit-guidelines/contents+en.lrpage.body)
@@ -7395,11 +7414,14 @@ msgid ""
 "We very much need diversity, and it does not help if we pool too many exits "
 "at one friendly ISP."
 msgstr ""
+"Necesitamos muchísimo de la diversidad, y no nos ayuda si juntamos "
+"demasiadas salidas en un ISP amigable."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-exit-guidelines/
 #: 

[tor-commits] [translation/communitytpo-contentspot] https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot

2020-08-10 Thread translation
commit 98a978e3469a1c6d30a33cf0e811ee5451f1d934
Author: Translation commit bot 
Date:   Mon Aug 10 19:45:17 2020 +


https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot
---
 contents+es.po | 45 ++---
 1 file changed, 34 insertions(+), 11 deletions(-)

diff --git a/contents+es.po b/contents+es.po
index c11205545f..78e10c8c14 100644
--- a/contents+es.po
+++ b/contents+es.po
@@ -4038,7 +4038,7 @@ msgid ""
 msgstr ""
 "Antes de traducir, por favor lea la pagina de Tor Project en [Localization "
 "Lab Wiki](https://wiki.localizationlab.org/index.php/Tor). Esta pagina "
-"incluye guías, recursos, y prioridades que te ayudaran a contribuir de la "
+"incluye pautas, recursos, y prioridades que te ayudarán a contribuir de la "
 "mejor manera."
 
 #: https//community.torproject.org/localization/becoming-tor-translator/
@@ -5891,9 +5891,9 @@ msgid ""
 "document."
 msgstr ""
 "Por favor mira [Consejos para Correr un Nodo de Salida con Mínimo "
-"Acoso](https://blog.torproject.org/running-exit-node) y [Lineamientos para "
-"una Salida Tor](tor-exit-guidelines) para más información, antes de leer "
-"este documento."
+"Acoso](https://blog.torproject.org/running-exit-node) y [Pautas para una "
+"Salida Tor](tor-exit-guidelines) para más información, antes de leer este "
+"documento."
 
 #: 
https//community.torproject.org/relay/community-resources/tor-abuse-templates/
 #: 
(content/relay-operations/community-resources/tor-abuse-templates/contents+en.lrpage.body)
@@ -7213,12 +7213,13 @@ msgid ""
 " allows for middle and rendezvous usage)"
 msgstr ""
 "* Invalid - Nunca usar a menos que AllowInvalidNodes esté establecido (por "
-"defecto esto solamente permite el uso como intermediario y encuentro)"
+"defecto esto solamente permite el uso como intermediario y punto de "
+"encuentro)"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
 msgid "* Reject - Dropped from the consensus entirely"
-msgstr ""
+msgstr "* Reject - Fuera del consenso por completo"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7226,11 +7227,13 @@ msgid ""
 "Which we use depends on the severity of the issue, and if it can still be "
 "safely used in certain situations."
 msgstr ""
+"Cuál usamos depende de la severidad del problema, y si aún puede ser usado "
+"en forma segura en ciertas situaciones."
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
 msgid "### My relays was given the BadExit flag. What's up?"
-msgstr ""
+msgstr "### A mis repetidores les fue dada la marca BadExit. ¿Qué pasa?"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7239,11 +7242,15 @@ msgid ""
 "issue, so if your relay has been flagged as a BadExit then please let us "
 "know (see above for contact info) so we can work together to fix the issue."
 msgstr ""
+"En casi todos los casos no fuimos capaces de contactar al operador para "
+"resolver el problema, por lo que si tu repetidor ha sido marcado como "
+"BadExit, por favor háznoslo saber (mirar arriba por información de "
+"contacto), de manera que podamos trabajar juntos para resolver el problema."
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
 msgid "### Do you actively look for bad relays?"
-msgstr ""
+msgstr "### ¿Buscan activamente a repetidores maliciosos?"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7252,6 +7259,9 @@ msgid ""
 "[exitmap](http://www.cs.kau.se/philwint/spoiled_onions/) and "
 "[sybilhunter](https://gitweb.torproject.org/user/phw/sybilhunter.git/)."
 msgstr ""
+"Sí. Por nuestra detección automatizada de problemas mira al [mapa de "
+"salidas](http://www.cs.kau.se/philwint/spoiled_onions/) y al [cazador de "
+"sybil](https://gitweb.torproject.org/user/phw/sybilhunter.git/)."
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7262,16 +7272,21 @@ msgid ""
 " [torscanner](https://code.google.com/p/torscanner/), and "
 "[DetecTor](http://detector.io/DetecTor.html)."
 msgstr ""
+"Otros monitores incluyen "
+"[tortunnel](http://www.thoughtcrime.org/software/tortunnel/), "
+"[SoaT](https://gitweb.torproject.org/torflow.git/blob/HEAD:/NetworkScanners/ExitAuthority/README.ExitScanning),"
+" 

[tor-commits] [translation/support-portal] https://gitweb.torproject.org/translation.git/commit/?h=support-portal

2020-08-10 Thread translation
commit 08f5f2e749ea091abbda01027ea1d4fc9d068b3e
Author: Translation commit bot 
Date:   Mon Aug 10 19:18:04 2020 +

https://gitweb.torproject.org/translation.git/commit/?h=support-portal
---
 contents+ar.po | 38 --
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/contents+ar.po b/contents+ar.po
index 2a2ab2894a..f31f55c39e 100644
--- a/contents+ar.po
+++ b/contents+ar.po
@@ -7439,7 +7439,7 @@ msgstr ""
 #: https//support.torproject.org/operators/multiple-relays/
 #: (content/operators/multiple-relays/contents+en.lrquestion.title)
 msgid "I want to run more than one Tor relay."
-msgstr ""
+msgstr "أريد تشغيل أكثر من مرحل Tor."
 
 #: https//support.torproject.org/operators/multiple-relays/
 #: (content/operators/multiple-relays/contents+en.lrquestion.description)
@@ -7447,6 +7447,8 @@ msgid ""
 "Great. If you want to run several relays to donate more to the network, "
 "we're happy with that."
 msgstr ""
+"عظيم. إذا كنت ترغب في تشغيل عدة مرحلات 
للتبرع بالمزيد للشبكة ، فنحن سعداء "
+"بذلك."
 
 #: https//support.torproject.org/operators/multiple-relays/
 #: (content/operators/multiple-relays/contents+en.lrquestion.description)
@@ -7454,6 +7456,8 @@ msgid ""
 "But please don't run more than a few dozen on the same network, since part "
 "of the goal of the Tor network is dispersal and diversity."
 msgstr ""
+"لكن من فضلك لا تعمل أكثر من بضع عشرات على 
نفس الشبكة ، لأن جزءًا من هدف شبكة"
+" Tor هو التشتت والتنوع."
 
 #: https//support.torproject.org/operators/multiple-relays/
 #: (content/operators/multiple-relays/contents+en.lrquestion.description)
@@ -7462,18 +7466,21 @@ msgid ""
 "config option in the torrc of each relay, listing all the relays (comma-"
 "separated) that are under your control:"
 msgstr ""
+"إذا قررت تشغيل أكثر من مرحل واحد ، فالرجاء 
تعيين خيار التكوين \"عائلتي\" في "
+"ملف التورك لكل مرحل ، مع سرد جميع المرحلات 
(المفصولة بفواصل) التي تقع تحت "
+"سيطرتك:"
 
 #: https//support.torproject.org/operators/multiple-relays/
 #: (content/operators/multiple-relays/contents+en.lrquestion.description)
 msgid "MyFamily $fingerprint1,$fingerprint2,$fingerprint3"
-msgstr ""
+msgstr "عائلتي بصمة $ 1 ، بصمة $ 2 ، $ بصمة 3"
 
 #: https//support.torproject.org/operators/multiple-relays/
 #: (content/operators/multiple-relays/contents+en.lrquestion.description)
 msgid ""
 "where each fingerprint is the 40 character identity fingerprint (without "
 "spaces)."
-msgstr ""
+msgstr "حيث كل بصمة هي بصمة هوية 40 حرف (بدون 
فراغات)."
 
 #: https//support.torproject.org/operators/multiple-relays/
 #: (content/operators/multiple-relays/contents+en.lrquestion.description)
@@ -7481,6 +7488,7 @@ msgid ""
 "That way, Tor clients will know to avoid using more than one of your relays "
 "in a single circuit."
 msgstr ""
+"بهذه الطريقة ، سيعرف عملاء Tor تجنب استخدام 
أكثر من مرحلاتك في دائرة واحدة."
 
 #: https//support.torproject.org/operators/multiple-relays/
 #: (content/operators/multiple-relays/contents+en.lrquestion.description)
@@ -7489,11 +7497,13 @@ msgid ""
 "or of their network, even if they're not all in the same geographic "
 "location."
 msgstr ""
+"يجب عليك تعيين برنامج \"عائلتي\" إذا كان 
لديك تحكم إداري في أجهزة الكمبيوتر "
+"أو شبكتها ، حتى لو لم تكن جميعها في نفس الم
وقع الجغرافي."
 
 #: 
https//support.torproject.org/operators/my-relay-got-guard-flag-traffic-dropped/
 #: 
(content/operators/my-relay-got-guard-flag-traffic-dropped/contents+en.lrquestion.title)
 msgid "My relay recently got the Guard flag and traffic dropped by half."
-msgstr ""
+msgstr "حصل مرحلتي مؤخرًا على علم الحرس 
وانخفضت حركة المرور بمقدار النصف."
 
 #: 
https//support.torproject.org/operators/my-relay-got-guard-flag-traffic-dropped/
 #: 
(content/operators/my-relay-got-guard-flag-traffic-dropped/contents+en.lrquestion.description)
@@ -7502,6 +7512,8 @@ msgid ""
 "not many clients have rotated their existing guards out to use it as a guard"
 " yet."
 msgstr ""
+"نظرًا لأنه الآن حارس ، يستخدمه العملاء 
بشكل أقل في مواقع أخرى ، ولكن لم يقم "
+"العديد من العملاء بتناوب حراسهم الحاليين 
لاستخدامه كحارس حتى الآن."
 
 #: 
https//support.torproject.org/operators/my-relay-got-guard-flag-traffic-dropped/
 #: 
(content/operators/my-relay-got-guard-flag-traffic-dropped/contents+en.lrquestion.description)
@@ -7511,16 +7523,20 @@ msgid ""
 

[tor-commits] [translation/communitytpo-contentspot] https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot

2020-08-10 Thread translation
commit a0192fed0e066ac2754b6417680f5368eb9d9cfc
Author: Translation commit bot 
Date:   Mon Aug 10 19:15:13 2020 +


https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot
---
 contents+es.po | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/contents+es.po b/contents+es.po
index 3fab3e9c69..c11205545f 100644
--- a/contents+es.po
+++ b/contents+es.po
@@ -7155,12 +7155,14 @@ msgstr ""
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
 msgid "2. What kind of behavior did you see?"
-msgstr ""
+msgstr "2. ¿Qué clase de comportamiento viste?"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
 msgid "3. Any additional information we'll need to reproduce the issue."
 msgstr ""
+"3. Cualquier información adicional que necesitaremos para reproducir el "
+"problema."
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7168,11 +7170,14 @@ msgid ""
 "However, if you need help with anything Tor-related, please contact the "
 "[help desk](https://www.torproject.org/about/contact) instead."
 msgstr ""
+"Sin embargo, si necesitas ayuda con cualquier cosa relacionada con Tor, por "
+"favor contacta en su lugar al [escritorio de "
+"ayuda](https://www.torproject.org/about/contact)."
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
 msgid "### What happens to bad relays?"
-msgstr ""
+msgstr "### ¿Qué pasa con los repetidores maliciosos?"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7182,11 +7187,15 @@ msgid ""
 "relay lacks contact information) we'll flag it to prevent it from continuing"
 " to be used."
 msgstr ""
+"Luego de que un repetidor es reportado y hemos verificado su comportamiento,"
+" intentaremos contactar a su operador. A menudo podemos resolver las cosas, "
+"pero si no (o si al repetidor le falta información de contacto), lo "
+"marcaremos para prevenir que continúe siendo usado."
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
 msgid "We have thee types of flags we can apply:"
-msgstr ""
+msgstr "Tenemos tres tipos de marca que podemos aplicar:"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7194,6 +7203,8 @@ msgid ""
 "* BadExit - Never used as an exit relay (for relays that appear to mess with"
 " exit traffic)"
 msgstr ""
+"* BadExit - Nunca usar como repetidor de salida (para repetidores que "
+"aparentan desordenar al tráfico de salida)"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7201,6 +7212,8 @@ msgid ""
 "* Invalid - Never used unless AllowInvalidNodes is set (by default this only"
 " allows for middle and rendezvous usage)"
 msgstr ""
+"* Invalid - Nunca usar a menos que AllowInvalidNodes esté establecido (por "
+"defecto esto solamente permite el uso como intermediario y encuentro)"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [torspec/master] Merge remote-tracking branch 'tor-github/pr/128'

2020-08-10 Thread nickm
commit b4923cac4fee89968afc4c5863405f94470f25cc
Merge: a906568 3bf4733
Author: Nick Mathewson 
Date:   Mon Aug 10 14:52:48 2020 -0400

Merge remote-tracking branch 'tor-github/pr/128'

 control-spec.txt | 5 +
 1 file changed, 5 insertions(+)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [torspec/master] Add "GETINFO address/v(4/6)"

2020-08-10 Thread nickm
commit 3bf47334f39c366235c0451f31df3ad2978edc4f
Author: Neel Chauhan 
Date:   Tue Aug 4 14:03:06 2020 -0700

Add "GETINFO address/v(4/6)"
---
 control-spec.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/control-spec.txt b/control-spec.txt
index fb35d94..e338d79 100644
--- a/control-spec.txt
+++ b/control-spec.txt
@@ -696,6 +696,11 @@
 "address" -- the best guess at our external IP address. If we
   have no guess, return a 551 error. (Added in 0.1.2.2-alpha)
 
+"address/v4"
+"address/v6"
+  the best guess at our respective external IPv4 or IPv6 address.
+  If we have no guess, return a 551 error. (Added in 0.4.5.1-alpha)
+
 "fingerprint" -- the contents of the fingerprint file that Tor
   writes as a relay, or a 551 if we're not a relay currently.
   (Added in 0.1.2.3-alpha)



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge remote-tracking branch 'tor-gitlab/mr/110'

2020-08-10 Thread nickm
commit 3eb9331133a0606e86114bb613f03c674050932d
Merge: 67fc69c8c1 d1413e04f8
Author: Nick Mathewson 
Date:   Mon Aug 10 14:51:12 2020 -0400

Merge remote-tracking branch 'tor-gitlab/mr/110'

 changes/ticket40039   |  5 +
 src/feature/control/control_getinfo.c | 15 ++-
 2 files changed, 19 insertions(+), 1 deletion(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] ipv6: Specialize GETINFO address interface for v4 and v6

2020-08-10 Thread nickm
commit d1413e04f89213b7eb0ee844491148e7cf7ca45b
Author: Neel Chauhan 
Date:   Tue Aug 4 13:59:49 2020 -0700

ipv6: Specialize GETINFO address interface for v4 and v6
---
 changes/ticket40039   |  5 +
 src/feature/control/control_getinfo.c | 15 ++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/changes/ticket40039 b/changes/ticket40039
new file mode 100644
index 00..41b34c6407
--- /dev/null
+++ b/changes/ticket40039
@@ -0,0 +1,5 @@
+  o Minor features (control port, relay):
+- Introduce "GETINFO address/v4" and "GETINFO address/v6" in the control
+  port to fetch the Tor host's respective IPv4 or IPv6 address. We keep
+  "GETINFO address" for backwords-compatibility which retains the current
+  behavior. Closes ticket 40039. Patch by Neel Chauhan.
diff --git a/src/feature/control/control_getinfo.c 
b/src/feature/control/control_getinfo.c
index 3e4feadded..461b8eeb94 100644
--- a/src/feature/control/control_getinfo.c
+++ b/src/feature/control/control_getinfo.c
@@ -131,7 +131,7 @@ getinfo_helper_misc(control_connection_t *conn, const char 
*question,
 smartlist_free(signal_names);
   } else if (!strcmp(question, "features/names")) {
 *answer = tor_strdup("VERBOSE_NAMES EXTENDED_EVENTS");
-  } else if (!strcmp(question, "address")) {
+  } else if (!strcmp(question, "address") || !strcmp(question, "address/v4")) {
 tor_addr_t addr;
 if (!relay_find_addr_to_publish(get_options(), AF_INET,
 RELAY_FIND_ADDR_CACHE_ONLY, )) {
@@ -140,6 +140,15 @@ getinfo_helper_misc(control_connection_t *conn, const char 
*question,
 }
 *answer = tor_addr_to_str_dup();
 tor_assert_nonfatal(*answer);
+  } else if (!strcmp(question, "address/v6")) {
+tor_addr_t addr;
+if (!relay_find_addr_to_publish(get_options(), AF_INET6,
+RELAY_FIND_ADDR_CACHE_ONLY, )) {
+  *errmsg = "Address unknown";
+  return -1;
+}
+*answer = tor_addr_to_str_dup();
+tor_assert_nonfatal(*answer);
   } else if (!strcmp(question, "traffic/read")) {
 tor_asprintf(answer, "%"PRIu64, (get_bytes_read()));
   } else if (!strcmp(question, "traffic/written")) {
@@ -1663,6 +1672,10 @@ static const getinfo_item_t getinfo_items[] = {
   DOC("status/version/recommended", "List of currently recommended versions."),
   DOC("status/version/current", "Status of the current version."),
   ITEM("address", misc, "IP address of this Tor host, if we can guess it."),
+  ITEM("address/v4", misc,
+   "IPv4 address of this Tor host, if we can guess it."),
+  ITEM("address/v6", misc,
+   "IPv6 address of this Tor host, if we can guess it."),
   ITEM("traffic/read", misc,"Bytes read since the process was started."),
   ITEM("traffic/written", misc,
"Bytes written since the process was started."),



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/support-portal] https://gitweb.torproject.org/translation.git/commit/?h=support-portal

2020-08-10 Thread translation
commit 09d708da9eb69263880a291d086d0f58dc2c0b4d
Author: Translation commit bot 
Date:   Mon Aug 10 18:48:00 2020 +

https://gitweb.torproject.org/translation.git/commit/?h=support-portal
---
 contents+ar.po | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/contents+ar.po b/contents+ar.po
index ba95b67e26..2a2ab2894a 100644
--- a/contents+ar.po
+++ b/contents+ar.po
@@ -7403,6 +7403,9 @@ msgid ""
 " to spread your usefulness over more of the day: if you want to offer X GB "
 "in each direction, you could set your RelayBandwidthRate to 20*X KBytes."
 msgstr ""
+"ما عليك سوى قسمة المبلغ الشهري على 30. يمكنك 
أيضًا التفكير في تحديد السعر "
+"لتوزيع فائدتك على مدار اليوم: إذا كنت ترغب 
في عرض X جيجابايت في كل اتجاه ، "
+"فيمكنك تعيين معدل عرض النطاق الترددي 
التتابع إلى 20 * X كيلو بايت."
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
@@ -7411,22 +7414,27 @@ msgid ""
 "RelayBandwidthRate to 1000 KBytes: this way your relay will always be useful"
 " for at least half of each day."
 msgstr ""
+"على سبيل المثال ، إذا كان لديك 50 غيغابايت 
للعرض في كل اتجاه ، فيمكنك تعيين "
+"معدل عرض النطاق الترددي التتابع إلى 1000 
كيلوبايت: بهذه الطريقة سيكون "
+"الترحيل مفيدًا دائمًا على الأقل نصف كل يوم
."
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
 msgid "AccountingStart day 0:00"
-msgstr ""
+msgstr "يوم بدء المحاسبة 0:00"
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
 msgid "RelayBandwidthRate 1000 KBytes"
-msgstr ""
+msgstr "معدل نقل البيانات للترحيل 1000 كيلو بايت"
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
 msgid ""
 "RelayBandwidthBurst 5000 KBytes # allow higher bursts but maintain average"
 msgstr ""
+"تسمح تقنية انفجر عرض النطاق الترددي 
التتابع 5000 كيلو بايت # بدفعات أعلى "
+"ولكنها تحافظ على المتوسط"
 
 #: https//support.torproject.org/operators/multiple-relays/
 #: (content/operators/multiple-relays/contents+en.lrquestion.title)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/support-portal] https://gitweb.torproject.org/translation.git/commit/?h=support-portal

2020-08-10 Thread translation
commit 5db1eb1d3d01d59a836d20daa952cfbbc9d60c2e
Author: Translation commit bot 
Date:   Mon Aug 10 18:17:58 2020 +

https://gitweb.torproject.org/translation.git/commit/?h=support-portal
---
 contents+ar.po | 28 ++--
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/contents+ar.po b/contents+ar.po
index 0b0e76b8bc..ba95b67e26 100644
--- a/contents+ar.po
+++ b/contents+ar.po
@@ -7299,7 +7299,7 @@ msgstr ""
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
 msgid "AccountingStart day week month [day] HH:MM"
-msgstr ""
+msgstr "بدء المحاسبة يوم الأسبوع الشهر [اليوم] 
HH: MM"
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
@@ -7308,16 +7308,19 @@ msgid ""
 "total amount of bytes served for a week (that resets every Wednesday at "
 "10:00am), you would use:"
 msgstr ""
+"هذا يحدد متى يجب إعادة تعيين المحاسبة. على 
سبيل المثال ، لإعداد إجمالي عدد "
+"البايتات التي يتم تقديمها لمدة أسبوع (يتم 
إعادة التعيين كل يوم أربعاء الساعة"
+" 10:00 صباحًا) ، يمكنك استخدام:"
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
 msgid "AccountingStart week 3 10:00"
-msgstr ""
+msgstr "بدء المحاسبة أسبوع 3 10:00"
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
 msgid "AccountingMax 500 GBytes"
-msgstr ""
+msgstr "محاسبة: بحد أقصى 500 جيجا بايت"
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
@@ -7326,6 +7329,8 @@ msgid ""
 "accounting period, and the maximum amount of data your relay will receive "
 "during an account period."
 msgstr ""
+"يحدد هذا الحد الأقصى لمقدار البيانات التي 
سيرسلها مرحلك خلال فترة محاسبية ، "
+"والحد الأقصى لمقدار البيانات التي 
سيتلقاها الترحيل خلال فترة الحساب."
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
@@ -7333,6 +7338,8 @@ msgid ""
 "When the accounting period resets (from AccountingStart), then the counters "
 "for AccountingMax are reset to 0."
 msgstr ""
+"عندما يتم إعادة تعيين فترة المحاسبة (من 
بدء المحاسبة) ، ثم يتم إعادة تعيين "
+"عدادات ماكس المحاسبة إلى 0."
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
@@ -7340,23 +7347,25 @@ msgid ""
 "Example: Let's say you want to allow 50 GB of traffic every day in each "
 "direction and the accounting should reset at noon each day:"
 msgstr ""
+"مثال: لنفترض أنك تريد السماح بحركة مرور 
تبلغ 50 غيغابايت يوميًا في كل اتجاه "
+"، ويجب إعادة ضبط المحاسبة ظهرًا كل يوم:"
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
 msgid "AccountingStart day 12:00"
-msgstr ""
+msgstr "يوم بدء المحاسبة 12:00"
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
 msgid "AccountingMax 50 GBytes"
-msgstr ""
+msgstr "محاسبة: بحد أقصى 50 جيجا بايت"
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
 msgid ""
 "Note that your relay won't wake up exactly at the beginning of each "
 "accounting period."
-msgstr ""
+msgstr "لاحظ أن المرحل الخاص بك لن يستيقظ 
بالضبط في بداية كل فترة محاسبية."
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
@@ -7364,6 +7373,8 @@ msgid ""
 "It will keep track of how quickly it used its quota in the last period, and "
 "choose a random point in the new interval to wake up."
 msgstr ""
+"سوف يتتبع مدى سرعة استخدام حصته في الفترة 
الأخيرة ، ويختار نقطة عشوائية في "
+"الفاصل الزمني الجديد للاستيقاظ."
 
 #: 

[tor-commits] [translation/support-portal] https://gitweb.torproject.org/translation.git/commit/?h=support-portal

2020-08-10 Thread translation
commit 5870689e7739bc5cd6c914f3604ea855e979da97
Author: Translation commit bot 
Date:   Mon Aug 10 17:48:12 2020 +

https://gitweb.torproject.org/translation.git/commit/?h=support-portal
---
 contents+ar.po | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/contents+ar.po b/contents+ar.po
index 7ead74be03..0b0e76b8bc 100644
--- a/contents+ar.po
+++ b/contents+ar.po
@@ -7277,11 +7277,15 @@ msgid ""
 "For the time being Tor will require IPv4 addresses on relays, you can not "
 "run a Tor relay on a host with IPv6 addresses only."
 msgstr ""
+"في الوقت الحالي ، سيطلب Tor عناوين IPv4 على الم
رحلات ، لا يمكنك تشغيل مرحل "
+"Tor على مضيف له عناوين IPv6 فقط."
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.title)
 msgid "How can I limit the total amount of bandwidth used by my Tor relay?"
 msgstr ""
+"كيف يمكنني تحديد المقدار الإجمالي للنطاق 
الترددي المستخدم بواسطة مرحل Tor "
+"الخاص بي؟"
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)
@@ -7289,6 +7293,8 @@ msgid ""
 "The accounting options in the torrc file allow you to specify the maximum "
 "amount of bytes your relay uses for a time period."
 msgstr ""
+"تتيح لك خيارات المحاسبة في ملف torrc تحديد 
الحد الأقصى من وحدات البايت التي "
+"يستخدمها الترحيل لفترة زمنية."
 
 #: https//support.torproject.org/operators/limit-total-bandwidth/
 #: (content/operators/limit-total-bandwidth/contents+en.lrquestion.description)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor-browser-build/master] Bug 40037: Move projects over to clang-source

2020-08-10 Thread sysrqb
commit 99c1bd0186171c06fc5f07136e9efbd9192fb35a
Author: Georg Koppen 
Date:   Sun Aug 9 10:40:38 2020 +

Bug 40037: Move projects over to clang-source
---
 projects/{clang => clang-source}/43909.patch |   0
 projects/clang-source/build  |  27 ++-
 projects/clang/build |  18 +-
 projects/clang/config|  23 +--
 projects/fenix-clang/build   |  18 +-
 projects/fenix-clang/config  |  23 +--
 projects/macosx-toolchain/43909.patch| 252 ---
 projects/macosx-toolchain/build  |  30 +---
 projects/macosx-toolchain/config |  25 +--
 projects/mingw-w64-clang/build   |  39 ++---
 projects/mingw-w64-clang/config  |  17 +-
 11 files changed, 48 insertions(+), 424 deletions(-)

diff --git a/projects/clang/43909.patch b/projects/clang-source/43909.patch
similarity index 100%
rename from projects/clang/43909.patch
rename to projects/clang-source/43909.patch
diff --git a/projects/clang-source/build b/projects/clang-source/build
index 5aebfb1..860b8e4 100644
--- a/projects/clang-source/build
+++ b/projects/clang-source/build
@@ -1,9 +1,5 @@
 #!/bin/bash
 [% c("var/set_default_env") -%]
-distdir=/var/tmp/dist/[% project %]
-mkdir -p /var/tmp/dist
-mkdir -p /var/tmp/build
-cd /var/tmp/build
 tar -xf $rootdir/[% c('input_files_by_name/llvm') %]
 tar -xf $rootdir/[% c('input_files_by_name/clang') %]
 tar -xf $rootdir/[% c('input_files_by_name/clang-tools-extra') %]
@@ -12,24 +8,23 @@ tar -xf $rootdir/[% c('input_files_by_name/libcxxabi') %]
 tar -xf $rootdir/[% c('input_files_by_name/lld') %]
 tar -xf $rootdir/[% c('input_files_by_name/compiler-rt') %]
 tar -xf $rootdir/[% c('input_files_by_name/libunwind') %]
-mv llvm-* llvm
+
+mv llvm-[% c("version") %].src llvm
 # LLVM has reproducibility issues when optimizing bitcode, which we need to
 # patch. See: #32053 for more details.
 patch -p1 < $rootdir/43909.patch
-mv clang-* llvm/tools/clang
-extra_dir=llvm/tools/clang/tools/extra
-mkdir $extra_dir
-mv clang-tools-extra-* $extra_dir
-mv libcxx-* llvm/projects/libcxx
-mv libcxxabi-* llvm/projects/libcxxabi
-mv lld-* llvm/tools/lld
-mv compiler-rt-* llvm/projects/compiler-rt
+mv clang-[% c("version") %].src llvm/tools/clang
+# Having clang-tidy available seems like a good idea
+mv clang-tools-extra-[% c("version") %].src llvm/tools/clang/tools/extra
+mv libcxx-[% c("version") %].src llvm/projects/libcxx
+mv libcxxabi-[% c("version") %].src llvm/projects/libcxxabi
+mv lld-[% c("version") %].src llvm/tools/lld
+mv compiler-rt-[% c("version") %].src llvm/projects/compiler-rt
 # We need libunwind only for mingw-w64-clang, don't include it as tightly by
 # putting it into projects/
-mv libunwind-* llvm/libunwind
-mv llvm $distdir
+mv libunwind-[% c("version") %].src llvm/libunwind
+mv llvm [% project %]
 
-cd /var/tmp/dist
 [% c('tar', {
 tar_src => [ project ],
 tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
diff --git a/projects/clang/build b/projects/clang/build
index d61ed43..33688e5 100644
--- a/projects/clang/build
+++ b/projects/clang/build
@@ -15,22 +15,8 @@ export PATH="/var/tmp/dist/cmake/bin:$PATH"
 [% END -%]
 mkdir -p /var/tmp/build
 cd /var/tmp/build
-tar -xf $rootdir/[% c('input_files_by_name/llvm') %]
-tar -xf $rootdir/[% c('input_files_by_name/clang') %]
-tar -xf $rootdir/[% c('input_files_by_name/libcxx') %]
-tar -xf $rootdir/[% c('input_files_by_name/libcxxabi') %]
-tar -xf $rootdir/[% c('input_files_by_name/lld') %]
-tar -xf $rootdir/[% c('input_files_by_name/compiler-rt') %]
-mv llvm-* llvm
-# LLVM has reproducibility issues when optimizing bitcode, which we need to
-# patch. See: #32053 for more details.
-patch -p1 < $rootdir/43909.patch
-mv clang-* llvm/tools/clang
-mv libcxx-* llvm/projects/libcxx
-mv libcxxabi-* llvm/projects/libcxxabi
-mv lld-* llvm/tools/lld
-mv compiler-rt-* llvm/projects/compiler-rt
-cd llvm
+tar -xf $rootdir/[% c('input_files_by_name/clang-source') %]
+cd clang-source
 export LLVM_HOME=$(pwd)
 mkdir build
 cd build
diff --git a/projects/clang/config b/projects/clang/config
index c4b7efc..46d308a 100644
--- a/projects/clang/config
+++ b/projects/clang/config
@@ -1,8 +1,6 @@
 # vim: filetype=yaml sw=2
 version: 9.0.1
 filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
-gpg_keyring: clang.gpg
-sig_ext: sig
 
 var:
   container:
@@ -18,22 +16,5 @@ input_files:
 enable: '[% c("var/linux") %]'
   - project: cmake
 name: cmake
-  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/llvm-[% c("version") %].src.tar.xz'
-name: llvm
-file_gpg_id: 1
-  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/clang-[% c("version") %].src.tar.xz'
-name: clang
-file_gpg_id: 1
-  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/libcxx-[% 

[tor-commits] [translation/support-portal] https://gitweb.torproject.org/translation.git/commit/?h=support-portal

2020-08-10 Thread translation
commit 1c6cc315d2024cd93f204f495ddd3cc4649d6aff
Author: Translation commit bot 
Date:   Mon Aug 10 17:18:14 2020 +

https://gitweb.torproject.org/translation.git/commit/?h=support-portal
---
 contents+ar.po | 35 ---
 1 file changed, 28 insertions(+), 7 deletions(-)

diff --git a/contents+ar.po b/contents+ar.po
index c9dc4df0db..7ead74be03 100644
--- a/contents+ar.po
+++ b/contents+ar.po
@@ -7156,6 +7156,10 @@ msgid ""
 
"[BandwidthRate](https://2019.www.torproject.org/docs/faq.html.en#BandwidthShaping)"
 " apply to both client and relay functions of the Tor process."
 msgstr ""
+"المعلمات المعينة في [محاسبة ماكس] "
+"(https://2019.www.torproject.org/docs/faq.html.en#LimitTotalBandwidth) و "
+"[معدل نقل البيانات] (https://2019.www.torproject.org/docs/ 
faq.html.en # "
+"BandwidthShaping) على كل من وظائف العميل والترحيل 
في عملية Tor."
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
@@ -7163,6 +7167,8 @@ msgid ""
 "Thus you may find that you are unable to browse as soon as your Tor goes "
 "into hibernation, signaled by this entry in the log:"
 msgstr ""
+"وبالتالي قد تجد أنك غير قادر على التصفح بم
جرد دخول إصبع قدمك في وضع السبات ،"
+" الذي يشير إليه هذا الإدخال في السجل:"
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
@@ -7177,17 +7183,17 @@ msgstr ""
 #: https//support.torproject.org/apt/apt-over-tor/
 #: (content/apt/apt-3/contents+en.lrquestion.description)
 msgid "```"
-msgstr ""
+msgstr "```"
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
 msgid "Bandwidth soft limit reached; commencing hibernation."
-msgstr ""
+msgstr "تم الوصول إلى حد ضعيف لعرض النطاق 
الترددي ;  بدء السبات."
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
 msgid "No new connections will be accepted"
-msgstr ""
+msgstr "لن يتم قبول أي اتصالات جديدة"
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
@@ -7195,18 +7201,20 @@ msgid ""
 "The solution is to run two Tor processes - one relay and one client, each "
 "with its own config."
 msgstr ""
+"الحل هو تشغيل عمليتين من أجل - مرحل واحد وعم
يل واحد ، لكل منهما التكوين "
+"الخاص به."
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
 msgid ""
 "One way to do this (if you are starting from a working relay setup) is as "
 "follows:"
-msgstr ""
+msgstr "إحدى طرق القيام بذلك (إذا كنت تبدأ من 
إعداد ترحيل عمل) هي كما يلي:"
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
 msgid "* In the relay Tor torrc file, simply set the SocksPort to 0."
-msgstr ""
+msgstr "* في ملف الترحيل Tor torrc ، ما عليك سوى 
تعيين SocksPort على 0."
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
@@ -7214,11 +7222,13 @@ msgid ""
 "* Create a new client torrc file from the torrc.sample and ensure it uses a "
 "different log file from the relay."
 msgstr ""
+"* قم بإنشاء ملف torrc جديد للعميل من torrc.sample 
وتأكد من أنه يستخدم ملف "
+"سجل مختلف عن الترحيل."
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
 msgid "One naming convention may be torrc.client and torrc.relay."
-msgstr ""
+msgstr "قد يكون أحد اصطلاحات التسمية هو torrc.client 
و torrc.relay."
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
@@ -7226,6 +7236,8 @@ msgid ""
 "* Modify the Tor client and relay startup scripts to include `-f "
 "/path/to/correct/torrc`."
 msgstr ""
+"* قم بتعديل عميل Tor وترحيل البرامج النصية 
لبدء التشغيل لتشمل \"-f / path / "
+"to / correct / torrc\"."
 
 #: https//support.torproject.org/operators/hibernation/
 #: (content/operators/hibernation/contents+en.lrquestion.description)
@@ -7233,11 +7245,14 @@ msgid ""
 "* In Linux/BSD/Mac OS X, changing the startup scripts to `Tor.client` and "
 "`Tor.relay` may make separation of configs easier."
 msgstr ""
+"* في لينكس / بي اس دي 

[tor-commits] [tor-browser-build/master] Bug 40037: Add clang-source project

2020-08-10 Thread sysrqb
commit 56eed81fdbfb786dc2248347d899cbbfd1c591b2
Author: Georg Koppen 
Date:   Sun Aug 9 10:32:26 2020 +

Bug 40037: Add clang-source project
---
 projects/clang-source/build  | 36 
 projects/clang-source/config | 32 
 2 files changed, 68 insertions(+)

diff --git a/projects/clang-source/build b/projects/clang-source/build
new file mode 100644
index 000..5aebfb1
--- /dev/null
+++ b/projects/clang-source/build
@@ -0,0 +1,36 @@
+#!/bin/bash
+[% c("var/set_default_env") -%]
+distdir=/var/tmp/dist/[% project %]
+mkdir -p /var/tmp/dist
+mkdir -p /var/tmp/build
+cd /var/tmp/build
+tar -xf $rootdir/[% c('input_files_by_name/llvm') %]
+tar -xf $rootdir/[% c('input_files_by_name/clang') %]
+tar -xf $rootdir/[% c('input_files_by_name/clang-tools-extra') %]
+tar -xf $rootdir/[% c('input_files_by_name/libcxx') %]
+tar -xf $rootdir/[% c('input_files_by_name/libcxxabi') %]
+tar -xf $rootdir/[% c('input_files_by_name/lld') %]
+tar -xf $rootdir/[% c('input_files_by_name/compiler-rt') %]
+tar -xf $rootdir/[% c('input_files_by_name/libunwind') %]
+mv llvm-* llvm
+# LLVM has reproducibility issues when optimizing bitcode, which we need to
+# patch. See: #32053 for more details.
+patch -p1 < $rootdir/43909.patch
+mv clang-* llvm/tools/clang
+extra_dir=llvm/tools/clang/tools/extra
+mkdir $extra_dir
+mv clang-tools-extra-* $extra_dir
+mv libcxx-* llvm/projects/libcxx
+mv libcxxabi-* llvm/projects/libcxxabi
+mv lld-* llvm/tools/lld
+mv compiler-rt-* llvm/projects/compiler-rt
+# We need libunwind only for mingw-w64-clang, don't include it as tightly by
+# putting it into projects/
+mv libunwind-* llvm/libunwind
+mv llvm $distdir
+
+cd /var/tmp/dist
+[% c('tar', {
+tar_src => [ project ],
+tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
+}) %]
diff --git a/projects/clang-source/config b/projects/clang-source/config
new file mode 100644
index 000..d0ae90c
--- /dev/null
+++ b/projects/clang-source/config
@@ -0,0 +1,32 @@
+# vim: filetype=yaml sw=2
+version: 9.0.1
+filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
+gpg_keyring: clang.gpg
+sig_ext: sig
+
+input_files:
+  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/llvm-[% c("version") %].src.tar.xz'
+name: llvm
+file_gpg_id: 1
+  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/clang-[% c("version") %].src.tar.xz'
+name: clang
+file_gpg_id: 1
+  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/clang-tools-extra-[% c("version") %].src.tar.xz'
+name: clang-tools-extra
+file_gpg_id: 1
+  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/libcxx-[% c("version") %].src.tar.xz'
+name: libcxx
+file_gpg_id: 1
+  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/libcxxabi-[% c("version") %].src.tar.xz'
+name: libcxxabi
+file_gpg_id: 1
+  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/lld-[% c("version") %].src.tar.xz'
+name: lld
+file_gpg_id: 1
+  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/compiler-rt-[% c("version") %].src.tar.xz'
+name: compiler-rt
+file_gpg_id: 1
+  - URL: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-[% 
c("version") %]/libunwind-[% c("version") %].src.tar.xz'
+name: libunwind
+file_gpg_id: 1
+  - filename: 43909.patch



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor-browser-build/master] Merge remote-tracking branch 'gkgl/bug_40037_v2'

2020-08-10 Thread sysrqb
commit 0de43304b95255095b66a93fe326f82f818dca6a
Merge: 01cb89f 99c1bd0
Author: Matthew Finkel 
Date:   Mon Aug 10 17:17:27 2020 +

Merge remote-tracking branch 'gkgl/bug_40037_v2'

 projects/{clang => clang-source}/43909.patch |   0
 projects/clang-source/build  |  31 
 projects/clang-source/config |  32 
 projects/clang/build |  18 +-
 projects/clang/config|  23 +--
 projects/fenix-clang/build   |  18 +-
 projects/fenix-clang/config  |  23 +--
 projects/macosx-toolchain/43909.patch| 252 ---
 projects/macosx-toolchain/build  |  30 +---
 projects/macosx-toolchain/config |  25 +--
 projects/mingw-w64-clang/build   |  39 ++---
 projects/mingw-w64-clang/config  |  17 +-
 12 files changed, 100 insertions(+), 408 deletions(-)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/communitytpo-contentspot] https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot

2020-08-10 Thread translation
commit f905c7c75be8a9f50468b6715330e1d1720b83de
Author: Translation commit bot 
Date:   Mon Aug 10 17:15:16 2020 +


https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot
---
 contents+ar.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contents+ar.po b/contents+ar.po
index b4e6bd5e42..2dbd415de9 100644
--- a/contents+ar.po
+++ b/contents+ar.po
@@ -3682,7 +3682,7 @@ msgstr ""
 #: https//community.torproject.org/relay/setup/guard/freebsd/updates/
 #: 
(content/relay-operations/technical-setup/guard/freebsd/updates/contents+en.lrpage.body)
 msgid "```"
-msgstr ""
+msgstr "```"
 
 #: https//community.torproject.org/relay/setup/post-install/
 #: 
(content/relay-operations/technical-setup/post-install/contents+en.lrpage.body)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Add dynamic note change

2020-08-10 Thread cohosh
commit 0fbd7b417c32b597e3b6126990adcca610d69a4b
Author: Hashik Donthineni 
Date:   Fri Aug 7 01:49:59 2020 +0530

Add dynamic note change
---
 .../main/java/org/torproject/snowflake/fragments/MainFragment.java  | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index fdd2afb..d24c891 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -29,6 +29,7 @@ public class MainFragment extends Fragment {
 private static final String TAG = "MainFragment";
 MainFragmentCallback callback;
 TextView usersServedTV;
+TextView noteTV;
 ImageView snowflakeLogo;
 Switch startButton;
 
@@ -59,6 +60,7 @@ public class MainFragment extends Fragment {
 Log.d(TAG, "onCreateView: ");
 View rootView = inflater.inflate(R.layout.fragment_main, container, 
false);
 usersServedTV = rootView.findViewById(R.id.users_served);
+noteTV = rootView.findViewById(R.id.note_tv);
 startButton = rootView.findViewById(R.id.snowflake_switch);
 snowflakeLogo = rootView.findViewById(R.id.snowflake_logo);
 
@@ -110,13 +112,15 @@ public class MainFragment extends Fragment {
 from = this.getResources().getColor(R.color.snowflakeOff);
 to = this.getResources().getColor(R.color.snowflakeOn);
 startButton.setText(getString(R.string.Snowflake_On));
+noteTV.setText(getString(R.string.snowflake_ready_note));
 } else { //off
 from = this.getResources().getColor(R.color.snowflakeOn);
 to = this.getResources().getColor(R.color.snowflakeOff);
 startButton.setText(getString(R.string.Snowflake_Off));
+noteTV.setText(getString(R.string.turn_on_note));
 }
 
-//Animating the transition
+//Animating the transition of logo
 ValueAnimator colorAnimation = ValueAnimator.ofObject(new 
ArgbEvaluator(), from, to);
 colorAnimation.setDuration(300); // milliseconds
 colorAnimation.addUpdateListener(animator -> 
snowflakeLogo.setColorFilter((int) animator.getAnimatedValue(), 
PorterDuff.Mode.SRC_ATOP));



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Add animations to note TextView

2020-08-10 Thread cohosh
commit 0d118d557e171f96a09d139f3450497a4f672d75
Author: Hashik Donthineni 
Date:   Fri Aug 7 01:58:07 2020 +0530

Add animations to note TextView
---
 .../java/org/torproject/snowflake/fragments/MainFragment.java| 6 ++
 app/src/main/res/anim/fade.xml   | 9 +
 2 files changed, 15 insertions(+)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index d24c891..efcddc1 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -9,6 +9,8 @@ import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
 import android.widget.ImageView;
 import android.widget.Switch;
 import android.widget.TextView;
@@ -30,6 +32,7 @@ public class MainFragment extends Fragment {
 MainFragmentCallback callback;
 TextView usersServedTV;
 TextView noteTV;
+Animation textViewFade;
 ImageView snowflakeLogo;
 Switch startButton;
 
@@ -63,6 +66,7 @@ public class MainFragment extends Fragment {
 noteTV = rootView.findViewById(R.id.note_tv);
 startButton = rootView.findViewById(R.id.snowflake_switch);
 snowflakeLogo = rootView.findViewById(R.id.snowflake_logo);
+textViewFade = AnimationUtils.loadAnimation(getActivity(), 
R.anim.fade);
 
 //If the service is running, set the button to on
 if (callback.isServiceRunning()) {
@@ -108,6 +112,8 @@ public class MainFragment extends Fragment {
  */
 private void setSnowflakeStatus(boolean status) {
 int from, to;
+noteTV.startAnimation(textViewFade);
+
 if (status) { //Status on
 from = this.getResources().getColor(R.color.snowflakeOff);
 to = this.getResources().getColor(R.color.snowflakeOn);
diff --git a/app/src/main/res/anim/fade.xml b/app/src/main/res/anim/fade.xml
new file mode 100644
index 000..611eb62
--- /dev/null
+++ b/app/src/main/res/anim/fade.xml
@@ -0,0 +1,9 @@
+
+http://schemas.android.com/apk/res/android;>
+
+
\ No newline at end of file



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Refactor 'changeLogoColorStatus' to 'setSnowflakeStatus'

2020-08-10 Thread cohosh
commit 77ad8550845925b10d6e325dc7f7a871dea2722a
Author: Hashik Donthineni 
Date:   Fri Aug 7 01:43:23 2020 +0530

Refactor 'changeLogoColorStatus' to 'setSnowflakeStatus'
---
 .../snowflake/fragments/MainFragment.java  | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index e2d7505..fdd2afb 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -30,6 +30,7 @@ public class MainFragment extends Fragment {
 MainFragmentCallback callback;
 TextView usersServedTV;
 ImageView snowflakeLogo;
+Switch startButton;
 
 public MainFragment() {
 // Required empty public constructor
@@ -58,24 +59,21 @@ public class MainFragment extends Fragment {
 Log.d(TAG, "onCreateView: ");
 View rootView = inflater.inflate(R.layout.fragment_main, container, 
false);
 usersServedTV = rootView.findViewById(R.id.users_served);
-Switch startButton = rootView.findViewById(R.id.snowflake_switch);
+startButton = rootView.findViewById(R.id.snowflake_switch);
 snowflakeLogo = rootView.findViewById(R.id.snowflake_logo);
 
 //If the service is running, set the button to on
 if (callback.isServiceRunning()) {
-changeLogoColorStatus(true);
+setSnowflakeStatus(true);
 startButton.setChecked(true);
-startButton.setText(getString(R.string.Snowflake_On));
 }
 
 startButton.setOnCheckedChangeListener((buttonView, isChecked) -> {
 if (callback.isServiceRunning() && !isChecked) { //Toggling the 
service.
-changeLogoColorStatus(false);
-startButton.setText(getString(R.string.Snowflake_Off));
+setSnowflakeStatus(false);
 callback.serviceToggle(ForegroundServiceConstants.ACTION_STOP);
 } else {
-changeLogoColorStatus(true);
-startButton.setText(getString(R.string.Snowflake_On));
+setSnowflakeStatus(true);
 
callback.serviceToggle(ForegroundServiceConstants.ACTION_START);
 }
 });
@@ -101,16 +99,24 @@ public class MainFragment extends Fragment {
 }
 }
 
-private void changeLogoColorStatus(boolean status) {
+/**
+ * Used to update the UI elements with corresponding status of the 
Snowflake.
+ *
+ * @param status Indicates the status that we want to sent status to.
+ */
+private void setSnowflakeStatus(boolean status) {
 int from, to;
 if (status) { //Status on
 from = this.getResources().getColor(R.color.snowflakeOff);
 to = this.getResources().getColor(R.color.snowflakeOn);
+startButton.setText(getString(R.string.Snowflake_On));
 } else { //off
 from = this.getResources().getColor(R.color.snowflakeOn);
 to = this.getResources().getColor(R.color.snowflakeOff);
+startButton.setText(getString(R.string.Snowflake_Off));
 }
 
+//Animating the transition
 ValueAnimator colorAnimation = ValueAnimator.ofObject(new 
ArgbEvaluator(), from, to);
 colorAnimation.setDuration(300); // milliseconds
 colorAnimation.addUpdateListener(animator -> 
snowflakeLogo.setColorFilter((int) animator.getAnimatedValue(), 
PorterDuff.Mode.SRC_ATOP));



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Re-arranged Views in main fragment

2020-08-10 Thread cohosh
commit 15c7703ad0671a6c0d0bb96fa2c6839c8f622edc
Author: Hashik Donthineni 
Date:   Thu Aug 6 19:29:03 2020 +0530

Re-arranged Views in main fragment
---
 app/src/main/res/layout/fragment_main.xml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/src/main/res/layout/fragment_main.xml 
b/app/src/main/res/layout/fragment_main.xml
index 161ecd0..2c7cc48 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -24,7 +24,8 @@
 android:id="@+id/snowflake_logo"
 android:layout_width="200dp"
 android:layout_height="200dp"
-android:layout_centerInParent="true"
+android:layout_centerHorizontal="true"
+android:layout_marginTop="150dp"
 android:src="@drawable/ic_status_on" />
 
 https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Changed Accent color

2020-08-10 Thread cohosh
commit 3c7416971c64674e1d4d83f472ee7c934acb48d4
Author: Hashik Donthineni 
Date:   Thu Aug 6 21:03:31 2020 +0530

Changed Accent color
---
 app/src/main/res/values/colors.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/src/main/res/values/colors.xml 
b/app/src/main/res/values/colors.xml
index 309f559..9837b71 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -2,7 +2,7 @@
 
 #1C1C1C
 #1C1C1C
-#CC80FF
+#8000D7
 #
 #757575
 #AA



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Increase text-size on Snowflake switch

2020-08-10 Thread cohosh
commit a21d91232fa95b57aa10609c586b2f6a5d12f00c
Author: Hashik Donthineni 
Date:   Fri Aug 7 02:05:45 2020 +0530

Increase text-size on Snowflake switch
---
 app/src/main/res/layout/fragment_main.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/src/main/res/layout/fragment_main.xml 
b/app/src/main/res/layout/fragment_main.xml
index e465db7..837912d 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -22,7 +22,7 @@
 android:text="@string/Snowflake_Off"
 android:textAlignment="textStart"
 android:textColor="@color/colorText"
-android:textSize="20sp" />
+android:textSize="22sp" />
 
 https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Add Snowflake logo to layout

2020-08-10 Thread cohosh
commit d7df7f3cc57fb991a94433ddc1321375c960103c
Author: Hashik Donthineni 
Date:   Thu Aug 6 18:51:19 2020 +0530

Add Snowflake logo to layout
---
 app/src/main/res/layout/fragment_main.xml | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/src/main/res/layout/fragment_main.xml 
b/app/src/main/res/layout/fragment_main.xml
index abcbe12..ffae082 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -9,7 +9,7 @@
 android:id="@+id/start_button"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
-android:layout_centerInParent="true"
+android:layout_alignParentStart="true"
 android:layout_marginStart="20dp"
 android:layout_marginTop="20dp"
 android:layout_marginEnd="20dp"
@@ -20,6 +20,12 @@
 android:textColor="@color/colorText"
 android:textSize="20sp" />
 
+
+
 https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Changed Snowflake Button to Switch

2020-08-10 Thread cohosh
commit aaea63a1e19fdc3b744215eaebd888cab6e3c21c
Author: Hashik Donthineni 
Date:   Wed Aug 5 15:38:12 2020 +0530

Changed Snowflake Button to Switch
---
 .../org/torproject/snowflake/fragments/MainFragment.java   | 14 --
 app/src/main/res/layout/fragment_main.xml  | 11 +++
 app/src/main/res/values/strings.xml|  2 ++
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index 7638b1c..45ce672 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -6,7 +6,7 @@ import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.Button;
+import android.widget.Switch;
 import android.widget.TextView;
 
 import androidx.annotation.NonNull;
@@ -52,15 +52,17 @@ public class MainFragment extends Fragment {
  Bundle savedInstanceState) {
 View rootView = inflater.inflate(R.layout.fragment_main, container, 
false);
 usersServedTV = rootView.findViewById(R.id.users_served);
-Button startButton = rootView.findViewById(R.id.start_button);
+Switch startButton = rootView.findViewById(R.id.start_button);
 
-startButton.setOnClickListener(v -> {
-if (callback.isServiceRunning()) //Toggling the service.
+startButton.setOnCheckedChangeListener((buttonView, isChecked) -> {
+if (callback.isServiceRunning() && !isChecked) { //Toggling the 
service.
+startButton.setText(getString(R.string.Snowflake_Off));
 callback.serviceToggle(ForegroundServiceConstants.ACTION_STOP);
-else
+} else {
+startButton.setText(getString(R.string.Snowflake_On));
 
callback.serviceToggle(ForegroundServiceConstants.ACTION_START);
+}
 });
-
 showServed(callback.getServed());
 
 // Inflate the layout for this fragment
diff --git a/app/src/main/res/layout/fragment_main.xml 
b/app/src/main/res/layout/fragment_main.xml
index f6b4c4d..6e59640 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -6,13 +6,16 @@
 tools:context=".fragments.MainFragment">
 
 
-
+android:layout_margin="20dp"
+android:text="@string/Snowflake_Off"
+android:textAlignment="textStart"
+android:textColor="@color/colorText"
+android:textSize="20sp" />
 
 This Channel should not be muted. The 
Android system will consider Snowflake not import and will kill the service if 
it\'s muted.
 Snowflake Service
 Users you have helped circumvent 
censorship in the past day \n
+Snowflake is Off
+Snowflake is On
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Added note TextView

2020-08-10 Thread cohosh
commit 256cf0a2b54110e026548718cd2be95bd4fb5dd9
Author: Hashik Donthineni 
Date:   Fri Aug 7 01:37:45 2020 +0530

Added note TextView
---
 app/src/main/res/layout/fragment_main.xml | 24 +++-
 app/src/main/res/values/strings.xml   |  2 ++
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/app/src/main/res/layout/fragment_main.xml 
b/app/src/main/res/layout/fragment_main.xml
index 0dcaf86..e465db7 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -33,18 +33,32 @@
 android:src="@drawable/ic_status_on"
 android:tint="@color/snowflakeOff" />
 
+
+
 
 
diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index 7faf436..c9dfd5d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -5,4 +5,6 @@
 Number of users your Snowflake has helped 
circumvent censorship in the last 24 hours: $
 Snowflake is Off
 Snowflake is On
+Turn on Snowflake to help users circumvent 
censorship
+Your Snowflake is ready to help users 
circumvent censorship
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Added scrolling to MainFragment

2020-08-10 Thread cohosh
commit cb1e2a72392644c54d474c39c09a746e1c735b14
Author: Hashik Donthineni 
Date:   Fri Aug 7 01:19:59 2020 +0530

Added scrolling to MainFragment
---
 app/src/main/res/layout/fragment_main.xml | 81 ---
 1 file changed, 43 insertions(+), 38 deletions(-)

diff --git a/app/src/main/res/layout/fragment_main.xml 
b/app/src/main/res/layout/fragment_main.xml
index 28c927f..0dcaf86 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -1,47 +1,52 @@
 
-http://schemas.android.com/apk/res/android;
+http://schemas.android.com/apk/res/android;
 xmlns:tools="http://schemas.android.com/tools;
 android:layout_width="match_parent"
-android:layout_height="match_parent"
-tools:context=".fragments.MainFragment">
+android:layout_height="match_parent">
 
-
+tools:context=".fragments.MainFragment">
 
-
+
 
-
+
+
+
 
-
\ No newline at end of file
+
+



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Added font SourceCodePro

2020-08-10 Thread cohosh
commit 8d6706c6e661b054694a49f6acee37d4d2243bff
Author: Hashik Donthineni 
Date:   Wed Aug 5 15:48:13 2020 +0530

Added font SourceCodePro
---
 app/src/main/res/font/source_code_pro.ttf | Bin 0 -> 120548 bytes
 app/src/main/res/layout/fragment_main.xml |   8 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/app/src/main/res/font/source_code_pro.ttf 
b/app/src/main/res/font/source_code_pro.ttf
new file mode 100644
index 000..b2cff92
Binary files /dev/null and b/app/src/main/res/font/source_code_pro.ttf differ
diff --git a/app/src/main/res/layout/fragment_main.xml 
b/app/src/main/res/layout/fragment_main.xml
index 6e59640..abcbe12 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -5,13 +5,16 @@
 android:layout_height="match_parent"
 tools:context=".fragments.MainFragment">
 
-
 https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Renamed start_button to snowflake_switch

2020-08-10 Thread cohosh
commit 3ad64196dbbf186d1c861dcb453fdc058d4b50bc
Author: Hashik Donthineni 
Date:   Thu Aug 6 18:52:23 2020 +0530

Renamed start_button to snowflake_switch
---
 .../main/java/org/torproject/snowflake/fragments/MainFragment.java| 2 +-
 app/src/main/res/layout/fragment_main.xml | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index 45ce672..796debd 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -52,7 +52,7 @@ public class MainFragment extends Fragment {
  Bundle savedInstanceState) {
 View rootView = inflater.inflate(R.layout.fragment_main, container, 
false);
 usersServedTV = rootView.findViewById(R.id.users_served);
-Switch startButton = rootView.findViewById(R.id.start_button);
+Switch startButton = rootView.findViewById(R.id.snowflake_switch);
 
 startButton.setOnCheckedChangeListener((buttonView, isChecked) -> {
 if (callback.isServiceRunning() && !isChecked) { //Toggling the 
service.
diff --git a/app/src/main/res/layout/fragment_main.xml 
b/app/src/main/res/layout/fragment_main.xml
index ffae082..b83ff0c 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -6,7 +6,7 @@
 tools:context=".fragments.MainFragment">
 
 https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Increased margin end and size of settings icon

2020-08-10 Thread cohosh
commit 2920b50455574ae3ec70799a7a28903d393ae00a
Author: Hashik Donthineni 
Date:   Fri Jul 24 13:32:36 2020 +0530

Increased margin end and size of settings icon
---
 app/src/main/res/layout/activity_main.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/src/main/res/layout/activity_main.xml 
b/app/src/main/res/layout/activity_main.xml
index 600e57b..1c4b319 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -31,11 +31,11 @@
 
 
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Chagend ET summary to null when switch is off in preference - on start up

2020-08-10 Thread cohosh
commit 7b25c10d75652b201086694184566d2117055093
Author: Hashik Donthineni 
Date:   Fri Jul 24 14:25:25 2020 +0530

Chagend ET summary to null when switch is off in preference - on start up
---
 .../org/torproject/snowflake/fragments/AppSettingsFragment.java  | 9 ++---
 app/src/main/res/xml/app_settings.xml| 2 --
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/AppSettingsFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/AppSettingsFragment.java
index 528d8b5..0be5e9b 100644
--- 
a/app/src/main/java/org/torproject/snowflake/fragments/AppSettingsFragment.java
+++ 
b/app/src/main/java/org/torproject/snowflake/fragments/AppSettingsFragment.java
@@ -33,13 +33,16 @@ public class AppSettingsFragment extends 
PreferenceFragmentCompat implements Sha
 String editT = settingMap.get(settingSwitch);
 
 boolean isEnabled = sharedPreferences.getBoolean(settingSwitch, 
false);
-if (!isEnabled)
-
findPreference(settingSwitch).setSummary(SettingsConstants.DEFAULT);
-
 Preference editText = findPreference(editT);
 editText.setEnabled(isEnabled);
 editText.setSummary(
 sharedPreferences.getString(editT, 
SettingsConstants.DEFAULT));
+
+if (!isEnabled) {
+
findPreference(settingSwitch).setSummary(SettingsConstants.DEFAULT);
+//Setting the summary of EditText to empty when the switch is 
off.
+editText.setSummary("");
+}
 }
 }
 
diff --git a/app/src/main/res/xml/app_settings.xml 
b/app/src/main/res/xml/app_settings.xml
index d3a110e..ab321ac 100644
--- a/app/src/main/res/xml/app_settings.xml
+++ b/app/src/main/res/xml/app_settings.xml
@@ -14,7 +14,6 @@
 android:key="stun_edit_text"
 android:selectAllOnFocus="true"
 android:singleLine="true"
-android:summary="Using Default"
 android:title="Custom STUN server"
 app:iconSpaceReserved="false" />
 
@@ -27,7 +26,6 @@
 android:key="broker_edit_text"
 android:selectAllOnFocus="true"
 android:singleLine="true"
-android:summary="Using Default"
 android:title="Custom broker URL"
 app:iconSpaceReserved="false" />
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Animated logo color change

2020-08-10 Thread cohosh
commit 73bf1dfb0c48adcdfd4c8d46e8a47d1829bba84d
Author: Hashik Donthineni 
Date:   Thu Aug 6 19:59:07 2020 +0530

Animated logo color change
---
 .../snowflake/fragments/MainFragment.java  | 25 +++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index 4b53939..cc041db 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -1,5 +1,7 @@
 package org.torproject.snowflake.fragments;
 
+import android.animation.ArgbEvaluator;
+import android.animation.ValueAnimator;
 import android.content.Context;
 import android.graphics.PorterDuff;
 import android.os.Bundle;
@@ -28,6 +30,7 @@ public class MainFragment extends Fragment {
 private static final String TAG = "MainFragment";
 MainFragmentCallback callback;
 TextView usersServedTV;
+ImageView snowflakeLogo;
 
 public MainFragment() {
 // Required empty public constructor
@@ -56,15 +59,15 @@ public class MainFragment extends Fragment {
 View rootView = inflater.inflate(R.layout.fragment_main, container, 
false);
 usersServedTV = rootView.findViewById(R.id.users_served);
 Switch startButton = rootView.findViewById(R.id.snowflake_switch);
-ImageView snowflakeLogo = rootView.findViewById(R.id.snowflake_logo);
+snowflakeLogo = rootView.findViewById(R.id.snowflake_logo);
 
 startButton.setOnCheckedChangeListener((buttonView, isChecked) -> {
 if (callback.isServiceRunning() && !isChecked) { //Toggling the 
service.
-
snowflakeLogo.setColorFilter(ContextCompat.getColor(getActivity(), 
R.color.snowflakeOff));
+changeLogoColorStatus(false);
 startButton.setText(getString(R.string.Snowflake_Off));
 callback.serviceToggle(ForegroundServiceConstants.ACTION_STOP);
 } else {
-
snowflakeLogo.setColorFilter(ContextCompat.getColor(getActivity(), 
R.color.snowflakeOn));
+changeLogoColorStatus(true);
 startButton.setText(getString(R.string.Snowflake_On));
 
callback.serviceToggle(ForegroundServiceConstants.ACTION_START);
 }
@@ -90,4 +93,20 @@ public class MainFragment extends Fragment {
 usersServedTV.setText(servedText);
 }
 }
+
+private void changeLogoColorStatus(boolean status) {
+int from, to;
+if (status) { //Status on
+from = this.getResources().getColor(R.color.snowflakeOff);
+to = this.getResources().getColor(R.color.snowflakeOn);
+} else { //off
+from = this.getResources().getColor(R.color.snowflakeOn);
+to = this.getResources().getColor(R.color.snowflakeOff);
+}
+
+ValueAnimator colorAnimation = ValueAnimator.ofObject(new 
ArgbEvaluator(), from, to);
+colorAnimation.setDuration(300); // milliseconds
+colorAnimation.addUpdateListener(animator -> 
snowflakeLogo.setColorFilter((int) animator.getAnimatedValue(), 
PorterDuff.Mode.SRC_IN));
+colorAnimation.start();
+}
 }
\ No newline at end of file



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Fixed switch state bug

2020-08-10 Thread cohosh
commit 86a0425786f2fb512a1776eac5111f8b2dc63235
Author: Hashik Donthineni 
Date:   Thu Aug 6 20:30:36 2020 +0530

Fixed switch state bug
---
 .../java/org/torproject/snowflake/fragments/MainFragment.java | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index cc041db..e2d7505 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -14,7 +14,6 @@ import android.widget.Switch;
 import android.widget.TextView;
 
 import androidx.annotation.NonNull;
-import androidx.core.content.ContextCompat;
 import androidx.fragment.app.Fragment;
 
 import org.torproject.snowflake.R;
@@ -56,11 +55,19 @@ public class MainFragment extends Fragment {
 @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
  Bundle savedInstanceState) {
+Log.d(TAG, "onCreateView: ");
 View rootView = inflater.inflate(R.layout.fragment_main, container, 
false);
 usersServedTV = rootView.findViewById(R.id.users_served);
 Switch startButton = rootView.findViewById(R.id.snowflake_switch);
 snowflakeLogo = rootView.findViewById(R.id.snowflake_logo);
 
+//If the service is running, set the button to on
+if (callback.isServiceRunning()) {
+changeLogoColorStatus(true);
+startButton.setChecked(true);
+startButton.setText(getString(R.string.Snowflake_On));
+}
+
 startButton.setOnCheckedChangeListener((buttonView, isChecked) -> {
 if (callback.isServiceRunning() && !isChecked) { //Toggling the 
service.
 changeLogoColorStatus(false);
@@ -106,7 +113,7 @@ public class MainFragment extends Fragment {
 
 ValueAnimator colorAnimation = ValueAnimator.ofObject(new 
ArgbEvaluator(), from, to);
 colorAnimation.setDuration(300); // milliseconds
-colorAnimation.addUpdateListener(animator -> 
snowflakeLogo.setColorFilter((int) animator.getAnimatedValue(), 
PorterDuff.Mode.SRC_IN));
+colorAnimation.addUpdateListener(animator -> 
snowflakeLogo.setColorFilter((int) animator.getAnimatedValue(), 
PorterDuff.Mode.SRC_ATOP));
 colorAnimation.start();
 }
 }
\ No newline at end of file



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Rebased to master

2020-08-10 Thread cohosh
commit 0baf91a3c3616302542121af4a848d4cd52eabf5
Author: Hashik Donthineni 
Date:   Wed Aug 5 15:05:32 2020 +0530

Rebased to master
---
 app/src/main/java/org/torproject/snowflake/MainActivity.java | 2 --
 1 file changed, 2 deletions(-)

diff --git a/app/src/main/java/org/torproject/snowflake/MainActivity.java 
b/app/src/main/java/org/torproject/snowflake/MainActivity.java
index 1d2cdf6..64cfb8b 100644
--- a/app/src/main/java/org/torproject/snowflake/MainActivity.java
+++ b/app/src/main/java/org/torproject/snowflake/MainActivity.java
@@ -37,8 +37,6 @@ public class MainActivity extends AppCompatActivity 
implements MainFragmentCallb
 //Indicates if model finished checking the date and reset served count if 
need be.
 boolean isCheckDateFinished;
 private Button settingsButton;
-private Disposable disposable;
-private SharedPreferences.OnSharedPreferenceChangeListener listener;
 boolean transitionToggle = false;
 
 @Override



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Renamed a fragment

2020-08-10 Thread cohosh
commit c5b31d6c84f59c481ef0450dd1e526816cdb8ae7
Author: Hashik Donthineni 
Date:   Wed Aug 5 15:09:19 2020 +0530

Renamed a fragment
---
 app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java  | 2 +-
 .../main/res/layout/{fragment_main_fragment.xml => fragment_main.xml}   | 0
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index 7615d97..7638b1c 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -50,7 +50,7 @@ public class MainFragment extends Fragment {
 @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
  Bundle savedInstanceState) {
-View rootView = inflater.inflate(R.layout.fragment_main_fragment, 
container, false);
+View rootView = inflater.inflate(R.layout.fragment_main, container, 
false);
 usersServedTV = rootView.findViewById(R.id.users_served);
 Button startButton = rootView.findViewById(R.id.start_button);
 
diff --git a/app/src/main/res/layout/fragment_main_fragment.xml 
b/app/src/main/res/layout/fragment_main.xml
similarity index 100%
rename from app/src/main/res/layout/fragment_main_fragment.xml
rename to app/src/main/res/layout/fragment_main.xml



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Snowflake logo color change on toggl

2020-08-10 Thread cohosh
commit 23b98aa40af49281acb765f044cdce06e8b9509b
Author: Hashik Donthineni 
Date:   Thu Aug 6 19:44:34 2020 +0530

Snowflake logo color change on toggl
---
 .../main/java/org/torproject/snowflake/fragments/MainFragment.java  | 6 ++
 1 file changed, 6 insertions(+)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index c15b7ac..4b53939 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -1,15 +1,18 @@
 package org.torproject.snowflake.fragments;
 
 import android.content.Context;
+import android.graphics.PorterDuff;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.ImageView;
 import android.widget.Switch;
 import android.widget.TextView;
 
 import androidx.annotation.NonNull;
+import androidx.core.content.ContextCompat;
 import androidx.fragment.app.Fragment;
 
 import org.torproject.snowflake.R;
@@ -53,12 +56,15 @@ public class MainFragment extends Fragment {
 View rootView = inflater.inflate(R.layout.fragment_main, container, 
false);
 usersServedTV = rootView.findViewById(R.id.users_served);
 Switch startButton = rootView.findViewById(R.id.snowflake_switch);
+ImageView snowflakeLogo = rootView.findViewById(R.id.snowflake_logo);
 
 startButton.setOnCheckedChangeListener((buttonView, isChecked) -> {
 if (callback.isServiceRunning() && !isChecked) { //Toggling the 
service.
+
snowflakeLogo.setColorFilter(ContextCompat.getColor(getActivity(), 
R.color.snowflakeOff));
 startButton.setText(getString(R.string.Snowflake_Off));
 callback.serviceToggle(ForegroundServiceConstants.ACTION_STOP);
 } else {
+
snowflakeLogo.setColorFilter(ContextCompat.getColor(getActivity(), 
R.color.snowflakeOn));
 startButton.setText(getString(R.string.Snowflake_On));
 
callback.serviceToggle(ForegroundServiceConstants.ACTION_START);
 }



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Added colors for snowflake icon

2020-08-10 Thread cohosh
commit f496bcc7a902fa458667aa745956f4d2fcfa00f6
Author: Hashik Donthineni 
Date:   Thu Aug 6 19:35:07 2020 +0530

Added colors for snowflake icon
---
 app/src/main/res/layout/fragment_main.xml | 1 +
 app/src/main/res/values/colors.xml| 3 +++
 2 files changed, 4 insertions(+)

diff --git a/app/src/main/res/layout/fragment_main.xml 
b/app/src/main/res/layout/fragment_main.xml
index 2c7cc48..28c927f 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -24,6 +24,7 @@
 android:id="@+id/snowflake_logo"
 android:layout_width="200dp"
 android:layout_height="200dp"
+android:tint="@color/snowflakeOff"
 android:layout_centerHorizontal="true"
 android:layout_marginTop="150dp"
 android:src="@drawable/ic_status_on" />
diff --git a/app/src/main/res/values/colors.xml 
b/app/src/main/res/values/colors.xml
index 56f8768..309f559 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -5,4 +5,7 @@
 #CC80FF
 #
 #757575
+#AA
+#8000D7
+#00FFB0
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Rearranged users-served text box

2020-08-10 Thread cohosh
commit d86bad34a6932b2ba662900d43aa1e42d0034a90
Author: Hashik Donthineni 
Date:   Thu Aug 6 19:00:17 2020 +0530

Rearranged users-served text box
---
 app/src/main/res/layout/fragment_main.xml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/src/main/res/layout/fragment_main.xml 
b/app/src/main/res/layout/fragment_main.xml
index b83ff0c..161ecd0 100644
--- a/app/src/main/res/layout/fragment_main.xml
+++ b/app/src/main/res/layout/fragment_main.xml
@@ -21,6 +21,7 @@
 android:textSize="20sp" />
 
 
 
 
\ No newline at end of file



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Changed the Users Served text

2020-08-10 Thread cohosh
commit 3d466477ad3fc0b18184d748ae1367aaa1b7715e
Author: Hashik Donthineni 
Date:   Thu Aug 6 19:02:34 2020 +0530

Changed the Users Served text
---
 app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java | 3 ++-
 app/src/main/res/values/strings.xml| 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
index 796debd..c15b7ac 100644
--- a/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
+++ b/app/src/main/java/org/torproject/snowflake/fragments/MainFragment.java
@@ -80,7 +80,8 @@ public class MainFragment extends Fragment {
 
 if (served > 0) {
 usersServedTV.setVisibility(View.VISIBLE);
-usersServedTV.setText(getString(R.string.users_served_text) + 
served);
+String servedText = getString(R.string.users_served_text) + served;
+usersServedTV.setText(servedText);
 }
 }
 }
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index 876b7f6..7faf436 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -2,7 +2,7 @@
 Snowflake
 This Channel should not be muted. The 
Android system will consider Snowflake not import and will kill the service if 
it\'s muted.
 Snowflake Service
-Users you have helped circumvent 
censorship in the past day \n
+Number of users your Snowflake has helped 
circumvent censorship in the last 24 hours: $
 Snowflake is Off
 Snowflake is On
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Added Snowflake logo

2020-08-10 Thread cohosh
commit c02309e8c83441aa8cd2708c5b2c92f77dd54a6d
Author: Hashik Donthineni 
Date:   Thu Aug 6 18:47:05 2020 +0530

Added Snowflake logo
---
 app/src/main/res/drawable/ic_status_on.xml | 12 
 1 file changed, 12 insertions(+)

diff --git a/app/src/main/res/drawable/ic_status_on.xml 
b/app/src/main/res/drawable/ic_status_on.xml
new file mode 100644
index 000..e65d83c
--- /dev/null
+++ b/app/src/main/res/drawable/ic_status_on.xml
@@ -0,0 +1,12 @@
+http://schemas.android.com/apk/res/android;
+android:width="60dp"
+android:height="60dp"
+android:viewportWidth="60"
+android:viewportHeight="60">
+  
+



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Removed 'Snowflake' from app bar

2020-08-10 Thread cohosh
commit 6a19850cdbb0fd4269917c05aa6f0db3135ea462
Author: Hashik Donthineni 
Date:   Fri Jul 24 13:53:07 2020 +0530

Removed 'Snowflake' from app bar
---
 app/src/main/res/layout/activity_main.xml | 10 --
 1 file changed, 10 deletions(-)

diff --git a/app/src/main/res/layout/activity_main.xml 
b/app/src/main/res/layout/activity_main.xml
index 1c4b319..0728fd7 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -19,16 +19,6 @@
 android:layout_width="match_parent"
 android:layout_height="match_parent">
 
-
-
 https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Changed ET summary to null when switch is off in preference

2020-08-10 Thread cohosh
commit 9961ca58cafe88f831cb2958b7c1ee2e65a5d1d2
Author: Hashik Donthineni 
Date:   Fri Jul 24 13:47:22 2020 +0530

Changed ET summary to null when switch is off in preference
---
 .../org/torproject/snowflake/fragments/AppSettingsFragment.java| 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/app/src/main/java/org/torproject/snowflake/fragments/AppSettingsFragment.java 
b/app/src/main/java/org/torproject/snowflake/fragments/AppSettingsFragment.java
index 409625a..528d8b5 100644
--- 
a/app/src/main/java/org/torproject/snowflake/fragments/AppSettingsFragment.java
+++ 
b/app/src/main/java/org/torproject/snowflake/fragments/AppSettingsFragment.java
@@ -60,9 +60,12 @@ public class AppSettingsFragment extends 
PreferenceFragmentCompat implements Sha
 if (!previousValue.equals(""))
 editTextPreference.setSummary(previousValue); //When 
Switch is turned on set the summary to previously set Value.
 else
-editTextPreference.setSummary(SettingsConstants.DEFAULT); 
//If there is no previous value, then using null.
+editTextPreference.setSummary(SettingsConstants.DEFAULT); 
//If there is no previous value, then using default.
 } else {
-findPreference(key).setSummary(SettingsConstants.DEFAULT); 
//Default is shown when switch is off.
+//Default is shown when switch is off.
+findPreference(key).setSummary(SettingsConstants.DEFAULT);
+//When the switch is off the edit-text won't show any summary. 
Because it already signifies that the app is using default.
+editTextPreference.setSummary("");
 }
 } else {
 //It's an Edit Text



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Added slide animation

2020-08-10 Thread cohosh
commit 1756b498081cfe1be0ca4d264cb9b6ef1d3a3c55
Author: Hashik Donthineni 
Date:   Fri Jul 24 14:51:46 2020 +0530

Added slide animation
---
 .../org/torproject/snowflake/MainActivity.java | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/app/src/main/java/org/torproject/snowflake/MainActivity.java 
b/app/src/main/java/org/torproject/snowflake/MainActivity.java
index b2aa39c..1d2cdf6 100644
--- a/app/src/main/java/org/torproject/snowflake/MainActivity.java
+++ b/app/src/main/java/org/torproject/snowflake/MainActivity.java
@@ -7,13 +7,16 @@ import android.content.Intent;
 import android.graphics.Color;
 import android.os.Build;
 import android.os.Bundle;
+import android.transition.Slide;
 import android.util.Log;
+import android.view.Gravity;
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.Button;
 
 import androidx.annotation.NonNull;
 import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.view.GravityCompat;
 import androidx.fragment.app.Fragment;
 
 import org.torproject.snowflake.constants.ForegroundServiceConstants;
@@ -34,6 +37,9 @@ public class MainActivity extends AppCompatActivity 
implements MainFragmentCallb
 //Indicates if model finished checking the date and reset served count if 
need be.
 boolean isCheckDateFinished;
 private Button settingsButton;
+private Disposable disposable;
+private SharedPreferences.OnSharedPreferenceChangeListener listener;
+boolean transitionToggle = false;
 
 @Override
 protected void onCreate(Bundle savedInstanceState) {
@@ -85,6 +91,22 @@ public class MainActivity extends AppCompatActivity 
implements MainFragmentCallb
 
 Log.d(TAG, "startFragment: " + currentFragment);
 
+//Animation
+
+Slide slideTransition;
+//This defines how the fragment moves. Either from left to right or 
right to left.
+int gravity = transitionToggle ? Gravity.END : Gravity.START;
+transitionToggle = !transitionToggle;
+if (Build.VERSION.SDK_INT > 21) {
+slideTransition = new Slide(gravity);
+} else {
+slideTransition = new 
Slide(GravityCompat.getAbsoluteGravity(gravity, 
getResources().getConfiguration().getLayoutDirection()));
+}
+slideTransition.setDuration(400);
+
+fragment.setEnterTransition(slideTransition);
+//
+
 getSupportFragmentManager()
 .beginTransaction()
 .replace(R.id.fragment_container,



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Made settings button invisible on open settings

2020-08-10 Thread cohosh
commit 120c9b8898866a6b8a04106f1f33bbba049711f5
Author: Hashik Donthineni 
Date:   Fri Jul 24 14:19:56 2020 +0530

Made settings button invisible on open settings
---
 app/src/main/java/org/torproject/snowflake/MainActivity.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/src/main/java/org/torproject/snowflake/MainActivity.java 
b/app/src/main/java/org/torproject/snowflake/MainActivity.java
index d1f6d4c..b2aa39c 100644
--- a/app/src/main/java/org/torproject/snowflake/MainActivity.java
+++ b/app/src/main/java/org/torproject/snowflake/MainActivity.java
@@ -76,9 +76,11 @@ public class MainActivity extends AppCompatActivity 
implements MainFragmentCallb
 if (fragment instanceof MainFragment) {
 currentFragment = FragmentConstants.MAIN_FRAGMENT;
 getSupportActionBar().setDisplayHomeAsUpEnabled(false);
+settingsButton.setVisibility(View.VISIBLE);
 } else {
 currentFragment = FragmentConstants.APP_SETTINGS_FRAGMENT;
 getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+settingsButton.setVisibility(View.GONE);
 }
 
 Log.d(TAG, "startFragment: " + currentFragment);



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Changed preference text color

2020-08-10 Thread cohosh
commit f87ffd6953572e606ab88671b85602d2f36db33a
Author: Hashik Donthineni 
Date:   Fri Jul 24 13:23:21 2020 +0530

Changed preference text color
---
 app/src/main/res/color/preference_textview_color.xml | 5 +
 app/src/main/res/layout/activity_main.xml| 2 +-
 app/src/main/res/values/colors.xml   | 2 ++
 app/src/main/res/values/styles.xml   | 2 ++
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/app/src/main/res/color/preference_textview_color.xml 
b/app/src/main/res/color/preference_textview_color.xml
new file mode 100644
index 000..134857f
--- /dev/null
+++ b/app/src/main/res/color/preference_textview_color.xml
@@ -0,0 +1,5 @@
+
+http://schemas.android.com/apk/res/android;>
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml 
b/app/src/main/res/layout/activity_main.xml
index f41f9c8..600e57b 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -26,7 +26,7 @@
 android:layout_centerInParent="true"
 android:text="@string/app_name"
 
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
-android:textColor="@android:color/white"
+android:textColor="@color/colorText"
 android:textSize="16sp" />
 
 #1C1C1C
 #1C1C1C
 #5A0782
+#
+#757575
 
diff --git a/app/src/main/res/values/styles.xml 
b/app/src/main/res/values/styles.xml
index 0eb88fe..655fdd0 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -6,6 +6,8 @@
 @color/colorPrimary
 @color/colorPrimaryDark
 @color/colorAccent
+@color/preference_textview_color
+@color/colorTextSecondary
 
 
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Added background color

2020-08-10 Thread cohosh
commit 261f52cf1bc2899bb18118b507d2982b148572ab
Author: Hashik Donthineni 
Date:   Fri Jul 24 12:41:32 2020 +0530

Added background color
---
 app/src/main/res/layout/activity_main.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/src/main/res/layout/activity_main.xml 
b/app/src/main/res/layout/activity_main.xml
index d095c62..f41f9c8 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -4,6 +4,7 @@
 xmlns:tools="http://schemas.android.com/tools;
 android:layout_width="match_parent"
 android:layout_height="match_parent"
+android:background="@color/colorPrimary"
 tools:context=".MainActivity">
 
 https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Added up(back) button

2020-08-10 Thread cohosh
commit cddbc2b4f0f5ae62a8d550fc8868a40b9cb7767d
Author: Hashik Donthineni 
Date:   Fri Jul 24 13:58:19 2020 +0530

Added up(back) button
---
 .../main/java/org/torproject/snowflake/MainActivity.java | 16 
 1 file changed, 16 insertions(+)

diff --git a/app/src/main/java/org/torproject/snowflake/MainActivity.java 
b/app/src/main/java/org/torproject/snowflake/MainActivity.java
index 4664ae5..d1f6d4c 100644
--- a/app/src/main/java/org/torproject/snowflake/MainActivity.java
+++ b/app/src/main/java/org/torproject/snowflake/MainActivity.java
@@ -8,8 +8,11 @@ import android.graphics.Color;
 import android.os.Build;
 import android.os.Bundle;
 import android.util.Log;
+import android.view.MenuItem;
+import android.view.View;
 import android.widget.Button;
 
+import androidx.annotation.NonNull;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.fragment.app.Fragment;
 
@@ -72,8 +75,10 @@ public class MainActivity extends AppCompatActivity 
implements MainFragmentCallb
 private void startFragment(Fragment fragment) {
 if (fragment instanceof MainFragment) {
 currentFragment = FragmentConstants.MAIN_FRAGMENT;
+getSupportActionBar().setDisplayHomeAsUpEnabled(false);
 } else {
 currentFragment = FragmentConstants.APP_SETTINGS_FRAGMENT;
+getSupportActionBar().setDisplayHomeAsUpEnabled(true);
 }
 
 Log.d(TAG, "startFragment: " + currentFragment);
@@ -170,4 +175,15 @@ public class MainActivity extends AppCompatActivity 
implements MainFragmentCallb
 else
 return 0;
 }
+
+@Override
+public boolean onOptionsItemSelected(@NonNull MenuItem item) {
+
+if (item.getItemId() == android.R.id.home) {
+onBackPressed();
+return true;
+}
+
+return super.onOptionsItemSelected(item);
+}
 }



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Changed accent color to a lighter purple color

2020-08-10 Thread cohosh
commit 7fe491e8f404c441eb8d70a3b7464724532980e8
Author: Hashik Donthineni 
Date:   Fri Jul 24 13:29:09 2020 +0530

Changed accent color to a lighter purple color
---
 app/src/main/res/values/colors.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/src/main/res/values/colors.xml 
b/app/src/main/res/values/colors.xml
index 9d618aa..56f8768 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -2,7 +2,7 @@
 
 #1C1C1C
 #1C1C1C
-#5A0782
+#CC80FF
 #
 #757575
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [snowflake-mobile/master] Changed primary and Accent colors

2020-08-10 Thread cohosh
commit f7d5d45de6f944cf237182fa4abf7467165e3edb
Author: Hashik Donthineni 
Date:   Fri Jul 24 12:14:09 2020 +0530

Changed primary and Accent colors
---
 app/src/main/res/values/colors.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/src/main/res/values/colors.xml 
b/app/src/main/res/values/colors.xml
index 030098f..2713191 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -1,6 +1,6 @@
 
 
-#6200EE
-#3700B3
-#03DAC5
+#1C1C1C
+#1C1C1C
+#5A0782
 



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/support-portal] https://gitweb.torproject.org/translation.git/commit/?h=support-portal

2020-08-10 Thread translation
commit 55d1425016f00c13a7168a978682c0e03e95d4b0
Author: Translation commit bot 
Date:   Mon Aug 10 16:48:14 2020 +

https://gitweb.torproject.org/translation.git/commit/?h=support-portal
---
 contents+ar.po | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/contents+ar.po b/contents+ar.po
index 690349160f..c9dc4df0db 100644
--- a/contents+ar.po
+++ b/contents+ar.po
@@ -7065,11 +7065,15 @@ msgid ""
 "since the Tor network can't handle the load (e.g. default file-sharing "
 "ports)."
 msgstr ""
+"تسمح سياسة الخروج الافتراضية بالوصول إلى 
العديد من الخدمات الشائعة (مثل تصفح"
+" الويب) ، ولكنها تقيد بعضها بسبب إمكانية 
إساءة الاستخدام (مثل البريد) والبعض"
+" الآخر نظرًا لأن شبكة Tor لا يمكنها معالجة 
الحمل (مثل منافذ مشاركة الملفات "
+"الافتراضية)."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.description)
 msgid "You can change your exit policy by editing your torrc file."
-msgstr ""
+msgstr "يمكنك تغيير سياسة الخروج الخاصة بك عن 
طريق تحرير ملف torrc."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.description)
@@ -7077,6 +7081,8 @@ msgid ""
 "If you want to avoid most if not all abuse potential, set it to \"reject "
 "*:*\"."
 msgstr ""
+"إذا كنت تريد تجنب معظم إساءة الاستخدام الم
حتملة إن لم تكن كلها ، فاضبطها على"
+" \"رفض *: *\"."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.description)
@@ -7085,6 +7091,8 @@ msgid ""
 "the Tor network, but not for connections to external websites or other "
 "services."
 msgstr ""
+"يعني هذا الإعداد أنه سيتم استخدام الترحيل 
الخاص بك لنقل حركة المرور داخل "
+"شبكة Tor ، ولكن ليس للاتصالات بمواقع الويب 
الخارجية أو الخدمات الأخرى."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.description)
@@ -7092,6 +7100,8 @@ msgid ""
 "If you do allow any exit connections, make sure name resolution works (that "
 "is, your computer can resolve Internet addresses correctly)."
 msgstr ""
+"إذا سمحت بأي اتصالات خروج ، فتأكد من عمل 
تحليل الاسم (أي أن الكمبيوتر الخاص "
+"بك يمكنه حل عناوين الإنترنت بشكل صحيح)."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.description)
@@ -7100,6 +7110,9 @@ msgid ""
 "are behind a restrictive firewall or content filter), please explicitly "
 "reject them in your exit policy  otherwise Tor users will be impacted too."
 msgstr ""
+"إذا كانت هناك أي موارد لا يمكن لجهاز الكم
بيوتر الخاص بك الوصول إليها (على "
+"سبيل المثال ، فأنت خلف جدار حماية مقيد أو م
رشح محتوى) ، يرجى رفضها صراحةً في"
+" سياسة الخروج الخاصة بك وإلا سيتأثر مستخدم
ي Tor أيضًا."
 
 #: https//support.torproject.org/operators/facing-legal-trouble/
 #: (content/operators/facing-legal-trouble/contents+en.lrquestion.title)
@@ -7107,6 +7120,8 @@ msgid ""
 "I'm facing legal trouble. How do I prove that my server was a Tor relay at a"
 " given time?"
 msgstr ""
+"أنا أواجه مشكلة قانونية. كيف يمكنني إثبات 
أن خادمي كان عبارة عن مرحل Tor في "
+"وقت معين؟"
 
 #: https//support.torproject.org/operators/facing-legal-trouble/
 #: (content/operators/facing-legal-trouble/contents+en.lrquestion.description)
@@ -7114,6 +7129,8 @@ msgid ""
 "[Exonerator](https://exonerator.torproject.org/) is a web service that can "
 "check if an IP address was a relay at a given time."
 msgstr ""
+"[المبرئ] (https://exonerator.torproject.org/) هي خدمة ويب يم
كنها التحقق مما "
+"إذا كان عنوان IP عبارة عن ترحيل في وقت معين."
 
 #: https//support.torproject.org/operators/facing-legal-trouble/
 #: (content/operators/facing-legal-trouble/contents+en.lrquestion.description)
@@ -7121,11 +7138,14 @@ msgid ""
 "We can also [provide a signed letter](https://www.torproject.org/contact/) "
 "if needed."
 msgstr ""
+"يمكننا أيضًا [تقديم خطاب موقع] 
(https://www.torproject.org/contact/) إذا لزم"
+" الأمر."
 
 #: https//support.torproject.org/operators/hibernation/
 #: 

[tor-commits] [translation/support-portal] https://gitweb.torproject.org/translation.git/commit/?h=support-portal

2020-08-10 Thread translation
commit b984d4e1d858ab38ab1003774e1be843e754dd36
Author: Translation commit bot 
Date:   Mon Aug 10 16:18:13 2020 +

https://gitweb.torproject.org/translation.git/commit/?h=support-portal
---
 contents+ar.po | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/contents+ar.po b/contents+ar.po
index 13e039f007..690349160f 100644
--- a/contents+ar.po
+++ b/contents+ar.po
@@ -7000,11 +7000,14 @@ msgid ""
 "[torrc](https://support.torproject.org/tbb/tbb-editing-torrc/) blank, and "
 "Tor will guess."
 msgstr ""
+"فقط اترك سطر \"العنوان\" في [torrc] 
(https://support.torproject.org/tbb/tbb-;
+"editing-torrc/) فارغًا ، وسيخمن Tor."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.title)
 msgid "I'd run a relay, but I don't want to deal with abuse issues."
 msgstr ""
+"كنت أقوم بتشغيل تتابع ، لكنني لا أريد 
التعامل مع قضايا إساءة الاستخدام."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.description)
@@ -7017,6 +7020,8 @@ msgid ""
 "Each Tor relay has an exit policy that specifies what sort of outbound "
 "connections are allowed or refused from that relay."
 msgstr ""
+"يحتوي كل مرحل Tor على سياسة خروج تحدد نوع 
الاتصالات الصادرة المسموح بها أو "
+"المرفوضة من هذا الترحيل."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.description)
@@ -7025,6 +7030,8 @@ msgid ""
 "clients will automatically avoid picking exit relays that would refuse to "
 "exit to their intended destination."
 msgstr ""
+"يحتوي كل مرحل Tor على سياسة خروج تحدد نوع 
الاتصالات الصادرة المسموح بها أو "
+"المرفوضة من هذا الترحيل."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.description)
@@ -7032,6 +7039,8 @@ msgid ""
 "This way each relay can decide the services, hosts, and networks it wants to"
 " allow connections to, based on abuse potential and its own situation."
 msgstr ""
+"بهذه الطريقة ، يمكن لكل مرحل أن يقرر الخدم
ات والمضيفين والشبكات التي يريد "
+"السماح بالاتصالات بها ، بناءً على احتمال 
إساءة الاستخدام والوضع الخاص به."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.description)
@@ -7042,6 +7051,11 @@ msgid ""
 "running an exit node with minimal "
 "harassment](https://blog.torproject.org/blog/tips-running-exit-node)."
 msgstr ""
+"اقرأ [إدخال الدعم بشأن المشكلات التي قد 
تواجهها] "
+"(https://support.torproject.org/abuse/exit-relay-expectations/) إذا كنت 
"
+"تستخدم سياسة الخروج الافتراضية ، ثم اقرأ 
[نصائح مايك بيري حول تشغيل الخروج "
+"عقدة بأقل قدر من المضايقات] 
(https://blog.torproject.org/blog/tips-running-;
+"exit-node)."
 
 #: https//support.torproject.org/operators/exit-policies/
 #: (content/operators/exit-policies/contents+en.lrquestion.description)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/communitytpo-contentspot] https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot

2020-08-10 Thread translation
commit 8132bb7a3730a398c1172d1333fbc89bc70cbb7c
Author: Translation commit bot 
Date:   Mon Aug 10 16:15:11 2020 +


https://gitweb.torproject.org/translation.git/commit/?h=communitytpo-contentspot
---
 contents+es.po | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/contents+es.po b/contents+es.po
index c3ba9ce89e..3fab3e9c69 100644
--- a/contents+es.po
+++ b/contents+es.po
@@ -7120,7 +7120,7 @@ msgstr ""
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
 msgid "### How do I report a bad relay?"
-msgstr ""
+msgstr "### ¿Cómo reporto un repetidor malicioso?"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7128,6 +7128,8 @@ msgid ""
 "If you encounter a bad relay then please let us know and write to `bad-"
 "relays AT lists DOT torproject DOT org`."
 msgstr ""
+"Si encuentras un repetidor malicioso, por favor háznoslo saber, y escribe a "
+"`bad-relays AT lists DOT torproject DOT org`."
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7136,6 +7138,9 @@ msgid ""
 "check](https://check.torproject.org/). Please include the following in your "
 "report:"
 msgstr ""
+"Puedes comprobar quésalida estás usando en cualquier momento visitando [tor 
"
+"check](https://check.torproject.org/). Por favor incluye los siguiente en tu"
+" reporte:"
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)
@@ -7143,6 +7148,9 @@ msgid ""
 "1. The relay's IP address or fingerprint. The fingerprint is a forty-"
 "character hex string such as `203933ED4E55EF8A3C3518427D1A1ED6A4CC285E`."
 msgstr ""
+"1. La dirección IP del repetidor o su huella dactilar. La huella dactilar es"
+" una cadena de cuarenta caracteres hexadecimales tales como "
+"`203933ED4E55EF8A3C3518427D1A1ED6A4CC285E`."
 
 #: https//community.torproject.org/relay/community-resources/bad-relays/
 #: 
(content/relay-operations/community-resources/bad-relays/contents+en.lrpage.body)

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor-browser-build/master] Bug 40010: Add NSS for application-services

2020-08-10 Thread sysrqb
commit 53131fdc6d54bdd3bda261c64aa81fc3e8fbe228
Author: Georg Koppen 
Date:   Tue Jun 30 10:12:32 2020 +

Bug 40010: Add NSS for application-services
---
 projects/nss/bug_13028.patch |  79 
 projects/nss/build   | 139 +++
 projects/nss/config  |  27 +
 projects/nss/config.patch|  37 
 projects/nss/configure.patch |  11 
 5 files changed, 293 insertions(+)

diff --git a/projects/nss/bug_13028.patch b/projects/nss/bug_13028.patch
new file mode 100644
index 000..60bbd35
--- /dev/null
+++ b/projects/nss/bug_13028.patch
@@ -0,0 +1,79 @@
+From 2f0888c348561249d3083555db33c5619840dbfa Mon Sep 17 00:00:00 2001
+From: Mike Perry 
+Date: Mon, 29 Sep 2014 14:30:19 -0700
+Subject: [PATCH] Bug 13028: Prevent potential proxy bypass cases.
+
+It looks like these cases should only be invoked in the NSS command line
+tools, and not the browser, but I decided to patch them anyway because there
+literally is a maze of network function pointers being passed around, and it's
+very hard to tell if some random code might not pass in the proper proxied
+versions of the networking code here by accident.
+
+diff --git a/security/nss/lib/certhigh/ocsp.c 
b/security/nss/lib/certhigh/ocsp.c
+index cea8456606bf..86fa971cfbef 100644
+--- a/security/nss/lib/certhigh/ocsp.c
 b/security/nss/lib/certhigh/ocsp.c
+@@ -2932,6 +2932,14 @@ ocsp_ConnectToHost(const char *host, PRUint16 port)
+ PRNetAddr addr;
+ char *netdbbuf = NULL;
+ 
++// XXX: Do we need a unittest ifdef here? We don't want to break the 
tests, but
++// we want to ensure nothing can ever hit this code in production.
++#if 1
++printf("Tor Browser BUG: Attempted OSCP direct connect to %s, port %u\n", 
host,
++port);
++goto loser;
++#endif
++
+ sock = PR_NewTCPSocket();
+ if (sock == NULL)
+ goto loser;
+diff --git a/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c 
b/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c
+index e8698376b5be..85791d84a932 100644
+--- a/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c
 b/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c
+@@ -1334,6 +1334,13 @@ pkix_pl_Socket_Create(
+ plContext),
+ PKIX_COULDNOTCREATESOCKETOBJECT);
+ 
++// XXX: Do we need a unittest ifdef here? We don't want to break the 
tests, but
++// we want to ensure nothing can ever hit this code in production.
++#if 1
++printf("Tor Browser BUG: Attempted pkix direct socket connect\n");
++PKIX_ERROR(PKIX_PRNEWTCPSOCKETFAILED);
++#endif
++
+ socket->isServer = isServer;
+ socket->timeout = timeout;
+ socket->clientSock = NULL;
+@@ -1433,6 +1440,13 @@ pkix_pl_Socket_CreateByName(
+ 
+ localCopyName = PL_strdup(serverName);
+ 
++// XXX: Do we need a unittest ifdef here? We don't want to break the 
tests, but
++// we want to ensure nothing can ever hit this code in production.
++#if 1
++printf("Tor Browser BUG: Attempted pkix direct connect to %s\n", 
serverName);
++PKIX_ERROR(PKIX_PRNEWTCPSOCKETFAILED);
++#endif
++
+ sepPtr = strchr(localCopyName, ':');
+ /* First strip off the portnum, if present, from the end of the name 
*/
+ if (sepPtr) {
+@@ -1582,6 +1596,13 @@ pkix_pl_Socket_CreateByHostAndPort(
+ PKIX_ENTER(SOCKET, "pkix_pl_Socket_CreateByHostAndPort");
+ PKIX_NULLCHECK_THREE(hostname, pStatus, pSocket);
+ 
++// XXX: Do we need a unittest ifdef here? We don't want to break the 
tests, but
++// we want to ensure nothing can ever hit this code in production.
++#if 1
++printf("Tor Browser BUG: Attempted pkix direct connect to %s, port 
%u\n", hostname,
++portnum);
++PKIX_ERROR(PKIX_PRNEWTCPSOCKETFAILED);
++#endif
+ 
+ prstatus = PR_GetHostByName(hostname, buf, sizeof(buf), );
+ 
+-- 
+2.27.0
+
diff --git a/projects/nss/build b/projects/nss/build
new file mode 100644
index 000..791a680
--- /dev/null
+++ b/projects/nss/build
@@ -0,0 +1,139 @@
+#!/bin/bash
+[% c("var/set_default_env") -%]
+[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => 
c('input_files_by_name/' _ c('var/compiler')) }) %]
+distdir=/var/tmp/dist/nss
+builddir=/var/tmp/build/[% project %]
+mkdir /var/tmp/build
+tar -C /var/tmp/dist -xf [% c('input_files_by_name/ninja') %]
+export PATH=/var/tmp/dist/ninja:$PATH
+
+# application-services uses a newer NDK, 21d, than all the other projects...
+export ANDROID_NDK_API_VERSION=[% pc("fenix-android-toolchain", 
"var/android_ndk_version") %][% pc('fenix-android-toolchain', 
'var/android_ndk_revision') %]
+export ANDROID_NDK_HOME=/var/tmp/dist/[% c('var/compiler') 
%]/android-ndk/android-ndk-r$ANDROID_NDK_API_VERSION
+# We need to add the new path to our build tools to PATH
+export 

  1   2   >