41 Commits

Author SHA1 Message Date
Lee
684a894076 Merge pull request 'chore(deps): update alpine docker tag to v3.19.1' (#17) from renovate/alpine-3.x into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m5s
Reviewed-on: #17
2024-02-26 16:33:44 +00:00
93f49e9326 add default index.html
All checks were successful
Publish Docker Image / docker (push) Successful in 1m7s
2024-02-25 17:37:58 +00:00
fef45ad7f7 chore(deps): update alpine docker tag to v3.19.1 2024-02-01 02:09:49 +00:00
006ac97c68 fix
All checks were successful
Publish Docker Image / docker (push) Successful in 56s
2024-01-11 05:57:35 +00:00
d9a34b5bdc 7
All checks were successful
Publish Docker Image / docker (push) Successful in 58s
2024-01-11 05:53:55 +00:00
7783e1a557 again
All checks were successful
Publish Docker Image / docker (push) Successful in 57s
2024-01-11 05:51:26 +00:00
7053659cf3 fix?
All checks were successful
Publish Docker Image / docker (push) Successful in 57s
2024-01-11 05:47:45 +00:00
64023f9bc2 Merge branch 'master' of https://git.fascinated.cc/Fascinated/sharex-php-uploader
All checks were successful
Publish Docker Image / docker (push) Successful in 1m3s
2024-01-11 05:44:42 +00:00
9d7ccbda40 add custom 404 page 2024-01-11 05:44:41 +00:00
Lee
932b0e7fd9 Merge pull request 'chore(deps): update alpine docker tag to v3.18.5' (#16) from renovate/alpine-3.x into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m26s
Reviewed-on: #16
2023-11-30 23:03:26 +00:00
c6a9c1406a chore(deps): update alpine docker tag to v3.18.5 2023-11-30 23:02:18 +00:00
c2219d60b9 Merge branch 'master' of https://git.fascinated.cc/Fascinated/sharex-php-uploader
All checks were successful
Publish Docker Image / docker (push) Successful in 1m17s
2023-10-26 12:25:25 +01:00
64c312bb75 bump nginx 2023-10-26 12:25:21 +01:00
Lee
6354a96024 Merge pull request 'chore(deps): update docker/setup-buildx-action action to v3' (#15) from renovate/docker-setup-buildx-action-3.x into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m32s
Reviewed-on: #15
2023-10-15 03:51:52 +00:00
febf41c262 chore(deps): update docker/setup-buildx-action action to v3 2023-10-15 03:02:45 +00:00
Lee
845833c61d Merge pull request 'chore(deps): update actions/checkout action to v4' (#10) from renovate/actions-checkout-4.x into master
Some checks failed
Publish Docker Image / docker (push) Failing after 15m0s
Reviewed-on: #10
2023-10-15 02:22:39 +00:00
Lee
8bcd2c0412 Merge pull request 'chore(deps): update dependency ubuntu to v22' (#11) from renovate/ubuntu-22.x into master
Some checks are pending
Publish Docker Image / docker (push) Waiting to run
Reviewed-on: #11
2023-10-15 02:22:34 +00:00
Lee
273dd74cf9 Merge pull request 'chore(deps): update docker/build-push-action action to v5' (#13) from renovate/docker-build-push-action-5.x into master
Some checks failed
Publish Docker Image / docker (push) Has been cancelled
Reviewed-on: #13
2023-10-15 02:22:26 +00:00
Lee
82900551fd Merge pull request 'chore(deps): update docker/login-action action to v3' (#14) from renovate/docker-login-action-3.x into master
Some checks failed
Publish Docker Image / docker (push) Has been cancelled
Reviewed-on: #14
2023-10-15 02:22:14 +00:00
b806eb43b8 chore(deps): update docker/login-action action to v3 2023-10-15 02:12:34 +00:00
f8f9809ab0 chore(deps): update docker/build-push-action action to v5 2023-10-15 02:12:32 +00:00
6f9602e5b6 chore(deps): update dependency ubuntu to v22 2023-10-15 01:55:31 +00:00
aa6489c971 chore(deps): update actions/checkout action to v4 2023-10-15 01:55:29 +00:00
Lee
353c55a1dd Merge pull request 'Configure Renovate' (#9) from renovate/configure into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m1s
Reviewed-on: #9
2023-10-15 01:50:13 +00:00
2a2b8e02a6 chore(deps): add renovate.json 2023-10-15 01:48:29 +00:00
a05a8f973c remove php copy to prod image
All checks were successful
Publish Docker Image / docker (push) Successful in 58s
2023-10-13 20:15:35 +01:00
a0643f8083 fix startup part 2
Some checks failed
Publish Docker Image / docker (push) Failing after 45s
2023-10-13 20:14:02 +01:00
7a29603a30 fix startup error
All checks were successful
Publish Docker Image / docker (push) Successful in 1m2s
2023-10-13 20:08:41 +01:00
b2b386b33a update wording
All checks were successful
Publish Docker Image / docker (push) Successful in 59s
2023-10-13 19:54:21 +01:00
Lee
f9622e8081 Merge pull request 'Update depends' (#8) from development into master
All checks were successful
Publish Docker Image / docker (push) Successful in 58s
Reviewed-on: #8
2023-10-13 18:51:48 +00:00
3e0fc4fd53 update readme 2023-07-08 06:18:04 +01:00
Lee
b9cbfef9be Merge pull request 'fix workflow file' (#7) from development into master
All checks were successful
Publish Docker Image / docker (push) Successful in 24s
Reviewed-on: #7
2023-07-08 00:36:07 +00:00
Lee
6e71267e6a Merge pull request 'Updating build workflow' (#6) from development into master
All checks were successful
Publish Docker Image / docker (push) Successful in 24s
Reviewed-on: #6
2023-07-08 00:23:50 +00:00
Lee
e6e4481412 Delete .gitea/workflows/upload-image-dev.yaml
All checks were successful
/ docker (push) Successful in 34s
2023-07-08 00:23:40 +00:00
Lee
f3febd737d Merge pull request 'Migrate to Alpine' (#5) from development into master
All checks were successful
/ docker (push) Successful in 29s
Reviewed-on: #5
2023-07-07 23:54:10 +00:00
Lee
780ea18f5b Merge pull request 'Many improvements to the server' (#4) from development into master
All checks were successful
/ docker (push) Successful in 1m50s
Reviewed-on: #4
2023-07-07 23:07:19 +00:00
Lee
48265f6d1b Update README.md
All checks were successful
/ docker (push) Successful in 1m57s
2023-07-06 14:05:00 +00:00
Lee
b231e82a95 Update README.md
All checks were successful
/ docker (push) Successful in 2m8s
2023-07-06 14:04:48 +00:00
Lee
5799511916 Merge pull request 'Switch image conversion to Imagick' (#3) from development into master
All checks were successful
/ docker (push) Successful in 2m5s
Reviewed-on: #3
2023-07-06 01:35:42 +00:00
4ebb8fafe2 update dev action name
All checks were successful
/ docker (push) Successful in 2m6s
2023-07-06 01:07:35 +01:00
Lee
7bd835de54 Merge pull request 'add dev image' (#2) from development into master
All checks were successful
/ docker (push) Successful in 1m56s
Reviewed-on: #2
2023-07-06 00:06:11 +00:00
8 changed files with 85 additions and 16 deletions

View File

@ -13,14 +13,14 @@ on:
jobs:
docker:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Restore Docker Cache
uses: actions/cache@v3
@ -38,10 +38,10 @@ jobs:
echo "Done"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to Repo
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.REPO_USERNAME }}
password: ${{ secrets.REPO_TOKEN }}
@ -54,7 +54,7 @@ jobs:
key: ${{ runner.os }}-buildx
- name: Build and Push (Latest)
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
if: steps.branch-name.outputs.current_branch == 'master'
with:
push: true
@ -64,7 +64,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and Push (Other Branches)
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
if: steps.branch-name.outputs.current_branch != 'master'
with:
push: true

View File

@ -1,15 +1,15 @@
# Stage 1: Build Nginx
FROM alpine:3.18.4 as builder
FROM alpine:3.19.1 as builder
# Install build dependencies and required tools
RUN apk update && apk upgrade && \
apk add --no-cache php81 php81-fpm php81-gd build-base pcre-dev openssl-dev zlib-dev linux-headers
apk add --no-cache build-base pcre-dev openssl-dev zlib-dev linux-headers
# Download and build the latest version of Nginx from source
WORKDIR /tmp
RUN wget https://nginx.org/download/nginx-1.25.2.tar.gz
RUN tar -xzvf nginx-1.25.2.tar.gz
WORKDIR /tmp/nginx-1.25.2
RUN wget https://nginx.org/download/nginx-1.25.3.tar.gz
RUN tar -xzvf nginx-1.25.3.tar.gz
WORKDIR /tmp/nginx-1.25.3
RUN ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/etc/nginx/nginx.conf
RUN make
RUN make install
@ -23,20 +23,26 @@ COPY ./docker/nginx.conf /etc/nginx/nginx.conf
# Setup scripts
COPY ./upload.php /tmp/upload.php
COPY ./docker/start.sh /start.sh
COPY ./docker/index.html /tmp/index.html
# Stage 2: Create a smaller image
FROM alpine:3.18.4
# Copy public directory
COPY ./public /tmp/public
# Stage 2: Create a smaller production image
FROM alpine:3.19.1
# Copy Nginx and PHP-FPM binaries and configurations from the builder stage
COPY --from=builder /usr/local/nginx /usr/local/nginx
COPY --from=builder /usr/local/sbin/nginx /usr/local/sbin/nginx
COPY --from=builder /etc/nginx /etc/nginx
COPY --from=builder /etc/php81 /etc/php81
COPY --from=builder /tmp/upload.php /tmp/upload.php
COPY --from=builder /tmp/index.html /tmp/index.html
COPY --from=builder /start.sh /start.sh
COPY --from=builder /tmp/public /tmp/public
# Install runtime dependencies
RUN apk update && apk upgrade && \
apk add --no-cache php81 php81-fpm php81-gd
apk add --no-cache php81 php81-fpm php81-gd pcre
# Cleanup unnecessary files
RUN rm -rf /var/cache/apk/*

View File

@ -15,7 +15,7 @@ This PHP script allows you to easily upload ShareX screenshots and videos. It in
## Installation
1. Copy the `docker-compose.yml` file to your server.
2. Edit the `docker-compose.yml` file and change `MAX_UPLOAD_SIZE` to the maximum file size you want to allow, and update `./uploads` to where you want to store the files.
2. Edit the `docker-compose.yml` file and change environment variables to what you need, and update `./uploads` to where you want to store the files.
3. Run `docker-compose up -d` to start the container.
4. Go to where the files are stored and edit the variables in `upload.php` to your liking.
5. Run `docker-compose restart` to restart the container.

22
docker/index.html Normal file
View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ShareX Uploader</title>
<!-- TailwindCSS -->
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body
class="h-screen bg-neutral-900 text-white flex flex-col text-center items-center p-4 gap-2"
>
<p class="text-blue-400 text-4xl">ShareX Uploader</p>
<p class="text-gray-400 text-xl">Created by ImFascinated</p>
<div>
<a href="https://s.fascinated.cc/s/sharex-uploader">Source</a>
<a href="https://s.fascinated.cc/s/gitea">Gitea</a>
<a href="https://s.fascinated.cc/s/github">GitHub</a>
</div>
</body>
</html>

View File

@ -39,6 +39,12 @@ http {
client_max_body_size 500M; # Will get replaced by the environment variable MAX_UPLOAD_SIZE
# Fallback 404 page
location = /not-found.html {
internal;
root /tmp/public;
}
# Upload endpoint
location /upload.php {
try_files $uri =404;
@ -60,6 +66,8 @@ http {
open_file_cache_min_uses 1;
open_file_cache_errors on;
error_page 404 /not-found.html;
# Serve the file directly from disk
try_files $uri $uri/ =404;
}

View File

@ -14,6 +14,14 @@ else
echo "Upload script was not found, copying it."
fi
echo "Checking if default index.html exists in /var/www/html"
if [ -f "/var/www/html/index.html" ]; then
echo "Upload script was found, ignoring copy."
else
cp /tmp/index.html /var/www/html
echo "Default index.html was not found, copying it."
fi
# Letting php know that we are running in docker
echo "env[DOCKER] = true" >> /etc/php81/php-fpm.d/www.conf
echo "clear_env = no" >> /etc/php81/php-fpm.d/www.conf

19
public/not-found.html Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>File Not Found</title>
<!-- TailwindCSS -->
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body
class="h-screen bg-neutral-900 text-white flex flex-col text-center justify-center items-center p-4 gap-2"
>
<p class="text-red-400 text-3xl">404 - File Not Found</p>
<p class="text-gray-400 text-xl">
We're sorry, the file you requested could not be found.
</p>
</body>
</html>

6
renovate.json Normal file
View File

@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>Fascinated/renovate-config"
]
}