wbbaddons / Tims-PackageServer

Lightweight Package Server for WoltLab Community Framework
https://tims.bastelstu.be
GNU Affero General Public License v3.0
9 stars 3 forks source link

Unable to get docker image to work anymore #34

Closed Sir-Will closed 2 years ago

Sir-Will commented 2 years ago

Hey,

I was trying to install the docker image on a new server and was no longer able to get it to work. curl -I http://localhost:9001 just returns HTTP/1.1 405 Method Not Allowed and docker logs doesn't show anything, so not sure how to troubleshoot this further without any log results.

Installation process:

git clone https://github.com/wbbaddons/Tims-PackageServer.git
cd Tims-PackageServer/
docker-compose up --build -d
curl -I http://localhost:9001

Tims-PackageServer/docker-compose.yaml

version: "3"

services:
  packageserver:
    build: .
    restart: always
    ports:
      - "9001:9001"
    environment:
      DEBUG: "PackageServer:*"
    volumes:
      - /srv/docker/packageserver/packages:/var/lib/PackageServer/packages
TimWolla commented 2 years ago

curl -I http://localhost:9001 just returns HTTP/1.1 405 Method Not Allowed

curl -I performs a HEAD request which is not currently supported.

Sir-Will commented 2 years ago

Oh, I assumed it was still supported as it was working in previous builds.

After updating the mount to the new location, it seems to fetch the packages now, though I'm getting the package-payment-required error when trying to update a package and sometimes it shows Missing required HTTP headers 'etag' and 'last-modified'. in the server list.

This is my auth.json with the user admin being used when getting the error.

{
    "users": {
        "admin": {
            "passwd": "...",
            "groups": [ "Administrator" ],
            "packages": {
            }
        }
    },
    "groups": {
        "Administrator": {
            "*": "*"
        }
    }
}
TimWolla commented 2 years ago

Oh, I assumed it was still supported as it was working in previous builds.

The package server was completely rewritten in an entirely different programming language.

I can't really advice on your problems with the few bits and pieces of information you provide. Some pointers of what you could try: Does downloading work without an auth.json? Does it work with just {"packages":{"*":"*"}} (making everything available to an anonymous user)? Can you login using a web browser?

Sir-Will commented 2 years ago

It works as anonymous user, and it doesn't accept the credentials in the browser. So I assume the password is the issue.

Is the hash generation different now that my password and hash no longer works? (https://github.com/wbbaddons/Tims-PackageServer/issues/30#issuecomment-743773095)

TimWolla commented 2 years ago

Is the hash generation different now that my password and hash no longer works?

The old double BCrypt hash format should still be supported if it matches this regular expression: https://github.com/wbbaddons/Tims-PackageServer/blob/master/src/auth/password.rs#L44

You can also use the Bcrypt:$2y$12$… format as used by WoltLab Suite. The hash is a regular BCrypt hash then.

Sir-Will commented 2 years ago

The hash looks like this: $2b$10$PPeK97.XUCBr2ZhHMxoYRO4LW10ENEekX1AkB6ucjJLD/1sVR0hnq Like the ones in the example: https://github.com/wbbaddons/Tims-PackageServer/blob/master/packages/auth.json.example

TimWolla commented 2 years ago

$2b$

This type identifier is not matched by the regular expression.

Sir-Will commented 2 years ago

Ah. I'm unable to get any hash to work. I tried generating one with twin-bcrypt which gives a $2y$ hash and some online generators but none worked.

Sir-Will commented 2 years ago

I created a user with the password in a WoltLab installation now, and grabbed the hash from the database. It's a private package server, so I only need an admin user.

As the package server already has a website, it would be useful to have a password utility page, to encrypt a password.

TimWolla commented 2 years ago

It's a private package server, so I only need an admin user.

Anonymous access should work as well then.

As the package server already has a website, it would be useful to have a password utility page, to encrypt a password.

Any standard BCrypt hash should work, provided you add the Bcrypt: prefix. This package server primarily aims to serve my personal needs. It is controlled with https://github.com/wbbaddons/Tims-PackageServer-Administration in my case. I am not planning on adding such a password generator feature for this reason.