diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..9c97744 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,53 @@ +name: Build Docker image + +on: + push: +# branches: +# - 'master' + tags: + - 'v*' + pull_request: + branches: + - 'master' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - # Check out repository + name: Checkout + uses: actions/checkout@v3 + - # Set up QEMU for multiarch support + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - # Set up Docker BuildX for Docker image building + name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + - # Set proper tags + name: Docker metadata + id: docker_meta # you'll use this in the next step + uses: docker/metadata-action@v3 + with: + images: bilde2910/hauk + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern=v{{version}} + type=semver,pattern=stable-{{major}}.x + - # Log in to Docker Hub + name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - # Build and push + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index ba390fd..20b370e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,11 @@ COPY frontend/ /var/www/html/ COPY docker/start.sh . RUN apt-get update && \ - apt-get install -y memcached libmemcached-dev zlib1g-dev && \ + apt-get install -y memcached libmemcached-dev zlib1g-dev libldap2-dev libssl-dev && \ pecl install memcached && \ - docker-php-ext-enable memcached + docker-php-ext-enable memcached && \ + docker-php-ext-configure ldap --with-libdir=lib/*-linux-gnu*/ && \ + docker-php-ext-install ldap EXPOSE 80/tcp VOLUME /etc/hauk diff --git a/README.md b/README.md index 9aaa120..8839672 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,9 @@ phone, and you're good to go! ## System Requirements -- Web server running LEMP or LAMP -- PHP Memcached or Memcache extension installed on websever. +- Web server running PHP and Memcached or Redis. +- PHP `memcached`, `memcache` or `redis` extension installed on the web server. +- PHP `ldap` extension if using LDAP authentication. - Android 6 or above to run the [companion Android app](https://f-droid.org/packages/info.varden.hauk/). ## Installation instructions @@ -35,13 +36,11 @@ 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 webserver and make sure Memcached is running. -4. Install the [companion Android app](https://f-droid.org/packages/info.varden.hauk/) +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. -When you visit the webroot you may see an experation notice. Hauk uses randomly -generated URL which will be provided by the app. - ## Manual installation If you prefer not to use the install script, you can instead choose to copy the @@ -52,12 +51,32 @@ 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 webserver and make sure Memcached is running. -5. Install the [companion Android app](https://f-droid.org/packages/info.varden.hauk/) +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. +## Distribution-specific packages + +The Hauk backend is available as packages for the following distributions: + +### Arch Linux + +Install [`hauk-server`](https://aur.archlinux.org/packages/hauk-server/) from +AUR. The backend will be installed to `/usr/share/webapps/hauk-server`. + ## Via Docker Compose +The official Docker image on Docker Hub is `bilde2910/hauk`. It comes with several different tags: + +| Tag | Description | +| --- | ----------- | +| `latest` | Updated with each commit to this repository and always has the latest changes. | +| `stable-1.x` | The latest tagged [release](https://github.com/bilde2910/Hauk/releases) of version 1.x. | +| `X.Y.Z` | A specific release of the Hauk backend. Note that old versions are not supported and are provided for your convenience only. | + +`latest`, `stable-1.x` and all releases from `1.5.2` and up are multi-arch and compiled for x86_64, armv7l and aarch64. `1.5.1` and older are x86_64 only. You can use any of these tags for all architectures, and Docker will automatically pick the correct one. If you need the image for a specific architecture, however, you can fetch them using `*-amd64` (x86_64), `*-arm32v7` (armv7l) or `*-arm64v8` (aarch64) versions of any of the tags (e.g. `latest-arm32v7`). + **docker-compose.yml** ```yaml @@ -109,6 +128,22 @@ server { } ``` +## Upgrading to newer versions + +Hauk is versioned according to [Semantic Versioning 2.0.0](https://semver.org/). Any update that is **not a major update** is guaranteed to be without breaking changes, and you can keep the same configuration file for the updated release. + +- Major updates add breaking changes that either require manual intervention, or breaks backward compatibility. Update instructions for major versions will be listed in the release notes, as well as either this README or in the wiki. To date there have been no major updates. +- Minor updates add functionality, but does not break backward compatibility. You can still use an older client on a newer server, or a newer client on an older server, though some functionality may be missing. This will be dynamically detected by the client and server, which could e.g. lead to some UI elements being disabled in the app, or a notification made if a user tries to use new functionality that the other endpoint does not support. +- Patch updates are primarily bugfixes. + +Aside from certain major changes, you can keep your configuration file. New options may have been added to the config, but these will have sane defaults applied automatically. If you wish to change any new options, you can either reconfigure Hauk from the new config.php template, or copy and paste the relevant options from the new template to your existing file and change the appropriate values. + +Installations done using either the installer (`install.sh`) or via manual file copy can be upgraded simply by pulling the latest version of this repository and running the installer again, or overwriting the installation with the new files. + +Installations done via distribution-specific packages will be updated to the latest version by your package manager. + +Docker installations will be updated whenever you pull the image. If you're using Docker, you can reserve yourself from receiving major updates (which may contain breaking changes) by using the `stable-*` tag instead of `latest`. If you use a specific versioned tag, your installation will be locked at that specific version and you will not receive feature updates or bugfixes unless you manually change the tag and pull. + ## Demo server If you'd like to see what Hauk can do, download the app and insert connection details for the demo server: @@ -118,21 +153,41 @@ Password: `demo` Location shares on the demo server is limited to 2 minutes and is only meant for demonstration purposes. Set up your own server to use Hauk to its full extent. +
+ Demo server privacy policy - Last updated December 26, 2019 + +**Last updated: December 26, 2019** + +The demo server is limited by configuration to shares no longer than 2 minutes. This means that no matter what happens, the location data you send to the demo server will be deleted automatically after at most 2 minutes from session initiation. Location data is never logged to disk in any way and only stays in RAM for this time. After the session ends, the data is no longer available. It is a vanilla installation of Hauk from GitHub and the code has not been altered in any way. + +The server currently uses CloudFlare for DDoS protection, hence CloudFlare can see the data in transit. You may refer to their privacy policy as well. + +The HTTP daemon keeps a standard access log for 7 days. This log contains the link ID (which is useless after the 2 minute session expiration), full URLs, user agents, timestamps, and referring URL (if any). It also logs the IP addresses of the CloudFlare proxy server you connect through. It does *not* contain *your* IP address, only that of a CloudFlare data center somewhere. It's thus not possible to track individuals using it, and not possible to get any meaningful data from it. This log file is used for abuse prevention only. + +The server itself is located in Norway and is thus covered under Norwegian privacy regulations. +
+ ## Translators Hauk depends on volunteers to translate the project. Want to help out? Head over to the [translation portal](https://traduki.varden.info/engage/hauk/) to get started. [![Translation status](https://traduki.varden.info/widgets/hauk/-/287x66-white.png)](https://traduki.varden.info/engage/hauk/) -**Basque** - osoitz -**Dutch** - Jdekoning141 -**French** - thifranc -**German** - natrius, hurradiegams and lemmerk -**Norwegian Bokmål** - bilde2910 -**Norwegian Nynorsk** - bilde2910 -**Polish** - krystiancha and RuralYak -**Russian** - RuralYak -**Ukrainian** - RuralYak +- **Basque** - osoitz +- **Catalan** - xordiet +- **Dutch** - Jdekoning141 +- **French** - thifranc and LukeMarlin +- **German** - natrius, hurradiegams, lemmerk, code-surfer and Marmo +- **Italian** - Vieler +- **Norwegian Bokmål** - bilde2910 +- **Norwegian Nynorsk** - bilde2910 +- **Polish** - krystiancha and RuralYak +- **Portugese (Brazil)** - arajooj +- **Romanian** - Licaon_Kter +- **Russian** - RuralYak, Brujerizmo90 +- **Spanish** - sdstolworthy +- **Turkish** - kylethedeveloper, ayyilmaz +- **Ukrainian** - RuralYak ### Translation status diff --git a/android/.idea/codeStyles/Project.xml b/android/.idea/codeStyles/Project.xml index 7b4ba16..39ab1bd 100644 --- a/android/.idea/codeStyles/Project.xml +++ b/android/.idea/codeStyles/Project.xml @@ -1,9 +1,6 @@