New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[xmpp] setup http_upload_external #1165
base: dev
Are you sure you want to change the base?
Conversation
maybe we can add as advised in https://xmpp.org/extensions/xep-0363.html#server pointed by @randomstuff |
@@ -14,6 +20,8 @@ do_pre_regen() { | |||
|
|||
# retrieve variables | |||
main_domain=$(cat /etc/yunohost/current_host) | |||
http_file_secret=$(cat /etc/yunohost/http_file_secret) | |||
http_file_delete_secret=$(cat /etc/yunohost/http_file_delete_secret) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to rename those files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, what name do you propose ?
> "${metronome_conf_dir}/${domain}.cfg.lua" | ||
done | ||
|
||
# create the upload endpoint | ||
[[ -d "/var/www/metronome/xmmp-upload" ]] \ | ||
|| mkdir -p /var/www/metronome/upload/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a bug "xmpp-upload" vs "upload"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aie ! yes it's a bug... will change all these soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
We should backup and restore the xmpp-upload dir and the secret you added. |
Do we really want to backup the xmpp-upload folder ? if we spawn a new instance somewhere else, metronome will not keep track of the files, and they will stay forever in the folder ... |
@@ -0,0 +1,189 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if equivalent script exist in python (we would avoid to add php in dependence of yunohost just for xmpp upload feature ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be complicated to rewrite it in python. I just took the official metronome example script. I can do it when I have time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we iterate instead of having the perfect PR ? Because this PR is quite useful.
I suggest to use this perl implementation instead https://github.com/weiss/ngx_http_upload . No new dependencies, no daemon to run. There is also a flask implementation: https://github.com/horazont/xmpp-http-upload In any case, Metronome should be a yunohost app, cause a lot of server don't use it. |
The problem
http upload is currently managed by metronome, but it's a deprecated part of metronome which has a limited mime types handling (For example pdf or doc file are not in the default handled mime types).
http upload is not the responsibility of metronome and need to be outsource.
Solution
use the external http upload way describe on metronome documentation.
PR Status
PENDING check/test/approval
How to test