benjifs / sparkles Goto Github PK
View Code? Open in Web Editor NEWa micropub client
Home Page: https://sparkles.sploot.com
License: MIT License
a micropub client
Home Page: https://sparkles.sploot.com
License: MIT License
I can run the application locally using netlify dev
, but I can’t authenticate using a third-party IndieAuth endpoint. Right now I’m deploying to Netlify and using console.log
to debug changes, which is time consuming and error prone.
Is there a way to test locally, perhaps by providing a placeholder session token (one that could be edited to test different scenarios)? How do you test your changes locally @benjifs?
@jlelse thanks for making me aware of this issue. If you have some additional details please let me know and I'll try to resolve this.
I love Sparkles ✨ Such a brilliantly simple Micropub interface.
I tried using it with my own website however, and am getting the error media-endpoint not found
when clicking on the image post type.
I have a media endpoint configured, which is advertised when visiting https://kit.paulrobertlloyd.com/micropub?q=config
. It returns a number of values, including the following:
{
…
"media-endpoint": "https://kit.paulrobertlloyd.com/media",
…
}
This works with other clients. Trying to follow where in the code where this value added to the stored config, and from a cursory look it seems like this should work. This config endpoint is also behind authorisation, if that might cause some issues?
(I’m using Indiekit for my Micropub server).
If an error is encountered, Sparkles shows a message saying ‘An unexpected error has occurred’. However, an endpoint may return an error message, which can be used to help a user fix the error.
For example, if I try to post a movie post, I get an error. Looking at my logs, I can see this is because No configuration provided for watch post type
. For Indiekit, the error is returned in a JSON response (https://github.com/getindiekit/indiekit/blob/b5259716be540f2936034d5ddc6e5c673b094fda/packages/indiekit/lib/middleware/error.js#L41-L48).
Whether it be returning the full error response, or any error
and/or error_description
value returned from a Micropub server, that would help diagnose issues.
When uploading media to a mediapub endpoint that returns an empty 201 response on success the location
header is not sent to the client.
Looking at the code, it looks like the ...res.headers
is not working as expected. I'm going to try to get this working locally and will submit a PR to do it similar to the Note creation endpoint.
Sparkles can now interact with an Indiekit server’s Micropub media endpoint: it is recognised, and previous uploads are shown in the UI:
If I try to upload an image however, my Indiekit server returns a ‘No file included in request’ error. This is the incoming request:
POST /media
headers {
host: 'indiekit.up.railway.app',
accept: '*/*',
'accept-encoding': 'gzip, deflate, br',
authorization: 'Bearer XXXXXX',
'content-length': '61601',
'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryMNzWqXaY74EidO2a',
'user-agent': 'node-fetch',
'x-forwarded-for': 'XX.XXX.XXX.XX',
'x-forwarded-proto': 'https',
'x-envoy-external-address': 'XX.XXX.XXX.XX',
'x-request-id': 'fc5332d9-cd00-414c-b21d-bd12c6465f60'
}
This is the returned error:
IndiekitError [BadRequestError]: No file included in request
at IndiekitError.badRequest (file:///app/packages/error/index.js:5:12)
at actionController (file:///app/packages/endpoint-media/lib/controllers/action.js:33:31)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at next (/app/node_modules/express/lib/router/route.js:144:13)
at Route.dispatch (/app/node_modules/express/lib/router/route.js:114:3)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at /app/node_modules/express/lib/router/index.js:284:15
at Function.process_params (/app/node_modules/express/lib/router/index.js:346:12)
at next (/app/node_modules/express/lib/router/index.js:280:10)
at Function.handle (/app/node_modules/express/lib/router/index.js:175:3) {
code: 'bad_request',
status: 400
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.