Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Stuck! Manifest.json returns 403

Solved by Vadym View solution

Started by DrPen 11 months ago · 10 replies · 159 views
11 months ago

Why is this happening? I checked the chmod (604) but Im fairly sure it isn't that. Is there anything I need to do in the Grav config so that its recognised? Json is not included in the unsafe protocols, extensions or tags lists.

I'm linking in the base.html.twig, like this:

<link rel="manifest" href="{{ url('theme://assets/manifest.json') }}" />

11 months ago

@penworks,

  • Using fresh Grav with Quark on Windows 11 with Ubuntu 24.04 inside WSL
  • Created file ./user/themes/quark/assets/manifest.json using VSCode
  • Added inside base.html.twig
    <link rel="manifest" href="{{ url('theme://assets/manifest.json') }}" />
  • Generated HTML contains:
    <link rel="manifest" href="/user/themes/quark/assets/manifest.json" />

No errors.

Questions:

  • Is your file's access permissions equal to other files inside assets or *images"?
  • Is your file's owner and group equal to other files inside assets or *images"?
11 months ago

Yes the owner is the same. I used Sublime to create the file, on Windows. and sftp using WinSCP. The folder is 705, all the other file permissions are 604, I checked.

11 months ago

@b.da, I'm not that well versed in .htaccess...

The .htaccess in the root folder of Grav has the same restrictions. I use Apache2, instead of the build in webserver and have no issues.

11 months ago

@b.da
Thanks for the link. I thought it must be something like this in the Grav system.

So to clarify, I'd have:

<link rel="manifest" href="{{ url('theme://assets/manifest.webmanifest') }}" />

11 months ago

@penworks, if that's your file path, you just need to change the file extension manifest.webmanifest instead of manifest.json. In my case{{ url('theme://images/manifest.webmanifest', true) }}

👍 1
11 months ago

@pamtbaau:
The .htaccess in the root folder of Grav has the same restrictions.

@pamtbaau, yes, it's in the same commit. Not an expert in this part either, although everything seems clear here. I just remember an issue arose, and I quickly found a solution, and thought that blocking seems logical, as Flex Objects specifically use .json format and should not be accessible. You can test access to ../user/data/flex-objects/contacts.json.

👍 1
11 months ago

@b.da
Yes I did that and its now accessible. I've actually used site.webmanifest.

Its not working yet as a standalone PWA so I still need to check the content again but the rendered link works.

Thanks!

11 months ago

@penworks, Please mark the reply from @b.da as "solution" since it did solve your issue.

11 months ago

@pamtbaau OK, thanks for reminder. Thanks for your input also as has prompted further useful info.

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 80 10 hours ago
General · by pamtbaau, 15 hours ago
1 51 15 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago