add examples and README
This commit is contained in:
parent
3b1602d2bc
commit
9687f30b6a
4 changed files with 38 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
node_modules
|
||||
dist
|
||||
wrangler.*
|
||||
!wrangler.example.toml
|
||||
config.json
|
||||
config.prod.json
|
14
README.md
Normal file
14
README.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
This is a `mod_http_upload_external`-compatible XEP-0363 file server for Prosody and eJabberd implemented on Cloudflare Workers with S3-compatible backend support.
|
||||
|
||||
To use it, you need to fill in `config.prod.json` using `config.example.json` as a template, and then create `wrangler.prod.toml` based on `wrangler.example.toml`. Most of the fields should be pretty self-explanatory. To publish it to your Cloudflare account, run `npm run publish-prod`.
|
||||
|
||||
To configure eJabberd to use the endpoint exposed by this service, add
|
||||
|
||||
```yaml
|
||||
mod_http_upload:
|
||||
put_url: https://<worker_url>/
|
||||
get_url: https://<worker_url>/
|
||||
external_secret: <secret_in_config_json>
|
||||
```
|
||||
|
||||
to `ejabberd.yaml`.
|
12
config.example.json
Normal file
12
config.example.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"xmpp_secret": "<xmpp_secret>",
|
||||
"s3": {
|
||||
"endpoint": "https://<s3_endpoint>",
|
||||
"bucket": "<bucket>"
|
||||
},
|
||||
"aws": {
|
||||
"accessKeyId": "<access_key>",
|
||||
"secretAccessKey": "<secret_key>",
|
||||
"region": "<region>"
|
||||
}
|
||||
}
|
11
wrangler.example.toml
Normal file
11
wrangler.example.toml
Normal file
|
@ -0,0 +1,11 @@
|
|||
name = ""
|
||||
type = "javascript"
|
||||
zone_id = ""
|
||||
account_id = ""
|
||||
route = ""
|
||||
workers_dev = true
|
||||
|
||||
[build]
|
||||
command = "npm install && npm run build"
|
||||
[build.upload]
|
||||
format = "service-worker"
|
Loading…
Reference in a new issue