skpy / micropub Goto Github PK
View Code? Open in Web Editor NEWa minimal PHP micropub endpoint, with media support
License: Other
a minimal PHP micropub endpoint, with media support
License: Other
I have setup your code. When I try to publish from https://micropublish.net/new I get There was an error making a request to your Micropub endpoint. The error received was: {"error":"no_auth","error_description":"No authorization token supplied."}
It authenticates me through indieauth before creating post.
<?php
# We set the default timezone here so that you can safely use the PHP
# date() function inside the config elements below, should you desire.
date_default_timezone_set('America/New_York');
$config = array(
# the URL of our site, with trailing slash.
'base_url' => 'https://denverprophit.us' . $_SERVER['HTTP_HOST'] .'/',
# the base path of the site's docroot, with trailing slash
'base_path' => '/denverpr/public_html/',
# the name of the sub-directory for images, with trailing slash.
# we'll create sub-directories of the form 'year/month/'.
'upload_path' => 'assets/img/',
# the max pixel width of uploaded images.
'max_image_width' => 1920,
# the path to the Jekyll site.
# trailing slash required.
'source_path' => '/denverpr/new/',
# different types of content may have different paths.
# by default, articles are in the root of the /content/ directory, so
# are not included here.
# Notes, reposts, replies, etc are being stored as Jekyll data files
# in the /data directory. No need to prepend "/data" to these paths.
'content_paths' => array(
'bookmark-of' => 'bookmarks',
'in-reply-to' => date('Y/m'),
'like-of' => 'likes',
'note' => date('Y/m'),
'photo' => date('Y/m'),
'repost-of' => date('Y/m'),
'rsvp' => 'rsvp',
),
# I am storing all photos, reposts and replies as notes. So I need a
# way to tell Hugo to use the "note" templates for these items. This
# override controls that.
'content_overrides' => array(
'in-reply-to' => 'right-sidebar',
'photo' => 'right-sidebar',
'repost-of' => 'right-sidebar',
),
# whether or not to copy uploaded files to the source /static/ directory.
'copy_uploads_to_source' => true,
# an external micropub media endpoint to use.
# 'media_endpoint' => 'https://example.com/my-media-endpoint/',
# an array of syndication targets; each of which should contain the
# necessary credentials.
'syndication' => array(
'twitter' => array( 'key' => 'xxx',
'secret' => 'xxx',
'token' => 'xxx',
'token_secret' => 'xxx',
'prefix' => 'I just posted ',
),
),
# some Micropub clients don't set syndication targets for some actions,
# but we may want to syndicate some stuff all the time. For each post
# kind, define an array of mandatory syndication targets.
'always_syndicate' => array(
'repost-of' => array( 'twitter' ),
'in-reply-to' => array( 'twitter' ),
),
# the IndieAuth token endpoint to use
'token_endpoint' => 'https://tokens.indieauth.com/token',
# the command used to build the site
'command' => '/home/denverpr/new/bundle exec jekyll build',
);
return $config;
?>
I'm receiving the following error when trying to post to my Hugo site via Micropub clients (I've tried various with the same error):
{"error":"insufficient_scope","error_description":"The request lacks valid authentication credentials"}
I believe that I have followed the installation instructions correctly and I am able to successfully authorise with indiauth.com
Any pointers for how I could start troubleshooting this?
Following the instructions, it says to run php composer.phar install
but I get an error when trying that:
Could not open input file: composer.phar
So I move on and try to use it as-is, and I get an error that:
FastCGI sent in stderr: "PHP message: PHP Warning: require_once(/var/www/html/obrienlabs/micropub/vendor/autoload.php): failed to open stream: No such file or directory
I assume this is because I'm missing the composer.phar?
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.