File sharing for Kiwi IRC
- Upload files from you computer / device
- Take a webcam photo or video
- Paste files / images directly into Kiwi IRC
- Auto delete files after a time period
This plugin includes a file uploading server that will store any user uploaded files on the server and then offer them as file downloads with a unique URL. The option to delete files after a set time period discourages users from using the server as a permanent file store.
- yarn (https://yarnpkg.com/ - for the kiwiirc plugin UI)
$ git clone https://github.com/kiwiirc/plugin-fileuploader.git && cd plugin-fileuploader$ go run .$ go buildAdd the following to the webircgateway config:
[plugins]
plugins/fileuploader.soAdjust BasePath and CorsOrigins as needed in fileuploader.config.toml.
Create a symlink to plugin-fileuploader/webircgateway-plugin/fileuploader-server.go in webircgateway/plugins/fileuploader/plugin.go.
Run make in the webircgateway/ folder to build the plugin.
Start the webircgateway.
The kiwi plugin is the javascript file that you link to in your kiwiirc configuration. It is the front end that provides the upload UI.
$ yarn startwill start a webpack development server that hot-reloads the plugin as you develop it. Use the URLhttp://localhost:9000/main.jsas the plugin URL in your kiwiirc configuration.$ yarn buildwill build the final plugin that you can use in production. It will be built into dist/main.js.
Add the plugin javascript file to your kiwiirc config.json and configure the settings:
{
"plugins": [
{
"name": "fileuploader",
"url": "http://localhost:9000/plugin-fileuploader.js"
}
],
"fileuploader": {
"server": "http://localhost:8088/files",
"maxFileSize": 10485760,
"note": "Add an optional note to the upload dialog"
}
}If you're running the fileuploader server as a webircgateway plugin, use the webircgateway hostname, e.g.
"server": "https://ws.irc.example.com/files",File uploads are logged into a database. Currently the supported databases are sqlite3 and mysql.
Database.Typecan either besqlite3ormysql. The default issqlite3.Database.Pathis the path to your database file for sqlite3. For mysql it is a DSN in the formatuser:password@tcp(127.0.0.1:3306)/database. See: https://github.com/go-sql-driver/mysql#dsn-data-source-name