Commit 076935e4 authored by Sophie Herold's avatar Sophie Herold
Browse files

Add existing code

parent b5cb4e0b
target/
Cargo.lock
*~
tags.*
.vscode/
cache:
key: ${CI_JOB_NAME}
paths:
- target/
before_script:
- export PATH="$HOME/.cargo/bin:$PATH"
- rustup update stable
- rustup component add rustfmt
- rustup component add clippy
- cargo install cargo-audit
- rustc --version && cargo --version
build:
stage: build
script:
- cargo build
code_check:
stage: test
script:
- cargo fmt -- --check
- cargo clippy
- cargo audit --deny-warnings
test:
stage: test
script:
- cargo test
- cargo test -- --ignored
release:
stage: deploy
only:
- tags
script:
- cargo build --release
- cp ./target/release/pika-pile ./
artifacts:
paths:
- pika-pile
[package]
name = "pika-pile"
description = "Simple backups based on borg"
version = "0.1.0-beta.2"
authors = ["Sophie Herold <sophie@hemio.de>"]
homepage = "https://git.hemio.de/sophie/pika-pile"
edition = "2018"
[dependencies]
chrono = { version = "0.4", features = ["serde"] }
chrono-humanize = "0.0.11"
ctrlc = { version = "3.1", features = ["termination"] }
gettext-rs = "0.4"
humansize = "1.1"
matches = "0.1"
nix = "0.17"
secret-service = "1.1"
walkdir = "2.3"
zxcvbn = "2.0"
# data types and handling
arc-swap = "0.4"
crossbeam-channel = "0.4"
enclose = "1.1"
once_cell = "1.3"
quick-error = "1.2"
zeroize = "1.1"
# logging
log = "0.4"
pretty_env_logger = "0.4"
syslog = "5.0"
# serde
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
# GNOME
gdk = "0.12"
gio = { version = "0.8", features = ["v2_52"] }
glib = "0.9"
gtk = { version = "0.8", features = ["v3_24"] }
pango = "0.8"
gdk-pixbuf = "0.8"
[dev-dependencies]
This diff is collapsed.
# pika-pile
# Pika Pile Backup
Simple backups based on borg
\ No newline at end of file
Simple backups based on borg
## Build
You need [Rust](https://rustup.rs/) to build Pika Pile
```sh
$ apt install libgtk-3-dev
$ cargo run --release
```
or you can use flatpak
```sh
$ ./build-aux/flatpak-build.bash
```
## Debug
Run with `RUST_LOG` set to debug or trace. For example
```sh
$ RUST_LOG=trace cargo run
```
\ No newline at end of file
#!/bin/sh
export MESON_BUILD_ROOT="$1"
export MESON_SOURCE_ROOT="$2"
export CARGO_TARGET_DIR="$MESON_BUILD_ROOT"/target
export CARGO_HOME="$CARGO_TARGET_DIR"/cargo-home
export OUTPUT="$3"
export BUILDTYPE="$4"
export APP_BIN="$5"
if [[ $BUILDTYPE = "release" ]]
then
echo "RELEASE MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml --release && \
cp "$CARGO_TARGET_DIR"/release/"$APP_BIN" "$OUTPUT"
else
echo "DEBUG MODE"
cargo build --manifest-path \
"$MESON_SOURCE_ROOT"/Cargo.toml --verbose && \
cp "$CARGO_TARGET_DIR"/debug/"$APP_BIN" "$OUTPUT"
fi
---
app-id: de.hemio.PikaPileBackup
build-options:
append-path: /usr/lib/sdk/rust-stable/bin
build-args:
- "--share=network"
env:
CARGO_HOME: /run/build/rust-flatpak/cargo
RUSTFLAGS: "--remap-path-prefix =../"
command: pika-pile
finish-args:
- --filesystem=host
- --share=network
- --socket=wayland
# X11
- --share=ipc
- --socket=x11
- --socket=fallback-x11
# SSH-keys etc
- --socket=ssh-auth
# secrete service (keyring)
- --talk-name=org.freedesktop.secrets
# gio::Device etc
- --talk-name=org.gtk.vfs.*
# fusermount
- --device=all
- --talk-name=org.freedesktop.Flatpak.*
modules:
- name: fusermout
config-opts:
- MOUNT_FUSE_PATH=/app/bin
post-install:
- install fusermount-wrapper.sh /app/bin/fusermount
sources:
- type: archive
url: "https://github.com/libfuse/libfuse/releases/download/fuse-2.9.9/fuse-2.9.9.tar.gz"
"sha256" : d0e69d5d608cc22ff4843791ad097f554dd32540ddc9bed7638cc6fea7c1b4b5
-
type: "file"
path: "fusermount-wrapper.sh"
- name: borg
buildsystem: simple
build-commands:
- install borg /app/bin/borg
sources:
- dest-filename: borg
sha256: 7848d1788b5d7f2ae99a599a87992cab4f01584fe5eb393819fceaecf076433b
type: file
url: "https://github.com/borgbackup/borg/releases/download/1.1.11/borg-linux64"
- name: pika-pile
buildsystem: meson
sources:
- path: ../
type: dir
runtime: org.gnome.Platform
runtime-version: "3.36"
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
#!/bin/bash -x
APP_ID=$(cat data/APPLICATION_ID)
REPO_NAME=pika-pile-dev
REPO_DIR=flatpak_repo
flatpak remove de.hemio.PikaPileBackup -y
flatpak-builder --install-deps-from=https://dl.flathub.org/repo/ \
--user --verbose --force-clean -y --repo=$REPO_DIR flatpak_out build-aux/$APP_ID.yaml
flatpak build-bundle $REPO_DIR $APP_ID.flatpak
flatpak --force remote-delete $REPO_NAME
flatpak --user remote-add --no-gpg-verify $REPO_NAME $REPO_DIR
flatpak --user install -y $REPO_NAME $APP_ID
flatpak run $APP_ID
#!/bin/sh
if [ -z "$_FUSE_COMMFD" ]; then
FD_ARGS=
else
FD_ARGS="--env=_FUSE_COMMFD=${_FUSE_COMMFD} --forward-fd=${_FUSE_COMMFD}"
fi
exec flatpak-spawn --host --forward-fd=1 --forward-fd=2 --forward-fd=3 $FD_ARGS fusermount "$@"
de.hemio.PikaPileBackup
\ No newline at end of file
Pika Pile Backup
[Desktop Entry]
Version=1.0
Type=Application
Name=Pika Pile Backup
Comment=Simple backups based on borg
Categories=System;GTK;
Icon=de.hemio.PikaPileBackup
Exec=pika-pile --syslog
Terminal=false
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>de.hemio.PikaPileBackup</id>
<name>Pika Pile Backup</name>
<summary>Simple backups based on borg</summary>
<metadata_license>CC-BY-SA-4.0</metadata_license>
<project_license>AGPL-3.0</project_license>
<recommends>
<control>pointing</control>
<control>keyboard</control>
<control>touch</control>
</recommends>
<description>
<p>
Remote and local backups with focus on easy usage. Plugin your USB drive and let the Pika do the rest for you.
</p>
</description>
<launchable type="desktop-id">de.hemio.PikaPileBackup.desktop</launchable>
<categories>
<category>System</category>
<category>GTK</category>
</categories>
<provides>
<binary>pika-pile</binary>
</provides>
</component>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="128"
height="128"
viewBox="0 0 33.866666 33.866668"
version="1.1"
id="svg8"
sodipodi:docname="backup.svg"
inkscape:version="0.92.1 r15371"
inkscape:export-filename="/home/herold/Documents/projekte/backup_gui/logo.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs2">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="-31.749998 : 19.05 : 1"
inkscape:vp_y="16.933333 : 1011.2889 : 1"
inkscape:vp_z="24.341665 : 16.933333 : 1"
inkscape:persp3d-origin="16.933333 : 11.288889 : 1"
id="perspective5147" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="50.825035"
inkscape:cy="45.518897"
inkscape:document-units="px"
inkscape:current-layer="layer3"
showgrid="false"
units="px"
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid4487"
dotted="false"
empspacing="4"
spacingx="1.0583333"
spacingy="1.0583333" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-263.13332)">
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#f9f06b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.00507282;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4489"
width="24.983162"
height="13.075397"
x="74.746658"
y="263.83838"
transform="rotate(15)" />
<path
style="fill:#f8e45c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.31180403px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 0.53181251,286.82129 24.663697,293.2874 23.17614,294.2425 1.3425296,288.3922 0.53181251,286.82129"
id="path5179"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffa348;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.00507565;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4489-3"
width="25.15658"
height="12.999783"
x="137.50627"
y="224.72638"
transform="matrix(0.85346445,0.52115106,-0.4802414,0.87713636,0,0)" />
<path
style="fill:#ff7800;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.31180403px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 3.1935209,280.17722 24.66377,293.2876 23.017071,293.80356 3.5916072,281.94178 3.1935209,280.17722"
id="path5179-6"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#9141ac;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.00508131;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4489-7"
width="25.624384"
height="12.790919"
x="192.17017"
y="168.19302"
transform="matrix(0.6769119,0.73606405,-0.67832912,0.73475819,0,0)" />
<path
style="fill:#813d9c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.31180403px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 7.3182477,274.42626 17.3454503,18.8612 -1.693623,0.0417 -15.6935041,-17.06489 0.041677,-1.83798"
id="path5179-5"
inkscape:connector-curvature="0" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Layer 3"
style="display:inline">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#5e5c64;stroke-width:2.64583325;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path5644-3"
sodipodi:type="arc"
sodipodi:cx="23.927631"
sodipodi:cy="19.802265"
sodipodi:rx="10.503097"
sodipodi:ry="14.786987"
sodipodi:start="2.4874655"
sodipodi:end="5.3189689"
sodipodi:open="true"
d="M 15.592591,28.799656 A 10.503097,14.786987 0 0 1 16.326374,9.5977938 10.503097,14.786987 0 0 1 29.915036,7.6532398" />
<path
sodipodi:type="star"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#77767b;fill-opacity:1;fill-rule:evenodd;stroke:#5e5c64;stroke-width:1.58749998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path5654-6"
sodipodi:sides="3"
sodipodi:cx="10.851142"
sodipodi:cy="290.31155"
sodipodi:r1="1.1102549"
sodipodi:r2="1.0433714"
sodipodi:arg1="-1.5788392"
sodipodi:arg2="-0.53164168"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 10.842212,289.20133 0.974873,1.6576 -1.9229561,0.0155 z"
inkscape:transform-center-x="0.49096452"
inkscape:transform-center-y="-0.043532768"
transform="matrix(1.6175421,1.8939506,-1.8939506,1.6175421,546.74708,-463.96175)" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2"
style="display:inline">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#f6f5f4;stroke-width:2.64583325;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:fill markers stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path5644"
sodipodi:type="arc"
sodipodi:cx="23.663048"
sodipodi:cy="18.214748"
sodipodi:rx="10.503097"
sodipodi:ry="14.786987"
sodipodi:start="2.4874655"
sodipodi:end="5.3189689"
sodipodi:open="true"
d="M 15.328007,27.212139 A 10.503097,14.786987 0 0 1 16.06179,8.0102771 10.503097,14.786987 0 0 1 29.650452,6.065723" />
<path
sodipodi:type="star"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#77767b;fill-opacity:1;fill-rule:evenodd;stroke:#f6f5f4;stroke-width:1.58749998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path5654"
sodipodi:sides="3"
sodipodi:cx="10.851142"
sodipodi:cy="290.31155"
sodipodi:r1="1.1102549"
sodipodi:r2="1.0433714"
sodipodi:arg1="-1.5788392"
sodipodi:arg2="-0.53164168"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 10.842212,289.20133 0.974873,1.6576 -1.9229561,0.0155 z"
inkscape:transform-center-x="0.49096452"
inkscape:transform-center-y="-0.043532768"
transform="matrix(1.6175421,1.8939506,-1.8939506,1.6175421,546.48248,-465.54928)" />
</g>
</svg>
datadir = get_option('prefix') / get_option('datadir')
application_id = 'de.hemio.PikaPileBackup'
# Read more https://mesonbuild.com/Reference-manual.html#install_data
install_data(
'@0@.desktop'.format(application_id),
install_dir: datadir / 'applications'
)
install_data(
'@0@.metainfo.xml'.format(application_id),
install_dir: datadir / 'metainfo'
)
install_data(
'@0@.svg'.format(application_id),
install_dir: datadir / 'icons' / 'hicolor' / 'scalable' / 'apps'
)
list.settings {
border: @borders 1px solid;
}
list.settings > row {
border-bottom: @theme_unfocused_bg_color 1px solid;
}
list.settings > row:last-child {
border-bottom: none;
}
list.settings row {
min-height: 60px;
}
list.settings > row > box {
margin: 0px 12px;
}
list.settings row.custom {
min-height: 30px;
}
list.settings.custom {
border: none;
}
levelbar .full {
background-color: #e01b24;
border-color: #c01c27;
}
levelbar .low {
background-color: #33d17a;
border-color: #2fc27e;
}
.small-label {
font-size: 0.9em;
}
.empty-page-hint {
opacity: 0.5;
}
.not-active {
-gtk-icon-effect: dim;
}
list.settings row.activatable:hover image {
-gtk-icon-effect: highlight;
}
.linked-line entry {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.linked-line > button {
border-radius: 0;
border-left: none;
border-right: none;
}
.linked-line * button {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
.circular {
padding: 0;
min-width: 32px;
min-height: 32px;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkAboutDialog" id="dialog">
<property name="can_focus">False</property>
<property name="modal">True</property>
<property name="type_hint">dialog</property>
<property name="program_name">Backup</property>
<property name="copyright">&lt;copyright&gt;</property>
<property name="license" translatable="yes">This program comes with absolutely no warranty.
See the &lt;a href="https://www.gnu.org/licenses/gpl-3.0.html"&gt;GNU General Public License, version 3 or later&lt;/a&gt; for details.</property>
<property name="logo_icon_name"/>
<property name="wrap_license">True</property>
<property name="license_type">gpl-3-0</property>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="titlebar">
<placeholder/>
</child>
</object>
</interface>