Compare commits
9 Commits
313dacf0f9
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
75fe5da1d8 | ||
68a14fa619 | |||
cf97345a0c | |||
8a2944d59b | |||
b7c5a18c12 | |||
da48480ab8 | |||
f6a2e8277f | |||
b7db53d93c | |||
1baba1d841 |
18
Dockerfile
18
Dockerfile
@@ -0,0 +1,18 @@
|
||||
FROM ubuntu:19.10
|
||||
|
||||
RUN apt-get update && apt-get install -y curl ca-certificates
|
||||
RUN adduser --disabled-password --gecos '' mega && adduser mega sudo && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
RUN curl -k -o /megacmd.deb https://mega.nz/linux/MEGAsync/xUbuntu_19.10/amd64/megacmd-xUbuntu_19.10_amd64.deb
|
||||
RUN apt install -y ./megacmd.deb
|
||||
|
||||
ADD entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
WORKDIR /home/mega
|
||||
|
||||
USER mega
|
||||
|
||||
ENV PASSWORD=
|
||||
ENV EMAIL=
|
||||
|
||||
CMD /entrypoint.sh
|
||||
|
18
Dockerfile.armhf
Normal file
18
Dockerfile.armhf
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM ubuntu:19.10
|
||||
|
||||
RUN apt-get update && apt-get install -y curl ca-certificates
|
||||
RUN adduser --disabled-password --gecos '' mega && adduser mega sudo && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||
RUN curl -k -o /megacmd.deb https://mega.nz/linux/MEGAsync/Raspbian_10.0/armhf/megacmd-Raspbian_10.0_armhf.deb
|
||||
RUN apt install -y ./megacmd.deb
|
||||
|
||||
ADD entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
WORKDIR /home/mega
|
||||
|
||||
USER mega
|
||||
|
||||
ENV PASSWORD=
|
||||
ENV EMAIL=
|
||||
|
||||
CMD /entrypoint.sh
|
46
Makefile
46
Makefile
@@ -1,6 +1,8 @@
|
||||
.DEFAULT_GOAL := default
|
||||
|
||||
IMAGE ?= docker.cloud.cluster.fun/private/REPO_NAME_LOWER:latest
|
||||
IMAGE ?= docker.cluster.fun/averagemarcus/megasync:latest
|
||||
|
||||
export DOCKER_CLI_EXPERIMENTAL=enabled
|
||||
|
||||
.PHONY: test # Run all tests, linting and format checks
|
||||
test: lint check-format run-tests
|
||||
@@ -8,58 +10,56 @@ test: lint check-format run-tests
|
||||
.PHONY: lint # Perform lint checks against code
|
||||
lint:
|
||||
@echo "⚠️ 'lint' unimplemented"
|
||||
# GO Projects
|
||||
# @go vet && golint -set_exit_status ./...
|
||||
|
||||
.PHONY: check-format # Checks code formatting and returns a non-zero exit code if formatting errors found
|
||||
check-format:
|
||||
@echo "⚠️ 'check-format' unimplemented"
|
||||
# GO Projects
|
||||
# @gofmt -e -l .
|
||||
|
||||
.PHONY: format # Performs automatic format fixes on all code
|
||||
format:
|
||||
@echo "⚠️ 'format' unimplemented"
|
||||
# GO Projects
|
||||
# @gofmt -s -w .
|
||||
|
||||
.PHONY: run-tests # Runs all tests
|
||||
run-tests:
|
||||
@echo "⚠️ 'run-tests' unimplemented"
|
||||
# GO Projects
|
||||
# @go test
|
||||
# Node Projects
|
||||
# @npm test
|
||||
|
||||
.PHONY: fetch-deps # Fetch all project dependencies
|
||||
fetch-deps:
|
||||
@echo "⚠️ 'fetch-deps' unimplemented"
|
||||
# GO Projects
|
||||
# @go mod tidy
|
||||
# Node Projects
|
||||
# @npm install
|
||||
|
||||
.PHONY: build # Build the project
|
||||
build: lint check-format fetch-deps
|
||||
@echo "⚠️ 'build' unimplemented"
|
||||
# GO Projects
|
||||
# @go build -o PROJECT_NAME main.go
|
||||
|
||||
.PHONY: docker-build # Build the docker image
|
||||
docker-build:
|
||||
@docker build -t $(IMAGE) .
|
||||
@docker buildx create --use --name=crossplat --node=crossplat && \
|
||||
docker buildx build \
|
||||
--output "type=docker,push=false" \
|
||||
--tag $(IMAGE) \
|
||||
.
|
||||
|
||||
.PHONY: docker-publish # Push the docker image to the remote registry
|
||||
docker-publish:
|
||||
@docker push $(IMAGE)
|
||||
@docker buildx create --use --name=crossplat --node=crossplat && \
|
||||
docker buildx build \
|
||||
--output "type=image,push=true" \
|
||||
--tag $(IMAGE) \
|
||||
.
|
||||
|
||||
.PHONY: docker-publish-arm # Build and push the armhf image (needs to be built on ARM hardware)
|
||||
docker-publish-arm:
|
||||
@docker buildx create --use --name=crossplat --node=crossplat && \
|
||||
docker buildx build \
|
||||
--file Dockerfile.armhf \
|
||||
--platform linux/arm/7 \
|
||||
--output "type=image,push=true" \
|
||||
--tag $(IMAGE)-armhf \
|
||||
.
|
||||
|
||||
.PHONY: run # Run the application
|
||||
run:
|
||||
@echo "⚠️ 'run' unimplemented"
|
||||
# GO Projects
|
||||
# @go run main.go
|
||||
# Node Projects
|
||||
# @npm start
|
||||
|
||||
.PHONY: ci # Perform CI specific tasks to perform on a pull request
|
||||
ci:
|
||||
|
17
README.md
17
README.md
@@ -1,14 +1,20 @@
|
||||
# megasync
|
||||
|
||||
Run mega-sync as a Docker image
|
||||
Run [mega-sync](https://mega.nz/sync) as a Docker image
|
||||
|
||||
## Features
|
||||
|
||||
## Install
|
||||
* Keeps your MEGASync directory in your Mega account in sync with the `/home/mega` directory in the container
|
||||
|
||||
```sh
|
||||
## Usage
|
||||
|
||||
```
|
||||
docker run -d \
|
||||
-e EMAIL=YOUR_MEGA_ACCOUNT_EMAIL \
|
||||
-e PASSWORD=YOUR_MEGA_PASSWORD \
|
||||
-v /path/to/sync:/home/mega \
|
||||
docker.cluster.fun/averagemarcus/megasync
|
||||
```
|
||||
|
||||
## Building from source
|
||||
|
||||
@@ -26,9 +32,12 @@ make build
|
||||
|
||||
## Resources
|
||||
|
||||
* [mega-sync](https://mega.nz/sync)
|
||||
* [MEGAcmd](https://github.com/meganz/MEGAcmd)
|
||||
|
||||
## Contributing
|
||||
|
||||
If you find a bug or have an idea for a new feature please [raise an issue](/AverageMarcus/megasync/issues/new) to discuss it.
|
||||
If you find a bug or have an idea for a new feature please raise an issue to discuss it.
|
||||
|
||||
Pull requests are welcomed but please try and follow similar code style as the rest of the project and ensure all tests and code checkers are passing.
|
||||
|
||||
|
4
entrypoint.sh
Normal file
4
entrypoint.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
mega-login ${EMAIL} ${PASSWORD}
|
||||
mega-sync ./ /MEGAsync
|
||||
cat
|
Reference in New Issue
Block a user