This compliments SVNmentions (webmentions receiver) by providing an SVN hook that will act as a webmentions sender.
Note that SVNmentions obtains direct access to the SVN repository and bypasses any Apache-level Authorization that has been set up. This, and its ability to send outgoing requests makes it an attack vector. Consider extending with or applying some amount of commit content filtering to reduce the risk.
You need to configure your SVN repository with the hook and enough configuration for it to understand what external URI it is serving. The external URI is important for determining the source URI (during the Webmention) as well as target URI for same site Webmentions that use relative paths.
Note the following requirements:
/path/to/svn-repo/MUST end in a slash (/) to ensure that it is a directoryhttps://example.com/apache2/webspace/pathMUST NOT end in a slash (/) due to it being added by the hook laterhttps://example.com/apache2/webspace/pathMUST either start withhttps://ORhttp://
- Clone
- Run
make debian-package-dependenciesto install dependent build Debian packages - Run
make debian-packageto build package locally - Run
dpkg -i package/SVNmentions-hook_X.X.X_all.debto install package locally
- add the hook to the repository
add-SVNmentions-hook /path/to/svn-repo/ https://example.com/apache2/webspace/path
Optionally, you can specify:
- a client ID that will be provided whenever a service is asking for authentication.
- customize the user agent for outgoing requests.
- an author that gets skipped (SHOULD match SVNmentions author).
add-SVNmentions-hook /path/to/svn-repo/ https://example.com/apache2/webspace/path https://example.com/apache2/id
add-SVNmentions-hook /path/to/svn-repo/ https://example.com/apache2/webspace/path 'client ID'
add-SVNmentions-hook /path/to/svn-repo/ https://example.com/apache2/webspace/path https://example.com/apache2/id "SVNmentions (https://github.com/carrvo/SVNmentions-hook) curl/8.5.0" SVNmention
Note: if a hook is already present, it will instead install it under a post-commit.d directory.
Just commit files with a supported svn:mime-type SVN property!
text/html
Note that the outgoing requests will be invisible and all errors will be reported to, and only to, the client at this time.
You can set webmention:skip SVN property (detects existence) for any documents you do not want links to incur an outgoing Webmention.
This is valuable for feed and sitemap documents who have references to other documents but is not appropriate to send a Webmention to them.
Alternatively you can send non-standard Webmentions by populating a webmention:send SVN property with a destination per line. This is useful for mime-types that cannot have the destination embedded into their file content (such as image files).
These non-standard Webmentions will send it with the additional post fields:
type=webdavproperty=webmention:send
Note: skipping takes priority.
Copyright 2024 by carrvo
I have not decided on which license to declare as of yet.