Compare commits
104 Commits
Author | SHA1 | Date |
---|---|---|
Arthur POULET | 0ad9d4ead6 | |
dece | faf0b2e62c | |
dece | 5b1d9ad6c6 | |
dece | c76d2d2204 | |
dece | 8f1e2c6309 | |
Arthur POULET | c0ec14c8b8 | |
Arthur POULET | 464bd352a0 | |
Arthur POULET | 5b255b7344 | |
Arthur POULET | d9e416f47f | |
Arthur POULET | 91cd3746ad | |
Arthur POULET | 1faa3a29c3 | |
Arthur POULET | 58d8b3e629 | |
dece | b6365a5dfb | |
Arthur POULET | db0c047d23 | |
Arthur POULET | 437e83d919 | |
Arthur POULET | eb63247c25 | |
Arthur POULET | d47f98a277 | |
Arthur POULET | 5f889bb284 | |
Arthur POULET | 751e57dafc | |
Arthur POULET | febda62a5c | |
Arthur POULET | 261ecbb1a1 | |
Arthur POULET | da03f4015c | |
Arthur POULET | 3cf85dff17 | |
Arthur POULET | a736916f7d | |
Lampros Chaidas | ade4beb0ae | |
Arthur Poulet | 5b596f05ca | |
Arthur POULET | 356ba5e3bc | |
Arthur POULET | fa1507e29d | |
Arthur POULET | 9c8fbcf7b9 | |
Arthur POULET | 3df864e946 | |
Arthur POULET | 156494c74f | |
Lucie-Dispot | aa2f9d11a1 | |
Arthur POULET | 84034daa8b | |
Arthur POULET | 6cbfa60450 | |
Arthur POULET | 7dfd27cd6b | |
Arthur POULET | 7d083f94f8 | |
Arthur POULET | 9beac1ceeb | |
Arthur POULET | 84bb3b52e3 | |
Arthur POULET | 1a2822e948 | |
Arthur POULET | 0c5ed87aaa | |
Arthur POULET | d64a8d85d2 | |
Arthur POULET | c2b1cadfbb | |
Arthur POULET | d2be334510 | |
Arthur POULET | a2500aaa38 | |
Arthur POULET | dd12a9f121 | |
Arthur POULET | 5a5c7e62d4 | |
Arthur POULET | a14801a541 | |
Arthur POULET | 252446126c | |
Arthur POULET | 313af5819f | |
Arthur POULET | 9029c132ba | |
Arthur POULET | 2746790cb4 | |
Arthur POULET | b5f254f699 | |
Arthur POULET | fc5d6206e4 | |
Arthur POULET | d2388c98c9 | |
Arthur POULET | b4723773e9 | |
Arthur POULET | 3202e68213 | |
Arthur POULET | dec3776072 | |
Arthur POULET | 8bad255d19 | |
Arthur POULET | a53c939540 | |
Arthur POULET | 1c64edb4d8 | |
Arthur POULET | ad348b4cbc | |
Arthur POULET | ab4283e836 | |
Arthur POULET | fd408985b4 | |
Arthur POULET | f515b90176 | |
Arthur POULET | 1a995ca8be | |
Arthur POULET | 4353ede23f | |
Arthur POULET | 539c282f10 | |
Arthur POULET | 1c9f2bc661 | |
Arthur POULET | 2b1f7af389 | |
Arthur POULET | c07347e48f | |
Arthur POULET | 066256a718 | |
Arthur POULET | 5af34e3dc3 | |
Arthur POULET | f627d43d84 | |
Arthur POULET | d8cfb5e3a7 | |
Arthur POULET | 1320d534e1 | |
Arthur POULET | 80175d81c3 | |
Arthur POULET | fb8e0857f9 | |
Arthur POULET | a8921ec26b | |
Arthur POULET | 415c2a4945 | |
Arthur POULET | 04b2f750c8 | |
Arthur POULET | f706ada8be | |
Arthur POULET | 3cf9f00472 | |
Arthur POULET | a12a60106b | |
Arthur POULET | 58166cfc93 | |
Arthur Poulet | 6d9c94ed06 | |
Arthur Poulet | 2e92c22c41 | |
Arthur Poulet | bb46ff6ff0 | |
Arthur Poulet | 4fbac24c29 | |
Arthur Poulet | e8bc3d6b24 | |
Arthur Poulet | a27834050b | |
Arthur Poulet | ba734ca83f | |
Arthur Poulet | f0de0ff69d | |
Arthur Poulet | 71ea07b095 | |
Arthur Poulet | 730d1f0fce | |
Arthur Poulet | 1ca937b00f | |
Arthur Poulet | caaa227e79 | |
Arthur Poulet | e9f679ceb8 | |
Arthur Poulet | 91f279b4a2 | |
Arthur Poulet | 98469689e9 | |
Arthur Poulet | 17d40578b7 | |
Arthur Poulet | 4c327987bd | |
Arthur Poulet | c9b500716e | |
Arthur Poulet | b1aab3217b | |
Arthur Poulet | fcd4987b21 |
28
Dockerfile
28
Dockerfile
|
@ -1,25 +1,29 @@
|
|||
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 . /transfer_more
|
||||
WORKDIR /transfer_more
|
||||
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
|
||||
RUN shards install
|
||||
|
||||
# Build our app
|
||||
RUN crystal build --release --warnings all src/transfer_more.cr
|
||||
|
||||
# Run the tests
|
||||
RUN mkdir /tmp/files
|
||||
#RUN crystal spec
|
||||
RUN mkdir /tmp/files && 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)
|
||||
|
||||
Compatible crystal v1.4.1
|
||||
Compatible crystal v1.9.2
|
||||
|
||||
### From source
|
||||
|
||||
|
@ -28,6 +28,64 @@ make doc # build the documentation
|
|||
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
|
||||
|
||||
### 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_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_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
|
||||
```
|
||||
|
||||
|
@ -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
|
||||
```
|
||||
|
||||
### 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
|
||||
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
|
||||
|
||||
```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
|
||||
version: 0.5.3
|
||||
version: 0.5.9
|
||||
|
||||
authors:
|
||||
- Arthur Poulet <arthur.poulet@sceptique.eu>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>File upload with kemal</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta 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="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"> -->
|
||||
|
@ -10,14 +11,54 @@
|
|||
<!-- <script src="/js/dropzone.js"></script> -->
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
|
||||
<style type="text/css">
|
||||
body { text-align:center;font-family:helvetica,arial;font-size:22px;color:#888;margin:20px;}
|
||||
a { color:#66b;text-decoration:none; }
|
||||
#c {margin:0 auto;width:500px;text-align:left}
|
||||
body {
|
||||
text-align: center;
|
||||
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>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h2>File upload with kemal</h2>
|
||||
<h2><%= ENV.fetch("TRANSFER_MORE_TITLE", "File upload") %></h2>
|
||||
<% if !file_url.empty? %>
|
||||
<div class="alert alert-success">
|
||||
<p>Upload url: <a href="<%= file_url %>"><%= file_url %></a></p>
|
||||
|
@ -33,22 +74,19 @@
|
|||
|
||||
<form method="POST" action="/" enctype="multipart/form-data">
|
||||
<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 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>
|
||||
</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;">
|
||||
<span style="position:fixed;left:10%">
|
||||
built by <a href="https://github.com/Nephos/">Nephos</a> with <a href="http://kemalcr.com/">kemal</a>
|
||||
<footer>
|
||||
<span>
|
||||
<%= 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 style="position:fixed;right:10%">
|
||||
<a href="https://github.com/Nephos/transfer_more">Fork me</a>
|
||||
<span>
|
||||
<a href="https://git.sceptique.eu/Sceptique/transfer_more">Fork or patch me</a>
|
||||
</span>
|
||||
</footer>
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue