Compare commits

...

11 Commits

Author SHA1 Message Date
2039f673ad chore(deps): update docker/build-push-action action to v6
All checks were successful
Publish Docker Image / docker (push) Successful in 1m19s
2024-06-17 10:01:38 +00:00
Lee
ca49cf2a51 Update README.md 2024-02-28 18:37:22 +00:00
Lee
14ce3e887c make nginx build silently
All checks were successful
Publish Docker Image / docker (push) Successful in 1m13s
2024-02-26 17:52:32 +00:00
Lee
b893f23ba5 Merge pull request 'chore(deps): update actions/cache action to v4' (#19) from renovate/actions-cache-4.x into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m1s
Reviewed-on: #19
2024-02-26 17:49:24 +00:00
Lee
4a5b7a7697 Merge pull request 'chore(deps): update tj-actions/branch-names action to v8' (#18) from renovate/tj-actions-branch-names-8.x into master
All checks were successful
Publish Docker Image / docker (push) Successful in 1m3s
Reviewed-on: #18
2024-02-26 17:48:06 +00:00
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
f5f3382d7e chore(deps): update actions/cache action to v4 2024-01-17 17:04:26 +00:00
006ac97c68 fix
All checks were successful
Publish Docker Image / docker (push) Successful in 56s
2024-01-11 05:57:35 +00:00
3e40c88dac chore(deps): update tj-actions/branch-names action to v8 2023-12-31 00:04:50 +00:00
8 changed files with 50 additions and 85 deletions

@ -17,13 +17,13 @@ jobs:
steps:
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v7
uses: tj-actions/branch-names@v8
- name: Checkout
uses: actions/checkout@v4
- name: Restore Docker Cache
uses: actions/cache@v3
uses: actions/cache@v4
id: docker-cache
with:
path: /usr/bin/docker
@ -47,14 +47,14 @@ jobs:
password: ${{ secrets.REPO_TOKEN }}
- name: Restore Docker Build Cache
uses: actions/cache@v3
uses: actions/cache@v4
id: build-cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx
- name: Build and Push (Latest)
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
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@v5
uses: docker/build-push-action@v6
if: steps.branch-name.outputs.current_branch != 'master'
with:
push: true

@ -1,5 +1,5 @@
# Stage 1: Build Nginx
FROM alpine:3.18.5 as builder
FROM alpine:3.19.1 as builder
# Install build dependencies and required tools
RUN apk update && apk upgrade && \
@ -7,12 +7,14 @@ RUN apk update && apk upgrade && \
# Download and build the latest version of Nginx from source
WORKDIR /tmp
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
RUN wget https://nginx.org/download/nginx-1.25.3.tar.gz && \
tar -xzvf nginx-1.25.3.tar.gz && \
cd nginx-1.25.3 && \
./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/etc/nginx/nginx.conf && \
make > /dev/null 2>&1 && \
make install > /dev/null 2>&1 && \
make_status=$? && \
if [ $make_status -ne 0 ]; then echo "Nginx build failed"; exit $make_status; fi
# Cleanup unnecessary files
RUN rm -rf /tmp/*
@ -23,18 +25,20 @@ 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
# Copy public directory
COPY ./public /tmp/public
# Stage 2: Create a smaller production image
FROM alpine:3.18.5
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 /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

@ -1,4 +1,4 @@
# ShareX Upload Script
# ShareX Uploader
This PHP script allows you to easily upload ShareX screenshots and videos. It includes token authentication for security and can handle various image file types by converting them to WebP format for efficient storage.

22
docker/index.html Normal 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>

@ -45,12 +45,6 @@ http {
root /tmp/public;
}
location /public {
root /tmp/public;
try_files $uri $uri/ =404;
}
# Upload endpoint
location /upload.php {
try_files $uri =404;

@ -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

File diff suppressed because one or more lines are too long

@ -6,7 +6,7 @@
<title>File Not Found</title>
<!-- TailwindCSS -->
<script src="./assets/tailwind.js"></script>
<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"