restic / rest-server

Rest Server is a high performance HTTP server that implements restic's REST backend API.
BSD 2-Clause "Simplified" License
943 stars 140 forks source link

--no-auth and DISABLE_AUTHENTICATION does not work on restic/rest-server:latest #179

Closed arkanoid87 closed 2 years ago

arkanoid87 commented 2 years ago

rest-server 0.10.0 compiled with go1.15.2 on linux/amd64


How did you run rest-server exactly?

$ docker-compose up

tried with

version: '3'

services:
  rest-server:
     image: "restic/rest-server:latest"
     restart: unless-stopped
     environment:
       - OPTIONS="--no-auth"
     ports:
       - 8000:8000
     volumes:
       - /mnt/disk/restic:/data

and

version: '3'

services:
  rest-server:
     image: "restic/rest-server:latest"
     restart: unless-stopped
     environment:
       - DISABLE_AUTHENTICATION=1
     ports:
       - 8000:8000
     volumes:
       - /mnt/disk/restic:/data

Expected behavior

$ docker-compose up
Recreating rest-server_rest-server_1 ... done
Attaching to rest-server_rest-server_1
rest-server_1  | 
rest-server_1  | **WARNING** No user exists, please 'docker exec -it $CONTAINER_ID create_user'
rest-server_1  | 
rest-server_1  | Data directory: /data
rest-server_1  | Authentication disabled
rest-server_1  | Private repositories disabled
rest-server_1  | Starting server on :8000

Actual behavior

$ docker-compose up
Recreating rest-server_rest-server_1 ... done
Attaching to rest-server_rest-server_1
rest-server_1  | 
rest-server_1  | **WARNING** No user exists, please 'docker exec -it $CONTAINER_ID create_user'
rest-server_1  | 
rest-server_1  | Data directory: /data
rest-server_1  | Authentication enabled
rest-server_1  | Private repositories disabled
rest-server_1  | Starting server on :8000

Did rest-server help you today? Did it make you happy in any way?

I've spent quite some time understanding why borg was so much faster than restic, then I've read about sftp, client/server architecture and the possibility to drop a server on the other side for restic too. This should be explained better in my opinion, as newcomers may just skip it

MichaelEischer commented 2 years ago

rest-server_1 | WARNING No user exists, please 'docker exec -it $CONTAINER_ID create_user'

This line shouldn't be printed if the environment variable DISABLE_AUTHENTICATION is properly set. The same applies to the variant passing --no-auth. According to #119 the latter should work.

MichaelEischer commented 2 years ago

Closing as this seems to be an issue with calling the container and there hasn't been any feedback.