forked from robinrodricks/FluentFTP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docker servers, docker system, new FluentFTPServer
- Loading branch information
1 parent
f69fcb9
commit edfb3af
Showing
56 changed files
with
3,458 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ HTML | |
API_Reference_CHM.shfbproj_jp | ||
.DS_Store | ||
.vs | ||
|
||
FluentFTP.Tests/testdata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
using System; | ||
using FluentFTP.Helpers; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Diagnostics; | ||
using System.Net; | ||
using Xunit; | ||
using Xunit.Sdk; | ||
|
||
namespace FluentFTP.Tests { | ||
public class ServerTests { | ||
|
||
[Fact] | ||
public void FileUpload() { | ||
|
||
FtpClient client = new FtpClient("localhost", 21, ); | ||
client.AutoConnect(); | ||
|
||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
docker build crushftp -t crushftp:fluentftp | ||
|
||
docker build filezilla -t filezilla1:fluentftp | ||
|
||
docker build glftpd -t glftpd:fluentftp | ||
|
||
docker build proftpd -t proftpd:fluentftp | ||
|
||
docker build pureftpd -t pureftpd:fluentftp | ||
|
||
docker build vsftpd -t vsftpd:fluentftp | ||
|
||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM microblink/java:latest | ||
MAINTAINER MarkusMcNugen | ||
# Forked from shokinn | ||
|
||
RUN apk upgrade --no-cache \ | ||
&& apk --no-cache add bash bash-completion bash-doc ca-certificates curl wget \ | ||
&& update-ca-certificates | ||
|
||
RUN wget -O /tmp/CrushFTP10.zip https://www.crushftp.com/early10/CrushFTP10.zip | ||
ADD ./setup.sh /var/opt/setup.sh | ||
|
||
RUN chmod +x /var/opt/setup.sh | ||
|
||
VOLUME [ "/var/opt/CrushFTP10" ] | ||
|
||
ENTRYPOINT [ "/bin/bash", "/var/opt/setup.sh" ] | ||
CMD ["-c"] | ||
|
||
HEALTHCHECK --interval=1m --timeout=3s \ | ||
CMD curl -f ${CRUSH_ADMIN_PROTOCOL}://localhost:${CRUSH_ADMIN_PORT}/favivon.ico -H 'Connection: close' || exit 1 | ||
|
||
ENV CRUSH_ADMIN_PROTOCOL http | ||
ENV CRUSH_ADMIN_PORT 8080 | ||
|
||
EXPOSE 21 443 2000-2100 2222 8080 9090 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Dennis Dalstrøm | ||
Copyright (c) 2020 Philip Henning | ||
Copyright (c) 2021 Mark Newton | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[preview]: https://raw.githubusercontent.com/MarkusMcNugen/docker-templates/master/crushftp10/crushftp.png "CrushFTP Logo" | ||
|
||
![alt text][preview] | ||
|
||
# CrushFTP 10 | ||
|
||
Share your files securely with FTP, Implicit FTPS, SFTP, HTTP, or HTTPS using CrushFTP | ||
|
||
## Docker Features | ||
* Base: Alpine 3.12 Linux (microblink/java) | ||
* CrushFTP 10 | ||
* Size: 234.8MB | ||
|
||
This container is distributed under the [MIT Licence](LICENSE). | ||
|
||
# Volumes, Paths, Ports, and Envrionmental Variables | ||
## Volumes | ||
| Volume | Required | Function | Example | | ||
|----------|----------|----------|----------| | ||
| `/var/opt/CrushFTP10` | Yes | Persistent storage for CrushFTP config | `/your/config/path/:/var/opt/CrushFTP10`| | ||
| `/mnt/FTP/Shared` | No | Shared host folder for file sharing with users | `/your/host/path/:/mnt/FTP/Shared`| | ||
|
||
* You can add as many volumes as you want between host and the container and change their mount location within the container. You will configure individual folder access and permissions for each user in CrushFTPs User Manager. The "/mnt/FTP/Shared" in the table above is just one such example. | ||
|
||
## Ports | ||
| Port | Proto | Required | Function | Example | | ||
|----------|----------|----------|----------|----------| | ||
| `21` | TCP | Yes | FTP Port | `21:21`| | ||
| `443` | TCP | Yes | HTTPS Port | `443:443`| | ||
| `2000-2100` | TCP | Yes | Passive FTP Ports | `2000-2100:2000-2100`| | ||
| `2222` | TCP | Yes | SFTP Port | `2222:2222`| | ||
| `8080` | TCP | Yes | HTTP Port | `8080:8080`| | ||
| `9090` | TCP | Yes | HTTP Alt Port | `9090:9090`| | ||
|
||
* If you wish to run certain protocols on different ports you will need to change these to match the CrushFTP config. If you enable implicit or explicit FTPS those ports will also need to be opened. | ||
|
||
## Environment Variables | ||
| Variable | Description | Default | | ||
|:-----------------------|:--------------------------|:-------------| | ||
| `CRUSH_ADMIN_USER` | Admin user of CrushFTP | `crushadmin` | | ||
| `CRUSH_ADMIN_PASSWORD` | Password for admin user | `crushadmin` | | ||
| `CRUSH_ADMIN_PROTOCOL` | Protocol for health cecks | `http` | | ||
| `CRUSH_ADMIN_PORT` | Port for health cecks | `8080` | | ||
|
||
# Installation | ||
Run this container and mount the containers `/var/opt/CrushFTP10` volume to the host to keep CrushFTP's configuration persistent. Open a browser and go to `http://<IP>:8080`. Note that the default username and password are both `crushadmin` unless the default environment variables are changed. | ||
|
||
This command will create a new container and expose all ports. Remember to change the `<volume>` to a location on your host machine. | ||
|
||
``` | ||
docker run -p 21:21 -p 443:443 -p 2000-2100:2000-2100 -p 2222:2222 -p 8080:8080 -p 9090:9090 -v <volume>:/var/opt/CrushFTP10 markusmcnugen/crushftp:latest | ||
``` | ||
|
||
# CrushFTP Configuration | ||
Visit the [CrushFTP 10 Wiki](https://www.crushftp.com/crush10wiki/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env bash | ||
|
||
CRUSH_FTP_BASE_DIR="/var/opt/CrushFTP10" | ||
|
||
if [[ -f /tmp/CrushFTP10.zip ]] ; then | ||
echo "Unzipping CrushFTP..." | ||
unzip -o -q /tmp/CrushFTP10.zip -d /var/opt/ | ||
rm -f /tmp/CrushFTP10.zip | ||
fi | ||
|
||
if [ -z ${CRUSH_ADMIN_USER} ]; then | ||
CRUSH_ADMIN_USER=crushadmin | ||
fi | ||
|
||
if [ -z ${CRUSH_ADMIN_PASSWORD} ] && [ -f ${CRUSH_FTP_BASE_DIR}/admin_user_set ]; then | ||
CRUSH_ADMIN_PASSWORD="NOT DISPLAYED!" | ||
elif [ -z ${CRUSH_ADMIN_PASSWORD} ] && [ ! -f ${CRUSH_FTP_BASE_DIR}/admin_user_set ]; then | ||
CRUSH_ADMIN_PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) | ||
fi | ||
|
||
if [ -z ${CRUSH_ADMIN_PROTOCOL} ]; then | ||
CRUSH_ADMIN_PROTOCOL=http | ||
fi | ||
|
||
if [ -z ${CRUSH_ADMIN_PORT} ]; then | ||
CRUSH_ADMIN_PORT=8080 | ||
fi | ||
|
||
if [[ ! -d ${CRUSH_FTP_BASE_DIR}/users/MainUsers/${CRUSH_ADMIN_USER} ]] || [[ -f ${CRUSH_FTP_BASE_DIR}/admin_user_set ]] ; then | ||
echo "Creating default admin..." | ||
cd ${CRUSH_FTP_BASE_DIR} && java -jar ${CRUSH_FTP_BASE_DIR}/CrushFTP.jar -a "${CRUSH_ADMIN_USER}" "${CRUSH_ADMIN_PASSWORD}" | ||
touch ${CRUSH_FTP_BASE_DIR}/admin_user_set | ||
fi | ||
|
||
chmod +x crushftp_init.sh | ||
${CRUSH_FTP_BASE_DIR}/crushftp_init.sh start | ||
|
||
until [ -f prefs.XML ] | ||
do | ||
sleep 1 | ||
done | ||
|
||
echo "########################################" | ||
echo "# User: ${CRUSH_ADMIN_USER}" | ||
echo "# Password: ${CRUSH_ADMIN_PASSWORD}" | ||
echo "########################################" | ||
|
||
while true; do sleep 86400; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# | ||
# Drone pipeline to build Docker image. | ||
# | ||
|
||
kind: pipeline | ||
type: docker | ||
name: default | ||
|
||
steps: | ||
|
||
- name: build-only | ||
image: plugins/docker | ||
settings: | ||
repo: ${DRONE_REPO_NAMESPACE}/${DRONE_REPO_NAME##docker-} | ||
build_args: | ||
- DOCKER_IMAGE_VERSION=drone-ci | ||
dry_run: true | ||
when: | ||
ref: | ||
exclude: | ||
- refs/tags/v* | ||
|
||
- name: set-docker-tags | ||
image: alpine | ||
commands: | ||
# Always tag the Docker image with the Git tag (i.e. vX.Y.Z). | ||
- printf "${DRONE_TAG}" >> .tags | ||
# Tag the Docker image with with 'latest' only if not a prerelease. | ||
- printf "${DRONE_TAG}" | grep -q '-' || printf ",latest" >> .tags | ||
when: | ||
ref: | ||
- refs/tags/v* | ||
|
||
- name: build-and-push | ||
image: plugins/docker | ||
settings: | ||
repo: ${DRONE_REPO_NAMESPACE}/${DRONE_REPO_NAME##docker-} | ||
username: | ||
from_secret: dockerhub_username | ||
password: | ||
from_secret: dockerhub_password | ||
build_args: | ||
- DOCKER_IMAGE_VERSION=${DRONE_TAG:1} | ||
when: | ||
ref: | ||
- refs/tags/v* | ||
|
||
- name: push-dockerhub-readme | ||
image: jlesage/drone-push-readme | ||
settings: | ||
repo: ${DRONE_REPO_NAMESPACE}/${DRONE_REPO_NAME##docker-} | ||
username: | ||
from_secret: dockerhub_username | ||
password: | ||
from_secret: dockerhub_password | ||
readme: DOCKERHUB.md | ||
when: | ||
ref: | ||
- refs/tags/v* | ||
|
||
- name: microbadger | ||
image: plugins/webhook | ||
settings: | ||
urls: | ||
from_secret: microbadger_webhook | ||
failure: ignore | ||
when: | ||
ref: | ||
- refs/tags/v* | ||
|
||
- name: notification | ||
image: plugins/pushover | ||
settings: | ||
message: "{{ repo.owner }}/{{ repo.name }}#{{ truncate build.commit 8 }} ({{ build.branch }}) by {{ build.author }} - {{ build.message }}" | ||
token: | ||
from_secret: pushover_token | ||
user: | ||
from_secret: pushover_user | ||
failure: ignore | ||
when: | ||
event: | ||
exclude: | ||
- pull_request | ||
status: | ||
- success | ||
- failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Travis CI recipe to build docker image. | ||
# | ||
|
||
sudo: required | ||
|
||
language: generic | ||
|
||
services: | ||
- docker | ||
|
||
script: | ||
- echo "Starting build of Docker image..." | ||
- docker build --no-cache --pull -t $TRAVIS_REPO_SLUG:$TRAVIS_JOB_ID . |
Oops, something went wrong.