Compare commits
104 Commits
Author | SHA1 | Date | |
---|---|---|---|
0ad9d4ead6 | |||
|
faf0b2e62c | ||
|
5b1d9ad6c6 | ||
|
c76d2d2204 | ||
|
8f1e2c6309 | ||
c0ec14c8b8 | |||
464bd352a0 | |||
5b255b7344 | |||
d9e416f47f | |||
91cd3746ad | |||
1faa3a29c3 | |||
58d8b3e629 | |||
|
b6365a5dfb | ||
db0c047d23 | |||
437e83d919 | |||
eb63247c25 | |||
d47f98a277 | |||
5f889bb284 | |||
751e57dafc | |||
|
febda62a5c | ||
261ecbb1a1 | |||
da03f4015c | |||
3cf85dff17 | |||
a736916f7d | |||
|
ade4beb0ae | ||
|
5b596f05ca | ||
356ba5e3bc | |||
fa1507e29d | |||
9c8fbcf7b9 | |||
3df864e946 | |||
156494c74f | |||
|
aa2f9d11a1 | ||
84034daa8b | |||
6cbfa60450 | |||
7dfd27cd6b | |||
7d083f94f8 | |||
9beac1ceeb | |||
84bb3b52e3 | |||
1a2822e948 | |||
0c5ed87aaa | |||
d64a8d85d2 | |||
c2b1cadfbb | |||
d2be334510 | |||
a2500aaa38 | |||
dd12a9f121 | |||
5a5c7e62d4 | |||
a14801a541 | |||
252446126c | |||
313af5819f | |||
9029c132ba | |||
2746790cb4 | |||
b5f254f699 | |||
fc5d6206e4 | |||
d2388c98c9 | |||
b4723773e9 | |||
3202e68213 | |||
dec3776072 | |||
8bad255d19 | |||
a53c939540 | |||
1c64edb4d8 | |||
ad348b4cbc | |||
ab4283e836 | |||
fd408985b4 | |||
f515b90176 | |||
1a995ca8be | |||
4353ede23f | |||
539c282f10 | |||
1c9f2bc661 | |||
2b1f7af389 | |||
c07347e48f | |||
066256a718 | |||
5af34e3dc3 | |||
f627d43d84 | |||
d8cfb5e3a7 | |||
1320d534e1 | |||
80175d81c3 | |||
fb8e0857f9 | |||
a8921ec26b | |||
415c2a4945 | |||
04b2f750c8 | |||
f706ada8be | |||
3cf9f00472 | |||
a12a60106b | |||
58166cfc93 | |||
|
6d9c94ed06 | ||
|
2e92c22c41 | ||
|
bb46ff6ff0 | ||
|
4fbac24c29 | ||
|
e8bc3d6b24 | ||
|
a27834050b | ||
|
ba734ca83f | ||
|
f0de0ff69d | ||
|
71ea07b095 | ||
|
730d1f0fce | ||
|
1ca937b00f | ||
|
caaa227e79 | ||
|
e9f679ceb8 | ||
|
91f279b4a2 | ||
|
98469689e9 | ||
|
17d40578b7 | ||
|
4c327987bd | ||
|
c9b500716e | ||
|
b1aab3217b | ||
|
fcd4987b21 |
28
Dockerfile
28
Dockerfile
|
@ -1,25 +1,29 @@
|
||||||
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
|
|
||||||
|
|
||||||
MAINTAINER Arthur Poulet <arthur.poulet@sceptique.eu>
|
|
||||||
|
|
||||||
# Install shards
|
|
||||||
WORKDIR /usr/local
|
|
||||||
|
|
||||||
# Add this directory to container as /app
|
# Add this directory to container as /app
|
||||||
ADD . /transfer_more
|
ADD . /build
|
||||||
WORKDIR /transfer_more
|
WORKDIR /build
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
crystal shards libc-dev yaml-dev libxml2-dev zlib-dev openssl-dev curl
|
||||||
|
|
||||||
|
# Install shards
|
||||||
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
|
RUN mkdir /tmp/files && crystal spec
|
||||||
#RUN crystal spec
|
|
||||||
|
|
||||||
EXPOSE 3000
|
FROM alpine:edge
|
||||||
|
MAINTAINER Arthur Poulet <arthur.poulet@sceptique.eu>
|
||||||
|
|
||||||
ENTRYPOINT ./transfer_more --port 3000
|
RUN apk add --no-cache libgcc libevent libgc++ pcre2
|
||||||
|
|
||||||
|
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.4.1
|
Compatible crystal v1.9.2
|
||||||
|
|
||||||
### From source
|
### From source
|
||||||
|
|
||||||
|
@ -28,6 +28,64 @@ 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
|
||||||
|
@ -39,6 +97,8 @@ 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
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -54,20 +114,18 @@ export TRANSFER_HOST_PORT="localhost:3000" # in pinciple it is auto solved using
|
||||||
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
|
### Inside a Docker container
|
||||||
|
|
||||||
If you are using docker-compose:
|
```sh
|
||||||
|
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
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.9 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 25 KiB |
|
@ -1,5 +1,5 @@
|
||||||
name: transfer_more
|
name: transfer_more
|
||||||
version: 0.5.3
|
version: 0.5.9
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- Arthur Poulet <arthur.poulet@sceptique.eu>
|
- Arthur Poulet <arthur.poulet@sceptique.eu>
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>File upload with kemal</title>
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<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"> -->
|
||||||
|
@ -10,14 +11,54 @@
|
||||||
<!-- <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 { text-align:center;font-family:helvetica,arial;font-size:22px;color:#888;margin:20px;}
|
body {
|
||||||
a { color:#66b;text-decoration:none; }
|
text-align: center;
|
||||||
#c {margin:0 auto;width:500px;text-align:left}
|
font-family: Helvetica, Arial;
|
||||||
|
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>File upload with kemal</h2>
|
<h2><%= ENV.fetch("TRANSFER_MORE_TITLE", "File upload") %></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>
|
||||||
|
@ -33,22 +74,19 @@
|
||||||
|
|
||||||
<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="col-lg-10">
|
<div class="dropzone-bg">
|
||||||
<input name="commit" value="Upload" class="btn btn-primary" type="submit">
|
<input name="commit" value="Upload" class="btn btn-primary" type="submit">
|
||||||
<input class="btn btn-default" name="file" id="file" type="file" required>
|
<input class="form-control dropzone" name="file" id="file" type="file" required>Drop files</input>
|
||||||
</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 style="position:fixed;bottom:0px;padding:60px;">
|
<footer>
|
||||||
<span style="position:fixed;left:10%">
|
<span>
|
||||||
built by <a href="https://github.com/Nephos/">Nephos</a> with <a href="http://kemalcr.com/">kemal</a>
|
<%= 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>") %>
|
||||||
</span>
|
</span>
|
||||||
<span style="position:fixed;right:10%">
|
<span>
|
||||||
<a href="https://github.com/Nephos/transfer_more">Fork me</a>
|
<a href="https://git.sceptique.eu/Sceptique/transfer_more">Fork or patch me</a>
|
||||||
</span>
|
</span>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user