Skip to content
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

Cloudupload nextcloud #1404

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
script:
- docker info
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
- docker build --build-arg VCS_REF=$TRAVIS_COMMIT --build-arg BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") -t $DOCKER_REPO:$TRAVIS_BRANCH-$TARGET -f extra/Dockerfile${EXT} .
- travis_wait 40 docker build --build-arg VCS_REF=$TRAVIS_COMMIT --build-arg BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") -t $DOCKER_REPO:$TRAVIS_BRANCH-$TARGET -f extra/Dockerfile${EXT} .
kleini marked this conversation as resolved.
Show resolved Hide resolved
- docker run --rm $DOCKER_REPO:$TRAVIS_BRANCH-$TARGET uname -a
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo $DOCKER_PASSWORD | docker login -u "$DOCKER_USERNAME" --password-stdin; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker push $DOCKER_REPO:$TRAVIS_BRANCH-$TARGET; fi'
Expand Down
33 changes: 30 additions & 3 deletions extra/Dockerfile.armv7-armhf
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
FROM multiarch/debian-debootstrap:armhf-stretch as builder
ENV PYTHONUNBUFFERED 1
RUN apt-get update && \
apt-get upgrade --yes && \
DEBIAN_FRONTEND="noninteractive" apt-get --yes --option Dpkg::Options::="--force-confnew" --no-install-recommends install \
python-wheel \
build-essential \
python-dev \
libxslt1.1 \
libxml2-dev \
libxslt-dev \
python-pip \
zlib1g-dev \
python-setuptools
WORKDIR /wheels
RUN pip wheel webdavclient3



FROM multiarch/debian-debootstrap:armhf-stretch
LABEL maintainer="Marcus Klein <[email protected]>"

Expand All @@ -15,6 +34,8 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
COPY . /tmp/motioneye
ENV LD_LIBRARY_PATH /opt/vc/lib

COPY --from=builder /wheels /wheels

RUN apt-get update && \
apt-get upgrade --yes && \
DEBIAN_FRONTEND="noninteractive" apt-get --yes --option Dpkg::Options::="--force-confnew" --no-install-recommends install \
Expand All @@ -35,22 +56,28 @@ RUN apt-get update && \
python-tz \
python-wheel \
tzdata \
v4l-utils \
zlib1g-dev && \
v4l-utils && \
git clone --depth 1 https://github.com/Hexxeh/rpi-firmware.git /tmp/rpi-firmware && \
cp -rv /tmp/rpi-firmware/vc/hardfp/opt/vc /opt && \
rm -rf /tmp/rpi-firmware && \
ln -sf /opt/vc/bin/vcgencmd /usr/bin/vcgencmd && \
curl -L --output /tmp/motion.deb https://github.com/Motion-Project/motion/releases/download/release-4.2.2/pi_stretch_motion_4.2.2-1_armhf.deb && \
dpkg -i /tmp/motion.deb && \
rm /tmp/motion.deb && \
pip install webdavclient3 -f /wheels && \
rm -rf /wheels \
pip install /tmp/motioneye && \
rm -rf /tmp/motioneye && \
rm -rf /root/.cache/pip/* && \
apt-get purge --yes \
git \
python-pip \
python-setuptools \
python-wheel && \
python-wheel \
DavHau marked this conversation as resolved.
Show resolved Hide resolved
build-essential \
python-dev \
libxml2-dev \
libxslt-dev && \
apt-get autoremove --yes && \
apt-get --yes clean && rm -rf /var/lib/apt/lists/* && rm -f /var/cache/apt/*.bin

Expand Down
6 changes: 5 additions & 1 deletion motioneye/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ def get_camera(camera_id, as_lines=False):
camera_config = _conf_to_dict(lines,
no_convert=['@network_share_name', '@network_smb_ver', '@network_server',
'@network_username', '@network_password', '@storage_device',
'@upload_server', '@upload_username', '@upload_password'])
'@upload_server', '@upload_username', '@upload_password',
'@upload_url'])

if utils.is_local_motion_camera(camera_config):
# determine the enabled status
Expand Down Expand Up @@ -716,6 +717,7 @@ def motion_camera_ui_to_dict(ui, prev_config=None):
'@upload_service': ui['upload_service'],
'@upload_server': ui['upload_server'],
'@upload_port': ui['upload_port'],
'@upload_url': ui['upload_url'],
'@upload_method': ui['upload_method'],
'@upload_location': ui['upload_location'],
'@upload_subfolders': ui['upload_subfolders'],
Expand Down Expand Up @@ -1082,6 +1084,7 @@ def motion_camera_dict_to_ui(data):
'upload_service': data['@upload_service'],
'upload_server': data['@upload_server'],
'upload_port': data['@upload_port'],
'upload_url': data['@upload_url'],
'upload_method': data['@upload_method'],
'upload_location': data['@upload_location'],
'upload_subfolders': data['@upload_subfolders'],
Expand Down Expand Up @@ -1873,6 +1876,7 @@ def _set_default_motion_camera(camera_id, data):
data.setdefault('@upload_service', 'ftp')
data.setdefault('@upload_server', '')
data.setdefault('@upload_port', '')
data.setdefault('@upload_url', '')
data.setdefault('@upload_method', 'POST')
data.setdefault('@upload_location', '')
data.setdefault('@upload_subfolders', True)
Expand Down
5 changes: 4 additions & 1 deletion motioneye/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1893,6 +1893,7 @@ function cameraUi2Dict() {
'upload_movie': $('#uploadMovieSwitch')[0].checked,
'upload_service': $('#uploadServiceSelect').val(),
'upload_server': $('#uploadServerEntry').val(),
'upload_url': $('#uploadUrlEntry').val(),
'upload_port': $('#uploadPortEntry').val(),
'upload_method': $('#uploadMethodSelect').val(),
'upload_location': $('#uploadLocationEntry').val(),
Expand Down Expand Up @@ -2215,6 +2216,7 @@ function dict2CameraUi(dict) {
$('#uploadMovieSwitch')[0].checked = dict['upload_movie']; markHideIfNull('upload_movie', 'uploadMovieSwitch');
$('#uploadServiceSelect').val(dict['upload_service']); markHideIfNull('upload_service', 'uploadServiceSelect');
$('#uploadServerEntry').val(dict['upload_server']); markHideIfNull('upload_server', 'uploadServerEntry');
$('#uploadUrlEntry').val(dict['upload_url']); markHideIfNull('upload_url', 'uploadUrlEntry');
$('#uploadPortEntry').val(dict['upload_port']); markHideIfNull('upload_port', 'uploadPortEntry');
$('#uploadMethodSelect').val(dict['upload_method']); markHideIfNull('upload_method', 'uploadMethodSelect');
$('#uploadLocationEntry').val(dict['upload_location']); markHideIfNull('upload_location', 'uploadLocationEntry');
Expand Down Expand Up @@ -2920,7 +2922,7 @@ function doRestore() {
}

function doTestUpload() {
var q = $('#uploadPortEntry, #uploadLocationEntry, #uploadServerEntry');
var q = $('#uploadPortEntry, #uploadLocationEntry, #uploadServerEntry, #uploadUrlEntry');
var valid = true;
q.each(function() {
this.validate();
Expand All @@ -2940,6 +2942,7 @@ function doTestUpload() {
service: $('#uploadServiceSelect').val(),
server: $('#uploadServerEntry').val(),
port: $('#uploadPortEntry').val(),
url: $('#uploadUrlEntry').val(),
method: $('#uploadMethodSelect').val(),
location: $('#uploadLocationEntry').val(),
subfolders: $('#uploadSubfoldersSwitch')[0].checked,
Expand Down
15 changes: 11 additions & 4 deletions motioneye/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,23 @@
<option value="gdrive">Google Drive</option>
<option value="gphoto">Google Photo</option>
<option value="dropbox">Dropbox</option>
<option value="webdav">WebDav</option>
<option value="nextcloud">NextCloud</option>
</select>
</td>
<td><span class="help-mark" title="choose a service to which the media files should be uploaded">?</span></td>
</tr>
<tr class="settings-item" required="true" depends="uploadEnabled uploadService=(ftp|sftp|http|https)">
<tr class="settings-item" required="true" depends="uploadEnabled uploadService=(ftp|sftp)">
<td class="settings-item-label"><span class="settings-item-label">Server Address</span></td>
<td class="settings-item-value"><input type="text" class="styled storage camera-config" id="uploadServerEntry"></td>
<td><span class="help-mark" title="the domain name or IP address of the server (e.g. ftp.example.com or 192.168.1.3)">?</span></td>
</tr>
<tr class="settings-item" required="true" min="1" max="65535" depends="uploadEnabled uploadService=(ftp|sftp|http|https)">
<tr class="settings-item" required="true" depends="uploadEnabled uploadService=(webdav|nextcloud|http|https)">
<td class="settings-item-label"><span class="settings-item-label">Server URL</span></td>
<td class="settings-item-value"><input type="text" class="styled storage camera-config" id="uploadUrlEntry"></td>
<td><span class="help-mark" title="the URL of the server (e.g. http(s)://my.server/uploads)">?</span></td>
</tr>
<tr class="settings-item" required="true" min="1" max="65535" depends="uploadEnabled uploadService=(ftp|sftp)">
<td class="settings-item-label"><span class="settings-item-label">Server Port</span></td>
<td class="settings-item-value"><input type="text" class="number styled storage camera-config" id="uploadPortEntry"></td>
<td><span class="help-mark" title="the port to use when connecting to the service (leave it empty to use the default value)">?</span></td>
Expand Down Expand Up @@ -458,12 +465,12 @@
<td class="settings-item-value"><input type="checkbox" class="styled storage camera-config" id="cleanCloudEnabledSwitch"></td>
<td><span class="help-mark" title="enable this to delete the uploaded media files on cloud as well when the local media files get deleted according to file persistence setting, currently this option is available only for gdrive">?</span></td>
</tr>
<tr class="settings-item" depends="uploadEnabled uploadService=(ftp|sftp|http|https)">
<tr class="settings-item" depends="uploadEnabled uploadService=(ftp|sftp|http|https|webdav|nextcloud)">
<td class="settings-item-label"><span class="settings-item-label">Username</span></td>
<td class="settings-item-value"><input type="text" autocapitalize="none" class="styled storage camera-config" id="uploadUsernameEntry"></td>
<td><span class="help-mark" title="the username for the upload service account">?</span></td>
</tr>
<tr class="settings-item" depends="uploadEnabled uploadService=(ftp|sftp|http|https)">
<tr class="settings-item" depends="uploadEnabled uploadService=(ftp|sftp|http|https|webdav|nextcloud)">
<td class="settings-item-label"><span class="settings-item-label">Password</span></td>
<td class="settings-item-value"><input type="password" autocomplete="new-password" class="styled storage camera-config" id="uploadPasswordEntry"></td>
<td><span class="help-mark" title="the password for the upload service account">?</span></td>
Expand Down
Loading