borgbackup / borgweb

Web UI for Borg Backup
https://borgweb.readthedocs.io/en/latest/
Other
355 stars 40 forks source link

Installation in Docker does not work. #104

Closed jcgruenhage closed 7 years ago

jcgruenhage commented 7 years ago

Hello,

I tried building a docker container for borgweb, but the installation messed up at some point, which resulted in the absence of .borg-env/bin/borgweb. I suspect that the problem comes from npm since npm spat out quite a lot of warnings.

My Dockerfile:

FROM        ubuntu:16.04
MAINTAINER  Jan Christian Grünhage <mail@janchristiangruenhage.de>

RUN     apt update \
        && apt install -y borgbackup virtualenv git python3-pip \ 
        && pip3 install --upgrade pip \
        && curl -sL https://deb.nodesource.com/setup_4.x | bash - \
        && apt install -y npm
RUN     virtualenv --python=python3 borg-env \
        && . borg-env/bin/activate \
        && pip3 install tox pytest
RUN     git clone https://github.com/borgbackup/borgweb.git \
        && cd borgweb \
        && pip3 install -e . \
        && cd js \
        && npm install \
        && cd ../../ \
        && mkdir logs
ENTRYPOINT  [/borg-env/bin/borgweb]

The npm warnings:

npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.15

Since the near 2000 lines of output would be way too much for this issue, I put it in a gist: https://gist.github.com/jcgruenhage/9372981355cf137101be86e660350b5f

Do you have any idea what went wrong?

ThomasWaldmann commented 7 years ago

I never ran npm yet when I tested borgweb, it is not required.

jcgruenhage commented 7 years ago

Ahh okay, I followed the wrong instructions, appearantly they were for the whole developement environment. However, even after finding where the binary is, there seems to be a problem with automatically changing the interface in the config.py file. Edititng the file with sed did somehow not work, Forking it, editing and commiting it and using my fork as the clone url did not work too, however, manually editing and re-running pip install -e . did work. Any idea what might cause that?

ThomasWaldmann commented 7 years ago

Well, make sure you edit the code that is actually executed. Usually the -e . is for that, though.

jcgruenhage commented 7 years ago

Well, this is my Dockerfile now:

FROM            ubuntu:16.04
MAINTAINER      Jan Christian Grünhage <mail@janchristiangruenhage.de>

RUN             apt update \
                && apt install -y borgbackup git python3-pip \
                && pip3 install --upgrade pip
RUN             git clone https://github.com/jcgruenhage/borgweb.git \
                && cd borgweb \
                && pip install -e . \
                && cd ../../ \
                && mkdir logs
EXPOSE          5000
CMD             ["/usr/local/bin/borgweb"]

Cloning this repo on my vm works, cloning in in the container somehow does not carry over the config.py change, even though all caching is disabled... Very strange.

jcgruenhage commented 7 years ago

With that being said, this is not an issue of borgweb obviously, so I'll close this.