From b1761913a20e482642251a83163f9f5cf7810375 Mon Sep 17 00:00:00 2001 From: Mert Date: Tue, 24 Mar 2020 06:49:42 +0000 Subject: [PATCH 1/6] Translated using Weblate (Turkish) Currently translated at 34.3% (49 of 143 strings) Translation: Hauk/Android client Translate-URL: https://traduki.varden.info/projects/hauk/android/tr/ --- android/app/src/main/res/values-tr/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/android/app/src/main/res/values-tr/strings.xml b/android/app/src/main/res/values-tr/strings.xml index c23b645..a8e9d30 100644 --- a/android/app/src/main/res/values-tr/strings.xml +++ b/android/app/src/main/res/values-tr/strings.xml @@ -48,4 +48,5 @@ Paylaşım modu: Paylaşım süresi: Açık kaynak konum paylaşımı + Aktif linkler \ No newline at end of file From f44a7eb36cb14dfa4226a197c42269da31f3f6f6 Mon Sep 17 00:00:00 2001 From: Marius Lindvall Date: Wed, 20 May 2020 22:02:55 +0200 Subject: [PATCH 2/6] Add note relating to #137 --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 976f0d9..f789dc7 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ phone, and you're good to go! to install Hauk in, for example `/var/www/html`. Follow the instructions given by the install script. Make sure to set a secure hashed password and edit your site's domain in the configuration file after installation. -3. Start the web server and make sure Memcached or Redis is running. +3. Start the web server and make sure Memcached or Redis is running and + [properly configured and firewalled](https://github.com/bilde2910/Hauk/wiki/FAQ#how-do-i-securely-configure-memcachedredis). 4. Install the companion Android app (from your favourite store linked above) on your phone and enter your server's settings. @@ -50,7 +51,8 @@ files manually. in your web root, for example `/var/www/html`. 3. Modify `include/config.php` to your liking. Make sure to set a secure hashed password and edit your site's domain in this file. -4. Start the web server and make sure Memcached or Redis is running. +4. Start the web server and make sure Memcached or Redis is running and + [properly configured and firewalled](https://github.com/bilde2910/Hauk/wiki/FAQ#how-do-i-securely-configure-memcachedredis). 5. Install the companion Android app (from your favourite store linked above) on your phone and enter your server's settings. From 6bea156d39799a81772d058d716dc652e6075be7 Mon Sep 17 00:00:00 2001 From: Rick van der Zwet Date: Mon, 25 May 2020 11:29:37 +0000 Subject: [PATCH 3/6] Fix php syntax error --- backend-php/api/new-link.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend-php/api/new-link.php b/backend-php/api/new-link.php index 3fe6080..3b37aab 100644 --- a/backend-php/api/new-link.php +++ b/backend-php/api/new-link.php @@ -8,7 +8,7 @@ header("X-Hauk-Version: ".BACKEND_VERSION); requirePOST( "sid", // Existing session ID. - "ado", // Whether or not to allow adoption. + "ado" // Whether or not to allow adoption. ); $memcache = memConnect(); From 3235f789f73cc9e14e0284636e217dcf272f0eac Mon Sep 17 00:00:00 2001 From: Rick van der Zwet Date: Mon, 25 May 2020 11:58:36 +0000 Subject: [PATCH 4/6] Fix unable to connect to redis socket If second argument is given, the connection is always parsed as TCP host. --- backend-php/include/wrapper/redis.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend-php/include/wrapper/redis.php b/backend-php/include/wrapper/redis.php index 81645e9..6eb4d9e 100644 --- a/backend-php/include/wrapper/redis.php +++ b/backend-php/include/wrapper/redis.php @@ -8,8 +8,13 @@ class MemWrapper { function __construct() { $this->redis = new Redis(); - $this->redis->connect(getConfig("redis_host"), getConfig("redis_port")) - or die ("Server could not connect to Redis!\n"); + if(substr(getConfig("redis_host"), 0, 1) === "/") { + $this->redis->connect(getConfig("redis_host")) + or die ("Server could not connect to Redis socket!\n"); + } else { + $this->redis->connect(getConfig("redis_host"), getConfig("redis_port")) + or die ("Server could not connect to Redis!\n"); + } if (getConfig("redis_use_auth")) { $this->redis->auth(getConfig("redis_auth")) or die("Incorrect Redis authentication!"); From a7e241ade15bee6a83b26403214ea3d4151045d2 Mon Sep 17 00:00:00 2001 From: Rick van der Zwet Date: Mon, 25 May 2020 12:37:08 +0000 Subject: [PATCH 5/6] Add FreeBSD support to installer Configuration directory /etc is reserved for system configuration files. /usr/local/etc is reserved for local (user) installed configuation files. --- backend-php/include/inc.php | 1 + install.sh | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/backend-php/include/inc.php b/backend-php/include/inc.php index 13d2643..366a7c2 100644 --- a/backend-php/include/inc.php +++ b/backend-php/include/inc.php @@ -158,6 +158,7 @@ const DEFAULTS = array( // one found from this list. const CONFIG_PATHS = array( "/etc/hauk/config.php", + "/usr/local/etc/hauk/config.php", __DIR__."/config.php" ); diff --git a/install.sh b/install.sh index 7e170db..c52ab9d 100755 --- a/install.sh +++ b/install.sh @@ -14,11 +14,21 @@ hauk_help() { echo "Installs Hauk to the specified web root directory, e.g. /var/www/html" echo "" echo -e "\033[1mOptions:\033[0m" - echo -e "\033[91m-c\t\033[0mInstall config file to /etc/hauk" + echo -e "\033[91m-c\t\033[0mInstall config file to $config" echo -e "\033[91m-f\t\033[0mOverwrite without asking" exit 1 } +# Centralized configuration +if [ "X$(uname -s)" = "XFreeBSD" ]; then + confdir=/usr/local/etc/hauk + config=/usr/local/etc/hauk/config.php +else + confdir=/etc/hauk + config=/etc/hauk/config.php +fi +useconf=0 + # Print help if no arguments given if [ "$#" -eq 0 ]; then hauk_help @@ -32,11 +42,6 @@ if [ "$webroot" = "-f" ] || [ "$webroot" = "-c" ]; then hauk_help fi -# Centralized configuration -confdir=/etc/hauk -config=/etc/hauk/config.php -useconf=0 - hauk_config() { if [ -f "$config" ]; then if [ "$1" != "-f" ] && [ "$2" != "-f" ]; then @@ -46,7 +51,7 @@ hauk_config() { rm "$config" >/dev/null 2>&1 if [ -f "$config" ]; then echo "You do not have permissions to install the configuration file in" - echo "/etc/hauk. Please run this script as root." + echo "${confdir}. Please run this script as root." exit 5 fi ;; @@ -55,7 +60,7 @@ hauk_config() { rm "$config" >/dev/null 2>&1 if [ -f "$config" ]; then echo "You do not have permissions to install the configuration file in" - echo "/etc/hauk. Please run this script as root." + echo "${confdir}. Please run this script as root." exit 5 fi fi @@ -133,9 +138,7 @@ cp -R backend-php/* "$webroot" cp -R frontend/* "$webroot" # Determine the path in which config is saved -if [ "$useconf" -eq 1 ]; then - confpath=/etc/hauk/config.php -else +if [ "$useconf" -eq 0 ]; then confpath="$webroot/include/config.php" cp backend-php/include/config-sample.php "$confpath" >/dev/null 2>&1 fi From 396302a1970e48eac9640afc5720d8660f0919ba Mon Sep 17 00:00:00 2001 From: Rick van der Zwet Date: Mon, 25 May 2020 15:09:03 +0200 Subject: [PATCH 6/6] Update install.sh Old habbits dies slow, explicit guarding is not longer required. Co-authored-by: Marius Lindvall --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index c52ab9d..20cd558 100755 --- a/install.sh +++ b/install.sh @@ -20,7 +20,7 @@ hauk_help() { } # Centralized configuration -if [ "X$(uname -s)" = "XFreeBSD" ]; then +if [ "$(uname -s)" = "FreeBSD" ]; then confdir=/usr/local/etc/hauk config=/usr/local/etc/hauk/config.php else