Compare commits

...

53 commits

Author SHA1 Message Date
Amin Vakil
ef33268973
Fail trivy on critical, high issues 2023-11-06 13:34:52 +03:30
孙茂胤 (Sun, Maoyin)
98b2d6495c
typo fix
(cherry picked from commit 4495180f7b2666959ceee07558c8825a002b05f3)
2023-11-06 13:23:39 +03:30
Amin Vakil
069b78ecfd
Merge pull request #34 from aminvakil/alpine
Bump alpine
2023-09-29 13:55:17 +03:30
aminvakil
26307070f0 3.18.3 -> 3.18.4 2023-09-29 02:14:58 +00:00
Amin Vakil
9142472da2
Merge pull request #33 from aminvakil/alpine
Bump alpine
2023-08-08 16:11:39 +03:30
aminvakil
3e00ac5fee 3.18.2 -> 3.18.3 2023-08-08 02:24:03 +00:00
Amin Vakil
4f89f0ea2a
Merge pull request #32 from aminvakil/alpine
Bump alpine
2023-06-15 20:42:24 +03:30
aminvakil
53d421b591 3.18.0 -> 3.18.2 2023-06-15 03:12:53 +00:00
Amin Vakil
73b6e81e24
Merge pull request #31 from aminvakil/alpine
Bump alpine
2023-05-19 03:45:00 +03:30
aminvakil
73c6d05524 3.17.3 -> 3.18.0 2023-05-10 02:25:16 +00:00
Amin Vakil
d5051deb36
Merge pull request #30 from aminvakil/alpine
Bump alpine
2023-03-30 16:49:40 +03:30
aminvakil
1280d22b47 3.17.2 -> 3.17.3 2023-03-30 02:31:09 +00:00
Amin Vakil
0a06f2eadf
Merge pull request #29 from aminvakil/checkout_v3
Use actions/checkout@v3
2023-03-25 01:54:55 +03:30
Amin Vakil
656317dd5f
Use actions/checkout@v3 2023-03-25 01:32:16 +03:30
Amin Vakil
c162d59887
Merge pull request #28 from aminvakil/alpine
Bump alpine
2023-02-12 18:48:27 +03:30
aminvakil
478c447e7a 3.17.1 -> 3.17.2 2023-02-11 02:37:14 +00:00
Amin Vakil
d67779068d
Merge pull request #27 from aminvakil/alpine
Bump alpine
2023-01-14 15:08:25 +03:30
aminvakil
a7e3826432 3.17.0 -> 3.17.1 2023-01-14 11:33:57 +00:00
Amin Vakil
43967db7df
Merge pull request #25 from aminvakil/alpine
Bump alpine and vsftpd
2022-11-26 13:11:56 +03:30
Amin Vakil
4550b7480b
Bump vsftpd 3.0.5-r2
(cherry picked from commit c246b8b30ffd81bfe552a35825d1eb0c2639e165)
2022-11-26 13:09:13 +03:30
aminvakil
adeee4d3c9 3.16.3 -> 3.17.0 2022-11-25 15:14:20 +00:00
Amin Vakil
dc462630f4
Merge pull request #24 from aminvakil/hadolint2.12.0
Bump hadolint 2.12.0
2022-11-14 16:45:47 +03:30
Amin Vakil
766937cb9b
Bump hadolint 2.12.0 2022-11-14 16:42:37 +03:30
Amin Vakil
c905988964
Merge pull request #23 from aminvakil/alpine
Bump alpine
2022-11-13 20:05:23 +03:30
aminvakil
b7baf5d42b 3.16.2 -> 3.16.3 2022-11-13 03:19:58 +00:00
Amin Vakil
5efbbe780f
Merge pull request #22 from aminvakil/alpine
Bump alpine
2022-08-13 13:39:45 +04:30
aminvakil
6c3d800b31 3.16.1 -> 3.16.2 2022-08-10 02:59:29 +00:00
Amin Vakil
a218237e20
Merge pull request #20 from aminvakil/alpine
Bump alpine
2022-07-20 12:49:11 +04:30
aminvakil
953cb385ef
3.16.0 -> 3.16.1 2022-07-20 12:47:01 +04:30
Amin Vakil
c76e7f295c
Merge pull request #21 from aminvakil/ignore_key
Skip private key in trivy
2022-07-20 12:46:36 +04:30
Amin Vakil
54705c8245
Skip private key in trivy 2022-07-20 12:45:24 +04:30
Amin Vakil
2d67c3ce92
Add note in README 2022-07-20 12:19:00 +04:30
Amin Vakil
423c97320d
Merge pull request #19 from aminvakil/setup_buildx_action_v2
Use setup-buildx-action@v2
2022-06-25 19:10:28 +04:30
Amin Vakil
c4b9abdf8c
Use setup-buildx-action@v2 2022-06-25 19:04:54 +04:30
Amin Vakil
563abbd398
Merge pull request #18 from aminvakil/alpine
Bump alpine
2022-05-24 16:45:05 +04:30
aminvakil
b58fa088bb 3.15.4 -> 3.16.0 2022-05-24 03:18:13 +00:00
Amin Vakil
b2ef0d26aa
Merge pull request #17 from aminvakil/build_push_action_v3
Use build-push-action@v3
2022-05-08 12:35:32 +04:30
Amin Vakil
4b9ad65b93
Use build-push-action@v3 2022-05-08 12:32:11 +04:30
Amin Vakil
a4f93599a5
Merge pull request #16 from aminvakil/alpine
Bump alpine
2022-04-05 09:58:53 +04:30
aminvakil
76b6384a4b 3.15.3 -> 3.15.4 2022-04-05 02:49:10 +00:00
Amin Vakil
e4de9d7fc2
Merge pull request #15 from aminvakil/hadolint2.10.0
Bump hadolint 2.10.0
2022-04-02 20:32:01 +04:30
Amin Vakil
db53c22356
Bump hadolint 2.10.0 2022-04-02 20:25:54 +04:30
Amin Vakil
65e21edd29
Remove upstream CD workflow 2022-04-02 20:16:32 +04:30
Delfer
274cd6349c
Fixed user creation when group with the same id already exists
(cherry picked from commit 9fd6e070ff6d49b3a0fb4c4009a3072e2f007291)
2022-04-02 20:11:49 +04:30
Amin Vakil
b58c0a3b20
Merge pull request #13 from aminvakil/alpine
Bump alpine
2022-03-29 13:25:52 +04:30
aminvakil
21d0fe62e3 3.15.2 -> 3.15.3 2022-03-29 02:53:08 +00:00
Amin Vakil
2c9279f01a
Merge pull request #12 from aminvakil/hadolint2.9.3
Bump hadolint 2.9.3
2022-03-27 09:24:21 +04:30
Amin Vakil
9e2ad4e426
Bump hadolint 2.9.3 2022-03-27 09:14:27 +04:30
Amin Vakil
ed0649c75a
Merge pull request #11 from aminvakil/alpine
Bump alpine
2022-03-24 15:29:43 +04:30
aminvakil
af84ac466b 3.15.1 -> 3.15.2 2022-03-24 02:43:56 +00:00
Amin Vakil
64f3073584
Revert "Upgrade libretls temporary"
This reverts commit e22496ae0a.
2022-03-23 22:07:06 +04:30
Amin Vakil
9df1b1d26e
Bump hadolint 2.9.2 2022-03-23 22:07:06 +04:30
Amin Vakil
2bb0086211
Bump hadolint 2.9.1 2022-03-18 17:30:30 +03:30
6 changed files with 38 additions and 111 deletions

View file

@ -11,14 +11,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out the codebase. - name: Check out the codebase.
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Install hadolint. - name: Install hadolint.
run: | run: |
sudo curl -L https://github.com/hadolint/hadolint/releases/download/v$HADOLINT_VERSION/hadolint-$(uname -s)-$(uname -m) -o /usr/local/bin/hadolint sudo curl -L https://github.com/hadolint/hadolint/releases/download/v$HADOLINT_VERSION/hadolint-$(uname -s)-$(uname -m) -o /usr/local/bin/hadolint
sudo chmod 755 /usr/local/bin/hadolint sudo chmod 755 /usr/local/bin/hadolint
env: env:
HADOLINT_VERSION: 2.8.0 HADOLINT_VERSION: 2.12.0
- name: Run hadolint. - name: Run hadolint.
run: | run: |
@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out the codebase. - name: Check out the codebase.
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Find an open port. - name: Find an open port.
run: | run: |
@ -63,12 +63,15 @@ jobs:
with: with:
image-ref: ${{ github.repository }}:${{ github.run_id }} image-ref: ${{ github.repository }}:${{ github.run_id }}
exit-code: '1' exit-code: '1'
skip-files: '/etc/ssl/certs/vsftpd.pem'
severity: 'CRITICAL,HIGH'
- name: Run Trivy vulnerability scanner. - name: Run Trivy vulnerability scanner.
uses: aquasecurity/trivy-action@master uses: aquasecurity/trivy-action@master
with: with:
image-ref: ${{ github.repository }}:nossl image-ref: ${{ github.repository }}:nossl
exit-code: '1' exit-code: '1'
severity: 'CRITICAL,HIGH'
deploy: deploy:
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
@ -84,7 +87,7 @@ jobs:
echo ::set-output name=VERSION::${TAG%-*} echo ::set-output name=VERSION::${TAG%-*}
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2
- name: Login to Quay - name: Login to Quay
uses: docker/login-action@v1 uses: docker/login-action@v1
@ -94,7 +97,7 @@ jobs:
password: ${{ secrets.QUAY_PASSWORD }} password: ${{ secrets.QUAY_PASSWORD }}
- name: Push to Quay - name: Push to Quay
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3
with: with:
file: ./Dockerfile file: ./Dockerfile
pull: true pull: true
@ -108,7 +111,7 @@ jobs:
VERSION: ${{ steps.get_version.outputs.VERSION }} VERSION: ${{ steps.get_version.outputs.VERSION }}
- name: Push nossl to Quay - name: Push nossl to Quay
uses: docker/build-push-action@v2 uses: docker/build-push-action@v3
with: with:
file: ./Dockerfile_nossl file: ./Dockerfile_nossl
pull: true pull: true

View file

@ -1,86 +0,0 @@
name: Docker hub auto publish image
on:
push:
branches:
- master
paths:
# Run when file is edited
- Dockerfile
- start_vsftpd.sh
- vsftpd.conf
# Run tests for any PRs.
pull_request:
env:
# Image name at docker hub
IMAGE_NAME: delfer/alpine-ftp-server
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file Dockerfile
fi
push:
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
# Genrate secret from here https://hub.docker.com/settings/security
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Add Label Schema to Dockerfile
run: |
# Label Schema based on http://label-schema.org/rc1/
TIME_ISO=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "LABEL org.label-schema.build-date=$TIME_ISO" >> Dockerfile
echo "LABEL org.label-schema.name=vsftpd" >> Dockerfile
echo "LABEL org.label-schema.url=https://security.appspot.com/vsftpd.html" >> Dockerfile
echo "LABEL org.label-schema.vcs-url=https://github.com/delfer/docker-alpine-ftp-server" >> Dockerfile
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
echo "LABEL org.label-schema.vcs-ref=$GIT_HASH" >> Dockerfile
echo "LABEL org.label-schema.schema-version=1.0.0-rc.1" >> Dockerfile
echo "LABEL org.label-schema.docker.cmd=\"docker run -d -p 21:21 -e USERS=\"username|password\" delfer/alpine-ftp-server\"" >> Dockerfile
# Show edited Dockerfile content
cat Dockerfile
- name: Build and push latest
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
push: true
tags: |
${{ env.IMAGE_NAME }}:latest

View file

@ -1,11 +1,8 @@
FROM alpine:3.15.1 FROM alpine:3.18.4
LABEL maintainer="Amin Vakil <info@aminvakil.com>" LABEL maintainer="Amin Vakil <info@aminvakil.com>"
RUN apk --no-cache add vsftpd=3.0.5-r1 RUN apk --no-cache add vsftpd=3.0.5-r2
# hadolint ignore=DL3059,DL3018
RUN apk add --no-cache --upgrade libretls
COPY vsftpd.pem /etc/ssl/certs/vsftpd.pem COPY vsftpd.pem /etc/ssl/certs/vsftpd.pem
COPY start_vsftpd.sh /usr/local/bin/start_vsftpd.sh COPY start_vsftpd.sh /usr/local/bin/start_vsftpd.sh

View file

@ -1,11 +1,8 @@
FROM alpine:3.15.1 FROM alpine:3.18.4
LABEL maintainer="Amin Vakil <info@aminvakil.com>" LABEL maintainer="Amin Vakil <info@aminvakil.com>"
RUN apk --no-cache add vsftpd=3.0.5-r1 RUN apk --no-cache add vsftpd=3.0.5-r2
# hadolint ignore=DL3059,DL3018
RUN apk add --no-cache --upgrade libretls
COPY start_vsftpd.sh /usr/local/bin/start_vsftpd.sh COPY start_vsftpd.sh /usr/local/bin/start_vsftpd.sh
COPY vsftpd.conf_nossl /etc/vsftpd/vsftpd.conf COPY vsftpd.conf_nossl /etc/vsftpd/vsftpd.conf

View file

@ -1,6 +1,16 @@
# docker-alpine-ftp-server-tls # docker-alpine-ftp-server-tls
Small and flexible docker image with vsftpd server with tls Small and flexible docker image with vsftpd server with tls
# Important Note
I think upstream has made it more complicated than it needs to be since this commit and I'm not merging its commits anymore, although I cherry-pick some of them when I see fit.
https://github.com/delfer/docker-alpine-ftp-server/commit/fbf9afd9368d63a225e093bae227fa878de46b2c
Also for future reference this is the PR of this commit: https://github.com/delfer/docker-alpine-ftp-server/pull/36
FOr further discussion about this you can use [this issue](https://github.com/aminvakil/docker-alpine-ftp-server-tls/issues/14).
## Usage ## Usage
``` ```
docker run -d \ docker run -d \
@ -14,9 +24,9 @@ docker run -d \
## Configuration ## Configuration
Environment variables: Environment variables:
- `USERS` - space and `|` separated list (optional, default: `ftp|alpineftp`) - `USERS` - space and `|` separated list (optional, default: `alpineftp|alpineftp`)
- format `name1|password1|[folder1][|uid1] name2|password2|[folder2][|uid2]` - format `name1|password1|[folder1][|uid1] name2|password2|[folder2][|uid2]`
- `ADDRESS` - external address witch clients can connect passive ports (optional, should resolve to ftp server ip address) - `ADDRESS` - external address to which clients can connect for passive ports (optional, should resolve to ftp server ip address)
- `MIN_PORT` - minimum port number to be used for passive connections (optional, default `21000`) - `MIN_PORT` - minimum port number to be used for passive connections (optional, default `21000`)
- `MAX_PORT` - maximum port number to be used for passive connections (optional, default `21010`) - `MAX_PORT` - maximum port number to be used for passive connections (optional, default `21010`)

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
#Remove all ftp users #Remove all ftp users
#grep '/ftp/' /etc/passwd | cut -d':' -f1 | xargs -n1 deluser grep '/ftp/' /etc/passwd | cut -d':' -f1 | xargs -r -n1 deluser
#Create users #Create users
#USERS='name1|password1|[folder1][|uid1] name2|password2|[folder2][|uid2]' #USERS='name1|password1|[folder1][|uid1] name2|password2|[folder2][|uid2]'
@ -14,14 +14,15 @@
#Default user 'ftp' with password 'alpineftp' #Default user 'ftp' with password 'alpineftp'
if [ -z "$USERS" ]; then if [ -z "$USERS" ]; then
USERS="amin|alpineftp" USERS="alpineftp|alpineftp"
fi fi
for i in $USERS ; do for i in $USERS ; do
NAME=$(echo $i | cut -d'|' -f1) NAME=$(echo $i | cut -d'|' -f1)
PASS=$(echo $i | cut -d'|' -f2) GROUP=$NAME
PASS=$(echo $i | cut -d'|' -f2)
FOLDER=$(echo $i | cut -d'|' -f3) FOLDER=$(echo $i | cut -d'|' -f3)
UID=$(echo $i | cut -d'|' -f4) UID=$(echo $i | cut -d'|' -f4)
if [ -z "$FOLDER" ]; then if [ -z "$FOLDER" ]; then
FOLDER="/ftp/$NAME" FOLDER="/ftp/$NAME"
@ -29,11 +30,16 @@ for i in $USERS ; do
if [ ! -z "$UID" ]; then if [ ! -z "$UID" ]; then
UID_OPT="-u $UID" UID_OPT="-u $UID"
#Check if the group with the same ID already exists
GROUP=$(getent group $UID | cut -d: -f1)
if [ ! -z "$GROUP" ]; then
GROUP_OPT="-G $GROUP"
fi
fi fi
echo -e "$PASS\n$PASS" | adduser -h $FOLDER -s /sbin/nologin $UID_OPT $NAME echo -e "$PASS\n$PASS" | adduser -h $FOLDER -s /sbin/nologin $UID_OPT $GROUP_OPT $NAME
mkdir -p $FOLDER mkdir -p $FOLDER
chown $NAME:$NAME $FOLDER chown $NAME:$GROUP $FOLDER
unset NAME PASS FOLDER UID unset NAME PASS FOLDER UID
done done