Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5aaedeb4 authored by Arnau Vàzquez's avatar Arnau Vàzquez
Browse files

Bring image up to date

See merge request e/os/LineageOTA!10
parents 451ea3ab 6bbdd5f9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
/composer.lock
/vendor
.idea
+19 −6
Original line number Diff line number Diff line
FROM php:7.1-apache
FROM php:7.2-apache
MAINTAINER Julian Xhokaxhiu <info at julianxhokaxhiu dot com>

# internal variables
ENV HTML_DIR /var/www/html
ENV FULL_BUILDS_DIR $HTML_DIR/builds/full

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --fix-missing \
    apt-utils \
    gnupg

RUN apt-get update \
    && apt-get install -y git zlib1g-dev libzip-dev\
    && docker-php-ext-install zip\
    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false zlib1g-dev libzip-dev

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

# set the working directory
WORKDIR $HTML_DIR
# add all the project files
COPY . $HTML_DIR

# enable mod_rewrite
RUN a2enmod rewrite
COPY conf/perf.conf /etc/apache2/conf-available/perf.conf
RUN a2enconf perf

# install the PHP extensions we need
RUN apt-get update \
        && apt-get install nano \
        && buildDeps=" \
                zlib1g-dev \
        " \
@@ -26,7 +43,6 @@ RUN apt-get update \
        \
        && docker-php-source delete \
        && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps 

# set recommended settings for APCu
# see http://php.net/manual/en/apcu.configuration.php
RUN { \
@@ -49,6 +65,3 @@ RUN composer install --no-plugins --no-scripts
# fix permissions
RUN chmod -R 0775 /var/www/html \
    && chown -R www-data:www-data /var/www/html

# create volumes
VOLUME $FULL_BUILDS_DIR
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
The MIT License (MIT)

Copyright (c) 2016 Julian Xhokaxhiu
Copyright (c) 2020 Julian Xhokaxhiu

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
+10 −25
Original line number Diff line number Diff line
@@ -14,29 +14,6 @@ Got a question? Not sure where it should be made? See [CONTRIBUTING](CONTRIBUTIN

## How to use

### Test

```
$ sudo docker build -t e/lineageota . \
    && sudo docker run \
        -d \
        -p 80:80 \
        --rm \
        -v "${PWD}/builds/full:/var/www/html/builds/full" \
        --name lineageota \
        e/lineageota
```

Access to API via http://localhost/api/v1/\<device\>/\<channel\>

Get logs with

```
$ sudo docker exec -ti lineageota tail -f LineageOTA.log
```

You can also use this server with a device connected to the same network, specifying the correct IP (see below).

### Composer

```shell
@@ -44,7 +21,7 @@ $ cd /var/www/html # Default Apache WWW directory, feel free to choose your own
$ composer create-project julianxhokaxhiu/lineage-ota LineageOTA
```

then finally visit http://localhost/LineageOTA to see the REST Server up and running.
then finally visit http://localhost/LineageOTA to see the REST Server up and running. Please note that this is only for a quick test, when you plan to use that type of setup for production (your users), make sure to also provide HTTPS support.

> If you get anything else then a list of files, contained inside the `builds` directory, this means something is wrong in your environment. Double check it, before creating an issue report here.

@@ -124,10 +101,12 @@ In order to integrate this in your LineageOS based ROM, you need to add the [`li

```properties
# ...
lineage.updater.uri=http://my.ota.uri/api/v1/{device}/{type}/{incr}
lineage.updater.uri=https://my.ota.uri/api/v1/{device}/{type}/{incr}
# ...
```

Make always sure to provide a HTTPS based uri, otherwise the updater will reject to connect with your server! This is caused by the security policies newer versions of Android (at least 10+) include, as any app wanting to use non-secured connections must explicitly enable this during the compilation. The LineageOS Updater does not support that.

> Since https://review.lineageos.org/#/c/191274/ is merged, the property `cm.updater.uri` is renamed to `lineage.updater.uri`. Make sure to update your entry.

> As of [5252d60](https://github.com/LineageOS/android_packages_apps_Updater/commit/5252d606716c3f8d81617babc1293c122359a94d):  
@@ -147,6 +126,12 @@ In order to integrate this in your [CyanogenMod](https://github.com/lineageos/an

## Changelog

### v2.9.0
- Add PHP 7.4 compatibility: Prevent null array access on `isValid()` ( thanks to @McNutnut )
- Update RegEx pattern to match more roms than just CM/LineageOS ( thanks to @toolstack )
- Use Forwarded HTTP Extension to determine protocol and host ( thanks to @TpmKranz )
- Add detection of HTTP_X_FORWARDED_* headers ( thanks to @ionphractal )

### v2.8.0

- Use md5sum files if available ( thanks to @jplitza )
+3 −3
Original line number Diff line number Diff line
{
  "name": "julianxhokaxhiu/lineage-ota",
  "description": "A simple OTA REST Server for LineageOS OTA Updater System Application",
  "version": "2.8.0",
  "version": "2.9.0",
  "type": "project",
  "keywords": [
    "android",
@@ -25,7 +25,7 @@
    {
      "type":"package",
      "package": {
        "name": "julianxhokaxhiu/DotNotation",
        "name": "julianxhokaxhiu/dotnotation",
        "version": "master",
        "source": {
          "url": "https://gist.github.com/a6098de64195f604f56a.git",
@@ -42,7 +42,7 @@
    "mikecao/flight": "1.*",
    "julianxhokaxhiu/dotnotation": "dev-master",
    "ext-zip": "*",
    "monolog/monolog": "1.23.*"
    "monolog/monolog": "2.2.*"
  },
  "autoload": {
    "psr-4": {
Loading