Compare commits
100 Commits
Author | SHA1 | Date | |
---|---|---|---|
f1efec3a74 | |||
167059b4ca | |||
a31c1159ca | |||
069309c6af | |||
d6406d529f | |||
d096d094eb | |||
3ca8e367fc | |||
7ecffcb751 | |||
|
b0005e7285 | ||
579904549b | |||
642ff1f7a1 | |||
c18493167f | |||
138eee76b9 | |||
|
5ff00ab68c | ||
9a8de056a2 | |||
f9a54de35d | |||
31a64dc89e | |||
1a113e51c7 | |||
3bcee0e615 | |||
|
2ebf20f6c0 | ||
1ccc38e328 | |||
d582bbe182 | |||
|
9975d1e560 | ||
|
abf531d522 | ||
40b636dffe | |||
fc2ccfae4a | |||
6e3bda752d | |||
052f857f17 | |||
f9defce223 | |||
bf82c1b95e | |||
18cad618d6 | |||
4e3f08603f | |||
7e4fec1569 | |||
4288e89283 | |||
00b04e865e | |||
0a90603c93 | |||
b41731427b | |||
532f226032 | |||
a27abbe661 | |||
d21502b068 | |||
e5d620b676 | |||
bb9787099a | |||
bb6ccfa96d | |||
cc58c840c7 | |||
a3080917d9 | |||
891bd9cf87 | |||
28a646d83d | |||
8b0f5c8364 | |||
21d222848c | |||
e8829db154 | |||
c29fa441bc | |||
de5ff64981 | |||
00e8d2cb4c | |||
061c6783d5 | |||
84bc88c168 | |||
03733610e6 | |||
809d5b5045 | |||
0afe9fe4e4 | |||
77dafb9fbc | |||
bca8c49cd1 | |||
8db0bb0d8a | |||
46f10442f9 | |||
171f6dcdc7 | |||
ff3598971c | |||
a9e72c11a3 | |||
e5833c7872 | |||
19b590362e | |||
fb53fc7cd3 | |||
8304c1f83c | |||
cd4604582d | |||
48dc88f60b | |||
a0270760e3 | |||
8233e5e5eb | |||
55aa216759 | |||
4c7ec1e41d | |||
178b6c9a41 | |||
a2ba2da073 | |||
64801c97e7 | |||
28dbd93975 | |||
e6ee45582e | |||
|
64a9e6ab90 | ||
|
d20ef28621 | ||
|
f76c1745d3 | ||
|
250c2ba736 | ||
|
858d182169 | ||
|
b469b3279d | ||
|
1c92ecbdcb | ||
|
5f1c408374 | ||
|
b0ba37da3b | ||
|
507d4f870f | ||
|
5d4c759907 | ||
|
2bcbc3277c | ||
|
25b5de72cc | ||
|
079d753a40 | ||
|
59a71a84b9 | ||
|
9ef266fb3e | ||
|
e0638f2830 | ||
|
e8da944333 | ||
|
bfc63d82ae | ||
|
e216dd4507 |
30
Dockerfile
30
Dockerfile
|
@ -1,29 +1,25 @@
|
||||||
FROM alpine:edge AS builder
|
FROM alpine:edge AS builder
|
||||||
|
RUN apk add --no-cache crystal shards libc-dev yaml-dev libxml2-dev zlib-dev openssl-dev
|
||||||
|
|
||||||
# Add this directory to container as /app
|
MAINTAINER Arthur Poulet <arthur.poulet@sceptique.eu>
|
||||||
ADD . /build
|
|
||||||
WORKDIR /build
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
crystal shards libc-dev yaml-dev libxml2-dev zlib-dev openssl-dev curl
|
|
||||||
|
|
||||||
# Install shards
|
# Install shards
|
||||||
|
WORKDIR /usr/local
|
||||||
|
|
||||||
|
# Add this directory to container as /app
|
||||||
|
ADD . /transfer_more
|
||||||
|
WORKDIR /transfer_more
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
RUN shards install
|
RUN shards install
|
||||||
|
|
||||||
# Build our app
|
# Build our app
|
||||||
RUN crystal build --release --warnings all src/transfer_more.cr
|
RUN crystal build --release --warnings all src/transfer_more.cr
|
||||||
|
|
||||||
# Run the tests
|
# Run the tests
|
||||||
RUN mkdir /tmp/files && crystal spec
|
RUN mkdir /tmp/files
|
||||||
|
#RUN crystal spec
|
||||||
|
|
||||||
FROM alpine:edge
|
EXPOSE 3000
|
||||||
MAINTAINER Arthur Poulet <arthur.poulet@sceptique.eu>
|
|
||||||
|
|
||||||
RUN apk add --no-cache libgcc libevent libgc++ pcre2
|
ENTRYPOINT ./transfer_more --port 3000
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
ADD ./public /app/public
|
|
||||||
COPY --from=builder /build/transfer_more ./transfer_more
|
|
||||||
|
|
||||||
ENTRYPOINT ["./transfer_more"]
|
|
||||||
|
|
76
README.md
76
README.md
|
@ -12,7 +12,7 @@ Fast and lite file upload server ([transfer.sh](https://transfer.sh/) clone).
|
||||||
|
|
||||||
## Installation [![Build Status](https://drone.sceptique.eu/api/badges/Sceptique/transfer_more/status.svg)](https://drone.sceptique.eu/Sceptique/transfer_more)
|
## Installation [![Build Status](https://drone.sceptique.eu/api/badges/Sceptique/transfer_more/status.svg)](https://drone.sceptique.eu/Sceptique/transfer_more)
|
||||||
|
|
||||||
Compatible crystal v1.9.2
|
Compatible crystal v1.4.1
|
||||||
|
|
||||||
### From source
|
### From source
|
||||||
|
|
||||||
|
@ -28,64 +28,6 @@ make doc # build the documentation
|
||||||
yay -S transfer-more
|
yay -S transfer-more
|
||||||
```
|
```
|
||||||
|
|
||||||
### As a systemd service
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
Description=Tranfer more file sharing
|
|
||||||
Documentation=https://wiki.archlinux.org/index.php/Transfer-more
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/usr/share/transfer-more/transfer-more --port 10003 --bind 127.0.0.1
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=5
|
|
||||||
Environment="TRANSFER_SSL_ENABLED=true"
|
|
||||||
WorkingDirectory=/usr/share/transfer-more/
|
|
||||||
|
|
||||||
# Hardening
|
|
||||||
MemoryDenyWriteExecute=true
|
|
||||||
SystemCallArchitectures=native
|
|
||||||
CapabilityBoundingSet=
|
|
||||||
NoNewPrivileges=true
|
|
||||||
RemoveIPC=true
|
|
||||||
LockPersonality=true
|
|
||||||
|
|
||||||
ProtectControlGroups=true
|
|
||||||
ProtectKernelTunables=true
|
|
||||||
ProtectKernelModules=true
|
|
||||||
ProtectKernelLogs=true
|
|
||||||
ProtectClock=true
|
|
||||||
ProtectHostname=true
|
|
||||||
ProtectProc=noaccess
|
|
||||||
|
|
||||||
RestrictRealtime=true
|
|
||||||
RestrictSUIDSGID=true
|
|
||||||
RestrictNamespaces=true
|
|
||||||
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
|
||||||
|
|
||||||
ProtectSystem=full
|
|
||||||
ProtectHome=true
|
|
||||||
PrivateDevices=true
|
|
||||||
PrivateTmp=true
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=default.target
|
|
||||||
|
|
||||||
### Behind a nginx proxy
|
|
||||||
|
|
||||||
You should configure your nginx with `/etc/nginx/servers-enabled/transfer-more.conf`:
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 ssl;
|
|
||||||
server_name your.sub.domain;
|
|
||||||
client_max_body_size 1G;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
location / {
|
|
||||||
proxy_pass http://localhost:3000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Run the Server
|
### Run the Server
|
||||||
|
@ -97,8 +39,6 @@ export TRANSFER_SECURE_SIZE=4 # how much characters to identify a file
|
||||||
export TRANSFER_STORAGE_DAYS=7 # how much time the files are kept
|
export TRANSFER_STORAGE_DAYS=7 # how much time the files are kept
|
||||||
export TRANSFER_TIME_FORMAT="%y%m%d%H"
|
export TRANSFER_TIME_FORMAT="%y%m%d%H"
|
||||||
export TRANSFER_HOST_PORT="localhost:3000" # in pinciple it is auto solved using the http headers, optional
|
export TRANSFER_HOST_PORT="localhost:3000" # in pinciple it is auto solved using the http headers, optional
|
||||||
export TRANSFER_MORE_FOOTER="Something <strong>important</strong> on the bottom" # replace the default footer
|
|
||||||
export TRANSFER_MORE_TITLE="MyName upload" # replace the default title
|
|
||||||
./transfer_more
|
./transfer_more
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -114,18 +54,20 @@ export TRANSFER_MORE_TITLE="MyName upload"
|
||||||
curl --progress-bar --upload-file file.mp4 http://domain/name.mp4
|
curl --progress-bar --upload-file file.mp4 http://domain/name.mp4
|
||||||
```
|
```
|
||||||
|
|
||||||
### Inside a Docker container
|
### Inside a docker
|
||||||
|
|
||||||
```sh
|
If you are using docker-compose:
|
||||||
docker build -t transfer_more . && docker run -p 3000:3000 transfer_more
|
|
||||||
```
|
|
||||||
|
|
||||||
Or with docker-compose:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker-compose build && docker-compose up
|
docker-compose build && docker-compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Else, you can do:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker build -t transfer_more . && docker run transfer_more
|
||||||
|
```
|
||||||
|
|
||||||
### [ShareX](https://github.com/ShareX) template
|
### [ShareX](https://github.com/ShareX) template
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|
BIN
public/images/kemal.png
Normal file
BIN
public/images/kemal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
2
public/images/kemal.svg
Normal file
2
public/images/kemal.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 25 KiB |
|
@ -1,5 +1,5 @@
|
||||||
name: transfer_more
|
name: transfer_more
|
||||||
version: 0.5.9
|
version: 0.5.3
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- Arthur Poulet <arthur.poulet@sceptique.eu>
|
- Arthur Poulet <arthur.poulet@sceptique.eu>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<title>File upload with kemal</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<title><%= ENV.fetch("TRANSFER_MORE_TITLE", "File upload") %></title>
|
|
||||||
<link rel="stylesheet" href="/css/bootstrap.min.css" />
|
<link rel="stylesheet" href="/css/bootstrap.min.css" />
|
||||||
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous" /> -->
|
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous" /> -->
|
||||||
<!-- <link rel="stylesheet" href="//octicons.github.com/components/octicons/octicons/octicons.css"> -->
|
<!-- <link rel="stylesheet" href="//octicons.github.com/components/octicons/octicons/octicons.css"> -->
|
||||||
|
@ -11,54 +10,14 @@
|
||||||
<!-- <script src="/js/dropzone.js"></script> -->
|
<!-- <script src="/js/dropzone.js"></script> -->
|
||||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
|
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body {
|
body { text-align:center;font-family:helvetica,arial;font-size:22px;color:#888;margin:20px;}
|
||||||
text-align: center;
|
a { color:#66b;text-decoration:none; }
|
||||||
font-family: Helvetica, Arial;
|
#c {margin:0 auto;width:500px;text-align:left}
|
||||||
font-size: 22px;
|
|
||||||
color: #888;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
color: #66b;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
#c {
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 500px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
.dropzone {
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
padding: 1em 0;
|
|
||||||
margin: 1em auto;
|
|
||||||
color: #555;
|
|
||||||
border: 2px dashed #555;
|
|
||||||
border-radius: 6px;
|
|
||||||
cursor: default;
|
|
||||||
height: 400px;
|
|
||||||
max-width: 400px;
|
|
||||||
background-color: rgba(250, 166, 180, 0.5);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: bottom;
|
|
||||||
}
|
|
||||||
#dropzone.hover {
|
|
||||||
color: #eaa
|
|
||||||
border-color: #eaa;
|
|
||||||
border-style: solid;
|
|
||||||
box-shadow: inset 0 4px 4px #888;
|
|
||||||
}
|
|
||||||
footer {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 1em;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h2><%= ENV.fetch("TRANSFER_MORE_TITLE", "File upload") %></h2>
|
<h2>File upload with kemal</h2>
|
||||||
<% if !file_url.empty? %>
|
<% if !file_url.empty? %>
|
||||||
<div class="alert alert-success">
|
<div class="alert alert-success">
|
||||||
<p>Upload url: <a href="<%= file_url %>"><%= file_url %></a></p>
|
<p>Upload url: <a href="<%= file_url %>"><%= file_url %></a></p>
|
||||||
|
@ -74,19 +33,22 @@
|
||||||
|
|
||||||
<form method="POST" action="/" enctype="multipart/form-data">
|
<form method="POST" action="/" enctype="multipart/form-data">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="dropzone-bg">
|
<div class="col-lg-10">
|
||||||
<input name="commit" value="Upload" class="btn btn-primary" type="submit">
|
<input name="commit" value="Upload" class="btn btn-primary" type="submit">
|
||||||
<input class="form-control dropzone" name="file" id="file" type="file" required>Drop files</input>
|
<input class="btn btn-default" name="file" id="file" type="file" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<!-- <img src="/images/kemal.png"> -->
|
||||||
|
<img src="/images/kemal.svg">
|
||||||
|
<!-- <img src="https://kemalcr.com/img/kemal.png"> -->
|
||||||
|
|
||||||
<footer>
|
<footer style="position:fixed;bottom:0px;padding:60px;">
|
||||||
<span>
|
<span style="position:fixed;left:10%">
|
||||||
<%= ENV.fetch("TRANSFER_MORE_FOOTER", "built by <a href=\"https://git.sceptique.eu/Sceptique\">Sceptique</a>, powered with <a href=\"http://kemalcr.com/\">kemal</a>") %>
|
built by <a href="https://github.com/Nephos/">Nephos</a> with <a href="http://kemalcr.com/">kemal</a>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span style="position:fixed;right:10%">
|
||||||
<a href="https://git.sceptique.eu/Sceptique/transfer_more">Fork or patch me</a>
|
<a href="https://github.com/Nephos/transfer_more">Fork me</a>
|
||||||
</span>
|
</span>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user