add mega
This commit is contained in:
parent
b500d3dc0a
commit
6df10b77ab
|
@ -1,25 +1,36 @@
|
|||
FROM debian:stable-slim
|
||||
RUN dpkg --add-architecture armhf
|
||||
RUN ["/bin/apt-get", "update"]
|
||||
RUN apt-get update
|
||||
# get neccessary files
|
||||
RUN apt-get -y install wget golang-go fish ffmpeg
|
||||
RUN apt-get -y install wget golang-go fish opus-tools dbus
|
||||
RUN dbus-uuidgen > /etc/machine-id
|
||||
RUN wget http://http.us.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_armhf.deb && apt-get -y install "$PWD/libssl1.1_1.1.1w-0+deb11u1_armhf.deb"
|
||||
RUN wget https://mega.nz/linux/repo/Raspbian_11/armhf/megacmd-Raspbian_11_armhf.deb && apt-get -y install "$PWD/megacmd-Raspbian_11_armhf.deb"
|
||||
# golf
|
||||
RUN mkdir /root/golf
|
||||
COPY convert/main.go main.go
|
||||
COPY convert/go.mod go.mod
|
||||
RUN mkdir -p /root/golf
|
||||
WORKDIR /root/golf
|
||||
ADD flac2opus/golf/main.go main.go
|
||||
ADD flac2opus/golf/go.mod go.mod
|
||||
RUN go mod tidy
|
||||
RUN go build .
|
||||
ENV PATH "$PATH:root/golf"
|
||||
# sync
|
||||
RUN mkdir /root/sync
|
||||
WORKDIR /root/sync
|
||||
RUN mkdir .megaCmd
|
||||
RUN cp golf /usr/bin/golf
|
||||
# gold
|
||||
RUN mkdir -p /root/gold
|
||||
WORKDIR /root/gold
|
||||
ADD flac2opus/gold/main.go main.go
|
||||
ADD flac2opus/gold/go.mod go.mod
|
||||
RUN go mod tidy
|
||||
RUN go build .
|
||||
RUN cp gold /usr/bin/gold
|
||||
# sync files
|
||||
WORKDIR /
|
||||
RUN mkdir -p /root/.megaCmd
|
||||
ADD .megaCmd/* /root/.megaCmd
|
||||
RUN mkdir music
|
||||
RUN mkdir music-opus
|
||||
# root
|
||||
WORKDIR /root
|
||||
COPY convert/convert.fish convert.fish
|
||||
RUN mkdir -p /root/sync/music
|
||||
RUN mkdir -p /root/sync/music-opus
|
||||
COPY flac2opus/convert.fish /root/convert.fish
|
||||
RUN mega-sync /root/sync/music Music/
|
||||
RUN mega-sync /root/sync/music-opus Music-opus/
|
||||
RUN chmod +x /root/convert.fish
|
||||
WORKDIR /root/
|
||||
CMD mega-cmd-server
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 0f016c305c39c397a288aec51b4b71899f90fcee
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 1041495f6a371fad2aaee33abb962a5a3c4c0d13
|
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description="runs a .flac to .opus conversion script in mega container"
|
||||
Wants=convert.timer
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/usr/bin/podman exec -i -d mega ./convert.fish sync/music sync/music-opus
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Run convert.service 30 minutes after boot and daily.
|
||||
|
||||
[Timer]
|
||||
OnBootSec=30m
|
||||
OnUnitActiveSec=1d
|
||||
Persistent=true
|
||||
Unit=convert.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 1041495f6a371fad2aaee33abb962a5a3c4c0d13
|
|
@ -0,0 +1,20 @@
|
|||
[Unit]
|
||||
Description=mega.service
|
||||
Wants=network-online.target
|
||||
After=NetworkManager.service network.target network-online.target
|
||||
RequiresMountsFor=/var/lib/containers/storage /var/run/containers/storage
|
||||
|
||||
# %E is "the XDG_CONFIG path"
|
||||
|
||||
[Service]
|
||||
Environment=PODMAN_SYSTEMD_UNIT=%n
|
||||
Restart=on-failure
|
||||
TimeoutStopSec=70
|
||||
ExecStart=/usr/bin/podman run -d --name=mega -v mega-data:/root/sync localhost/mega
|
||||
ExecStop=/usr/bin/podman stop mega
|
||||
ExecStopPost=/usr/bin/podman rm mega
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
Loading…
Reference in New Issue