Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http doesn't seem to be working. #29

Open
richang2009 opened this issue Mar 20, 2023 · 5 comments
Open

http doesn't seem to be working. #29

richang2009 opened this issue Mar 20, 2023 · 5 comments

Comments

@richang2009
Copy link

Hi,
http doesn't seem to be working. When I try to serve a directory using the "repo_dir" variable in the grendel.toml file, the client (compute and/or curl and wget) can't seem to download any file. Gets a 404 not found when using wget. I have never been able to server any files using http. Not in 0.0.6, not in 0.0.7 and also not in 0.0.8. Not sure if it is just me only.

Thanks,
RC

@aebruno
Copy link
Member

aebruno commented Mar 23, 2023

The repo_dir works as follows:

  1. Enable in grendel.toml:
# Path to repo directory
repo_dir = "/var/lib/grendel/repo"
  1. Add files to /var/lib/grendel/repo:
$ find /var/lib/grendel/repo/
/var/lib/grendel/repo/mytestfile.txt
/var/lib/grendel/repo/ubuntu
/var/lib/grendel/repo/ubuntu/ubuntu-20.04.2-live-server-amd64.iso
  1. grendel serves files via http at the /repo path. For example:
$ curl http://x.x.x.x/repo/mytestfile.txt
$ curl http://x.x.x.x/repo/ubuntu/ubuntu-20.04.2-live-server-amd64.iso

Can you confirm you're using the correct path?

@richang2009
Copy link
Author

I have set the repo_dir to a local directory under the user home directory. Does it have to be under /var/lib/grendel/repo only ?

Even if we set the repo_dir to /var/lib/grendel/repo, why do we need to mention http://local_IP/repo and not http://local_IP/

@aebruno
Copy link
Member

aebruno commented Jul 6, 2023

I have set the repo_dir to a local directory under the user home directory. Does it have to be under /var/lib/grendel/repo only ?

No you can set it to any path on the filesystem. The default is /var/lib/grendel/repo

Even if we set the repo_dir to /var/lib/grendel/repo, why do we need to mention http://local_IP/repo and not http://local_IP/

Grendel server repo_dir under the URL path /repo. So any files in that dir will be accessible via HTTP using the /repo path. For example, http://local_IP/repo/my-file

@richang2009
Copy link
Author

I am just not able to get the http service recognize a repo dir.

Whatever repo_dir I set to, in the grendel.toml file, none of them works.

This is what I see in the log.

[2024-06-13T10:06:19+05:30] INFO PROVISION: Routes in order: []
[2024-06-13T10:06:19+05:30] INFO PROVISION: Using repo dir:
[2024-06-13T10:06:19+05:30] INFO PROVISION: Listening on http://192.168.3.254:80
[2024-06-13T10:06:19+05:30] INFO PROVISION: ⇨ http server started on 192.168.3.254:80

Using curl to download the file I know it is there in the directory also doesn't work.

user@VBOXubuntu:~$ curl http://192.168.3.254/repo/test.txt
{"message":"Not Found"}

[2024-06-13T10:11:24+05:30] WARN PROVISION: Requested path not found ip=192.168.3.254 path=/repo/test.txt

@jafurlan
Copy link
Collaborator

jafurlan commented Jul 3, 2024

Hello, please make sure Grendel is reading the correct configuration file, you should see: INFO CLI: Using config file: /etc/grendel/grendel.toml in your logs. This can be set by executing Grendel with the -c /etc/grendel/grendel.toml flag. Also make sure the repo_dir option is both uncommented and placed under the [provision] section in said config file like so:

#------------------------------------------------------------------------------
# HTTP Provision Server
#------------------------------------------------------------------------------
[provision]
# Path to repo directory
repo_dir = "/var/lib/grendel/repo"

Then you should see this in your logs: INFO PROVISION: Using repo dir: /var/lib/grendel/repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants