Compare commits

...

4 Commits

3 changed files with 66 additions and 6 deletions

View File

@ -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.6.0
Compatible crystal v1.7
### 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
```

View File

@ -1,5 +1,5 @@
name: transfer_more
version: 0.5.3
version: 0.5.8
authors:
- Arthur Poulet <arthur.poulet@sceptique.eu>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>File upload with kemal</title>
<title><%= ENV.fetch("TRANSFER_MORE_TITLE", "File upload") %></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<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" /> -->
@ -39,7 +39,7 @@
</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>
@ -64,10 +64,10 @@
<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>
<%= 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>
<a href="https://git.sceptique.eu/Sceptique/transfer_more">Fork or patch me</a>
</span>
</footer>
</body>