Giter Club home page Giter Club logo

docker-snapdrop's Introduction

linuxserver.io

Blog Discord Discourse Fleet GitHub Open Collective

The LinuxServer.io team brings you another container release featuring:

  • regular and timely application updates
  • easy user mappings (PGID, PUID)
  • custom base image with s6 overlay
  • weekly base OS updates with common layers across the entire LinuxServer.io ecosystem to minimise space usage, down time and bandwidth
  • regular security updates

Find us at:

  • Blog - all the things you can do with our containers including How-To guides, opinions and much more!
  • Discord - realtime support / chat with the community and the team.
  • Discourse - post on our community forum.
  • Fleet - an online web interface which displays all of our maintained images.
  • GitHub - view the source for all of our repositories.
  • Open Collective - please consider helping us by either donating or contributing to our budget

Scarf.io pulls GitHub Stars GitHub Release GitHub Package Repository GitLab Container Registry Quay.io Docker Pulls Docker Stars Jenkins Build LSIO CI

Snapdrop A local file sharing in your browser. Inspired by Apple's Airdrop.

snapdrop

Supported Architectures

We utilise the docker manifest for multi-platform awareness. More information is available from docker here and our announcement here.

Simply pulling lscr.io/linuxserver/snapdrop:latest should retrieve the correct image for your arch, but you can also pull specific arch images via tags.

The architectures supported by this image are:

Architecture Available Tag
x86-64 amd64-<version tag>
arm64 arm64v8-<version tag>
armhf

Application Setup

Webui is accessible at http://SERVERIP:PORT

Usage

To help you get started creating a container from this image you can either use docker-compose or the docker cli.

docker-compose (recommended, click here for more info)

---
services:
  snapdrop:
    image: lscr.io/linuxserver/snapdrop:latest
    container_name: snapdrop
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - /path/to/snapdrop/config:/config
    ports:
      - 80:80
      - 443:443
    restart: unless-stopped
docker run -d \
  --name=snapdrop \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -p 80:80 \
  -p 443:443 \
  -v /path/to/snapdrop/config:/config \
  --restart unless-stopped \
  lscr.io/linuxserver/snapdrop:latest

Parameters

Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate <external>:<internal> respectively. For example, -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080 outside the container.

Parameter Function
-p 80 http gui
-p 443 https gui
-e PUID=1000 for UserID - see below for explanation
-e PGID=1000 for GroupID - see below for explanation
-e TZ=Etc/UTC specify a timezone to use, see this list.
-v /config Persistent config files

Environment variables from files (Docker secrets)

You can set any environment variable from a file by using a special prepend FILE__.

As an example:

-e FILE__MYVAR=/run/secrets/mysecretvariable

Will set the environment variable MYVAR based on the contents of the /run/secrets/mysecretvariable file.

Umask for running applications

For all of our images we provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022 setting. Keep in mind umask is not chmod it subtracts from permissions based on it's value it does not add. Please read up here before asking for support.

User / Group Identifiers

When using volumes (-v flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.

In this instance PUID=1000 and PGID=1000, to find yours use id your_user as below:

id your_user

Example output:

uid=1000(your_user) gid=1000(your_user) groups=1000(your_user)

Docker Mods

Docker Mods Docker Universal Mods

We publish various Docker Mods to enable additional functionality within the containers. The list of Mods available for this image (if any) as well as universal mods that can be applied to any one of our images can be accessed via the dynamic badges above.

Support Info

  • Shell access whilst the container is running:

    docker exec -it snapdrop /bin/bash
  • To monitor the logs of the container in realtime:

    docker logs -f snapdrop
  • Container version number:

    docker inspect -f '{{ index .Config.Labels "build_version" }}' snapdrop
  • Image version number:

    docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/snapdrop:latest

Updating Info

Most of our images are static, versioned, and require an image update and container recreation to update the app inside. With some exceptions (noted in the relevant readme.md), we do not recommend or support updating apps inside the container. Please consult the Application Setup section above to see if it is recommended for the image.

Below are the instructions for updating containers:

Via Docker Compose

  • Update images:

    • All images:

      docker-compose pull
    • Single image:

      docker-compose pull snapdrop
  • Update containers:

    • All containers:

      docker-compose up -d
    • Single container:

      docker-compose up -d snapdrop
  • You can also remove the old dangling images:

    docker image prune

Via Docker Run

  • Update the image:

    docker pull lscr.io/linuxserver/snapdrop:latest
  • Stop the running container:

    docker stop snapdrop
  • Delete the container:

    docker rm snapdrop
  • Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your /config folder and settings will be preserved)

  • You can also remove the old dangling images:

    docker image prune

Image Update Notifications - Diun (Docker Image Update Notifier)

tip: We recommend Diun for update notifications. Other tools that automatically update containers unattended are not recommended or supported.

Building locally

If you want to make local modifications to these images for development purposes or just to customize the logic:

git clone https://github.com/linuxserver/docker-snapdrop.git
cd docker-snapdrop
docker build \
  --no-cache \
  --pull \
  -t lscr.io/linuxserver/snapdrop:latest .

The ARM variants can be built on x86_64 hardware using multiarch/qemu-user-static

docker run --rm --privileged multiarch/qemu-user-static:register --reset

Once registered you can define the dockerfile to use with -f Dockerfile.aarch64.

Versions

  • 06.02.24: - Existing users should update: site-confs/default.conf - Cleanup default site conf.
  • 23.12.23: - Rebase to Alpine 3.19 with php 8.3.
  • 25.05.23: - Rebase to Alpine 3.18, deprecate armhf.
  • 13.04.23: - Move ssl.conf include to default.conf.
  • 20.01.23: - Rebase to alpine 3.17 with php8.1.
  • 20.08.22: - Rebasing to alpine 3.15 with php8. Restructure nginx configs (see changes announcement).
  • 09.08.21: - Rebase to Alpine 3.14. Add real_ip block to nginx default site config.
  • 15.09.20: - Initial Release.

docker-snapdrop's People

Contributors

alex-phillips avatar erwyn avatar nemchik avatar roxedus avatar thelamer avatar thespad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-snapdrop's Issues

[BUG] <real_ip settings>

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hi, from the discord chat i am opening an issue here as requested
"hi, i want to ask for snapdrop it says on the guide "If you intend to expose Snapdrop to the internet, edit /config/nginx/site-confs/default.conf and uncomment the real_ip settings" but when i go to this file, it doesn't have anything with real_ip in it. I run it on ubuntu 22.10 with docker compose on portainer if that matters, is it in another file?"

Kind regards,
George

Expected Behavior

To isolate the site to local sharing and not internet sharing

Steps To Reproduce

Install docker compose
Install portainer
Deploy snapdrop as docker compose
make a domain in NPM and make it FQDN
visit that url from various locations and you will see all devices connected there instead of the local ones

Environment

- OS: Ubuntu 22.10 server
- How docker service was installed:
curl -fsSL https://get.docker.com/ -o get-docker.sh
chmod +x get-docker.sh
sh get-docker.sh

CPU architecture

x86-64

Docker creation

version: "2.1"
services:
  snapdrop:
    image: lscr.io/linuxserver/snapdrop:latest
    container_name: snapdrop
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Athens
    volumes:
      - /opt/snapdrop:/config
    restart: unless-stopped

Container logs

Logo
Home
local

Dashboard
App Templates

Stacks
Containers
Images
Networks
Volumes
Events
Host

Settings
Users

Environments

Registries
Licenses
Authentication logs

Notifications
Settings

©
Portainer Business Edition
2.17.0
Containers>snapdrop>Logs
Container logs


admin
Logs
Search...

Filter search results
Auto refresh
Fetch

All logs
Lines
1000

Show timestamp

Show line numbers

Wrap line
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid:    1000
User gid:    1000
-------------------------------------
Setting resolver to  127.0.0.11
Setting worker_processes to 4
generating self-signed keys in /config/keys, you can replace these with your own keys if required
..........+........+....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...........+.....+......+.+...+.....+.+.....+.+......+..+...+.......+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+.......................+.+..................+..+........................+.........+................+.....+............+....+...+.....+............+....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...+.........+..+....+.....+.........+.+.....+...+.+.................+...+....+..+.+............+.................+...+......+.......+...+..+.......+...+..+.+...........+.............+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+...+.....+...+...+....+..+...+......+......+...+.......+...+..+.............+......+.....+....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*....+...+..+...+.+.....+.+..............+.+...+......+...........+....+..+....+...+.................+......+.........+.+.................+..................+....+...+...........+.+........+.......+.....+.........+......+.+.....+............+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
[custom-init] No custom files found, skipping...

Upgrade Required - nginx

I get the following error now:

_Upgrade Required!

The application inside this image has been moved to a new folder.

You will need to update your /config/nginx/nginx.conf and /config/nginx/site-confs/default.conf in order for the application to work.

New config samples are located at /config/nginx/nginx.conf.sample and /config/nginx/site-confs/default.conf.sample

Please review our announcement: Significant changes to nginx based images_

[BUG] nginx socket() fails when ipv6 disabled

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Running the docker container when ipv6 is disabled by the kernel gives: nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol).

Specifically ipv6 was disabled by sudo grubby --args=ipv6.disable=1 --update-kernel=ALL on Fedora 39.

Expected Behavior

It should work just like when ipv6 is enabled.

Steps To Reproduce

  1. Disable ipv6 via sudo grubby --args=ipv6.disable=1 --update-kernel=ALL on Fedora 39 and in docker daemon via {"ipv6": false} in /etc/docker/daemon.json then reboot
  2. docker compose up snapdrop given the compose file below

Environment

- OS: Fedora 39
- How docker service was installed: sudo dnf install docker

CPU architecture

x86-64

Docker creation

From my docker-compose.yml:

  snapdrop:
    image: "lscr.io/linuxserver/snapdrop:latest"
    container_name: "snapdrop"
    restart: always
    ports:
      - 1180:80
    environment:
      - PUID=${SNAPDROP_UID}
      - PGID=${SNAPDROP_GID}
      - TZ=${USER_TZ}
    volumes:
      - ${CONFIG}/snapdrop:/config

Where ${CONFIG}/snapdrop is a valid path on my host system

Container logs

$ docker compose up snapdrop
[+] Running 1/0
 ✔ Container snapdrop  Created                                                                                       0.0s
Attaching to snapdrop
snapdrop  | [migrations] started
snapdrop  | [migrations] 01-nginx-site-confs-default: skipped
snapdrop  | [migrations] 02-default-location: skipped
snapdrop  | [migrations] done
snapdrop  | usermod: no changes
snapdrop  | ───────────────────────────────────────
snapdrop  |
snapdrop  |       ██╗     ███████╗██╗ ██████╗
snapdrop  |       ██║     ██╔════╝██║██╔═══██╗
snapdrop  |       ██║     ███████╗██║██║   ██║
snapdrop  |       ██║     ╚════██║██║██║   ██║
snapdrop  |       ███████╗███████║██║╚██████╔╝
snapdrop  |       ╚══════╝╚══════╝╚═╝ ╚═════╝
snapdrop  |
snapdrop  |    Brought to you by linuxserver.io
snapdrop  | ───────────────────────────────────────
snapdrop  |
snapdrop  | To support LSIO projects visit:
snapdrop  | https://www.linuxserver.io/donate/
snapdrop  |
snapdrop  | ───────────────────────────────────────
snapdrop  | GID/UID
snapdrop  | ───────────────────────────────────────
snapdrop  |
snapdrop  | User UID:    1006
snapdrop  | User GID:    1006
snapdrop  | ───────────────────────────────────────
snapdrop  |
snapdrop  | using keys found in /config/keys
snapdrop  | [custom-init] No custom files found, skipping...
snapdrop  | [ls.io-init] done.
snapdrop  | nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
snapdrop  | Snapdrop is running on port 3000
snapdrop  | nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
snapdrop  | nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
snapdrop  | nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
snapdrop  | nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)

[BUG] php-fpm is not required

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

the php-fpm is up with the container.

Expected Behavior

drop the php-fpm service.

Steps To Reproduce

  1. docker-compose.yml
    ---
    version: "2.1"
    services:
      snapdrop:
        image: lscr.io/linuxserver/snapdrop:latest
        container_name: snapdrop
        restart: always
        environment:
          - PUID=1000
          - PGID=1000
          - TZ=Etc/UTC
  1. docker compose up -d
  2. docker compose exec snapdrop ps -aux

Environment

No response

CPU architecture

arm64

Docker creation

---
      version: "2.1"
      services:
        snapdrop:
          image: lscr.io/linuxserver/snapdrop:latest
          container_name: snapdrop
          restart: always
          environment:
            - PUID=1000
            - PGID=1000
            - TZ=Etc/UTC

Container logs

USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.1  0.0    200    64 ?        Ss   06:24   0:00 /package/admi
root          15  0.0  0.0    204    68 ?        S    06:24   0:00 s6-supervise 
root          17  0.0  0.0    192     4 ?        Ss   06:24   0:00 /package/admi
root          38  0.0  0.0    204    68 ?        S    06:24   0:00 s6-supervise 
root          39  0.0  0.0    204    68 ?        S    06:24   0:00 s6-supervise 
root          40  0.0  0.0    204    64 ?        S    06:24   0:00 s6-supervise 
root          41  0.0  0.0    204    64 ?        S    06:24   0:00 s6-supervise 
root          42  0.0  0.0    204    68 ?        S    06:24   0:00 s6-supervise 
root          43  0.0  0.0    204    68 ?        S    06:24   0:00 s6-supervise 
root          51  0.0  0.0    180    48 ?        Ss   06:24   0:00 /package/admi
abc          235  2.0  0.2 243780 49760 ?        Ssl  06:24   0:00 /usr/bin/node
root         236  0.2  0.0  33732 14796 ?        Ss   06:24   0:00 php-fpm: mast
root         239  0.0  0.0   1692   984 ?        Ss   06:24   0:00 /usr/sbin/cro
root         241  0.1  0.0  18100  6328 ?        Ss   06:24   0:00 nginx: master
abc          251  0.0  0.0  18548  2608 ?        S    06:24   0:00 nginx: worker
abc          252  0.0  0.0  18548  2608 ?        S    06:24   0:00 nginx: worker
abc          253  0.0  0.0  18548  2608 ?        S    06:24   0:00 nginx: worker
abc          254  0.0  0.0  18548  2236 ?        S    06:24   0:00 nginx: worker
abc          265  0.0  0.0  33740  3504 ?        S    06:24   0:00 php-fpm: pool
abc          266  0.0  0.0  33740  3504 ?        S    06:24   0:00 php-fpm: pool
root         277 33.3  0.0   3200  2280 pts/0    Rs+  06:24   0:00 ps -aux

additional settings for nginx reverse proxy

to get the program working stable you need some settings for a (nginx) reverse proxy. maybe they are usefull for other users.

proxy_pass http://localhost:port;          # adjust ip instead of localhost and port
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-for $remote_addr;

Can't see other devices within subnet using provided docker-compose yml snippet

linuxserver.io


Expected Behavior

Be able to define specific external ports for the container and have devices be able to see each other when they have navigated to the snapdrop page.

Current Behavior

Have never been able to see another device. I originally pulled this back at the beginning of 2021. The logs below are from the latest container pull after clearing the contents of the '/config' data locally. It doesn't matter if devices are both wired, wireless, or any combination thereof. There is absolutely nothing unusual or unique about the basic home network I'm trying to use this on. As others have noted, I can open a second browser or tab on the same host and see the additional 'device name' there and successfully send a file to the other instance of that device.

Also reported in discord here and a few other places: https://discord.com/channels/354974912613449730/506925392603512839/925594810075738134

Steps to Reproduce

  1. Install docker-ce, docker-compose, and all reqs as documented by official docker documentation
  2. Use the compose snippet documented by this repo within its readme.md
  3. Pull image and bring up container
  4. Navigate to the defined http or https port at the external IP of the armv7l device running the container. (In my case this is 192.168.1.2)
  5. snapdrop page should load fine and tell the user what its given "device name" is but no other devices are seen.

Environment

OS: Raspberry Pi OS (uname -a: Linux raspberrypi 5.10.63-v7l+ #1496 SMP Wed Dec 1 15:58:56 GMT 2021 armv7l GNU/Linux)
CPU architecture: arm32
How docker service was installed: From the official repo, following the official instructions. Currently installed version of docker-ce: 5:20.10.123-0raspbian-buster

Command used to create docker container (run/create/compose/screenshot)

Using the same compose output as described in the readme.md save for my own port mapping:

  snapdrop:
    image: ghcr.io/linuxserver/snapdrop
    container_name: snapdrop
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
    volumes:
      - /mnt/storage/docker/appdata/snapdrop:/config
    ports:
      - 8091:80
      - 8092:443
    restart: unless-stopped

Docker logs

pi@raspberrypi:~ $ docker logs snapdrop
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
generating self-signed keys in /config/keys, you can replace these with your own keys if required
Generating a RSA private key
........................+++++
...+++++
writing new private key to '/config/keys/cert.key'
-----
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing...
[cont-init.d] 50-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Snapdrop is running on port 3000
pi@raspberrypi:~ $

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.