Compare commits

..

100 Commits

Author SHA1 Message Date
f1efec3a74 Update kemalrc and fix dependency version 2022-11-16 11:48:28 +01:00
167059b4ca Update README 2022-08-07 11:27:23 +02:00
a31c1159ca
Fix make install
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2022-07-09 13:10:04 +02:00
069309c6af
Fix static file serving, add favicon
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-07-09 10:18:26 +02:00
d6406d529f
Fix drone CI
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-08 22:54:32 +02:00
d096d094eb
Update drone and readme
Some checks failed
continuous-integration/drone/push Build is failing
2022-07-08 22:41:18 +02:00
3ca8e367fc
Merge branch 'master' of git.sceptique.eu:Sceptique/transfer_more 2022-07-08 22:36:39 +02:00
7ecffcb751
Update drone and readme 2022-07-08 22:36:06 +02:00
Arthur POULET
b0005e7285 Fix warning for crystal 1.3.1 2022-01-15 18:02:39 +01:00
579904549b
Update deps 2021-05-01 22:52:56 +02:00
642ff1f7a1 Update to crystal v0.35.1 2020-12-19 11:32:42 +01:00
c18493167f Update version 2020-04-17 13:35:53 +02:00
138eee76b9 Merge branch 'crystal_0.33' of git://github.com/weirdbricks/transfer_more into weirdbricks-crystal_0.33 2020-04-17 11:58:12 +02:00
Lampros Chaidas
5ff00ab68c crystal v0.33 compatible 2020-04-04 22:26:35 -07:00
9a8de056a2
Update docker file 2019-10-28 21:55:57 +01:00
f9a54de35d
Update version v0.5.1 2019-02-21 22:40:57 +01:00
31a64dc89e
Fix date parsing 2019-02-21 22:40:35 +01:00
1a113e51c7
Update title 2019-02-21 22:40:18 +01:00
3bcee0e615
Update README 2019-02-21 22:08:04 +01:00
Arthur Poulet
2ebf20f6c0
Update readme 2019-02-18 12:07:23 +01:00
1ccc38e328
Merge branch 'master' of github.com:Nephos/transfer_more 2018-11-26 00:23:45 +01:00
d582bbe182
Update README picture 2018-11-26 00:23:00 +01:00
Arthur Poulet
9975d1e560
Merge pull request #4 from Lucie-Dispot/patch-1
Update README.md
2018-11-25 03:19:22 +01:00
Lucie-Dispot
abf531d522
Update README.md 2018-11-24 00:01:42 +01:00
40b636dffe
Add required to file upload 2018-11-12 00:12:29 +01:00
fc2ccfae4a
Dump version v0.5.0 2018-11-12 00:10:56 +01:00
6e3bda752d
Fix image 2018-11-11 23:50:27 +01:00
052f857f17
Add image 2018-11-11 23:47:09 +01:00
f9defce223
Fix some upload with browsers 2018-11-11 23:45:18 +01:00
bf82c1b95e
Upgrade some doc and version 2018-11-06 00:24:02 +01:00
18cad618d6
Update to compile with crystal v0.27.0 2018-11-06 00:22:51 +01:00
4e3f08603f
Update README 2018-10-29 00:48:13 +01:00
7e4fec1569
Bump version v0.4.1 2018-10-28 22:40:53 +01:00
4288e89283
Update kemalcr and crystal 2018-10-28 22:40:08 +01:00
00b04e865e
Update version to 0.4.0 2017-12-30 01:06:48 +01:00
0a90603c93
Fix christmas 2017-12-30 01:06:16 +01:00
b41731427b
Update with crystal v0.24.1 2017-12-30 01:05:23 +01:00
532f226032
Update README 2017-12-26 19:30:24 +01:00
a27abbe661
Improve makefile with NAME configurable 2017-12-26 19:27:26 +01:00
d21502b068 Add install/uninstall rules 2017-12-26 12:39:47 +01:00
e5d620b676
Upgrade to version 0.3.2 2017-10-27 00:58:27 +02:00
bb9787099a
Add TRANSFER_SSL_ENABLED 2017-10-27 00:57:36 +02:00
bb6ccfa96d
Upgrade to version 0.3.2 2017-10-27 00:49:08 +02:00
cc58c840c7
Add auto-detect host and port of the server (by request) 2017-10-27 00:48:29 +02:00
a3080917d9
Add 500 http status 2017-10-27 00:17:11 +02:00
891bd9cf87
Factorize file upload and fix error details leak 2017-10-27 00:15:57 +02:00
28a646d83d
Fix image in the readme 2017-10-26 13:24:54 +02:00
8b0f5c8364
Add image in the readme 2017-10-26 13:23:17 +02:00
21d222848c
Improve upload form 2017-10-26 13:18:16 +02:00
e8829db154
Add web browser upload route 2017-10-25 22:25:47 +02:00
c29fa441bc
Merge branch 'develop' 2017-10-23 21:07:11 +02:00
de5ff64981
Update dependancies 2017-10-23 21:06:21 +02:00
00e8d2cb4c
Add 'txt' 'patch' and 'md' to the text mime 2017-08-26 11:35:56 +02:00
061c6783d5
Merge branch 'develop' 2017-06-11 15:55:25 +01:00
84bc88c168
Improve configuration
- add storage duration

- add secure size

- add time format
2017-06-11 15:54:41 +01:00
03733610e6
Change LICENSE to GPL-3.0 2017-04-13 13:51:27 +01:00
809d5b5045
Merge branch 'develop' 2017-04-13 00:25:14 +01:00
0afe9fe4e4
Update to v0.2.1 2017-04-13 00:24:56 +01:00
77dafb9fbc
Merge branch 'develop' 2017-04-13 00:19:23 +01:00
bca8c49cd1
Merge branch 'feature/better_big_files' into develop 2017-04-13 00:18:54 +01:00
8db0bb0d8a
Update kemal version 2017-04-13 00:10:18 +01:00
46f10442f9
Reduce the url size 2017-04-12 23:21:00 +01:00
171f6dcdc7
Update deps + upload with post & put 2017-02-13 23:09:39 +00:00
ff3598971c
Update to crystal v0.20, big file work
It is possible to upload very big files as files are not converted to string
automatically. They are written by 2^16 bytes at a time.
2016-11-29 12:30:02 +00:00
a9e72c11a3
Update Makefile (change deps install rule) 2016-10-17 12:43:45 +01:00
e5833c7872
Update specs (kemal) 2016-10-13 00:09:37 +01:00
19b590362e
Udate Dockerfile and relative readme
- add docker entry in the README file
- fix `compile` with `build` in Dockerfile
2016-10-11 17:25:05 +01:00
fb53fc7cd3
Clean index.ecr 2016-10-11 11:43:13 +01:00
8304c1f83c
Improve global architecture
- Update README
- Add `make run`
- move web actions on web/
- move lib classes and constants on lib/
2016-10-11 11:01:18 +01:00
cd4604582d
Fix docker file deps installation 2016-10-10 22:02:24 +01:00
48dc88f60b
Update crystal and use multipart 2016-10-10 11:16:08 +01:00
a0270760e3
Improve EXT_TRANSFORM 2016-08-25 00:18:49 +02:00
8233e5e5eb
update to v0.1.1 2016-07-06 20:41:37 +02:00
55aa216759
better directory init 2016-07-06 20:40:42 +02:00
4c7ec1e41d
fix specs (no specs) and add travis build image 2016-07-06 20:34:55 +02:00
178b6c9a41
add Dockerfile and docker-compose config 2016-07-03 14:35:05 +02:00
a2ba2da073
fix purge delay 2016-07-03 14:12:56 +02:00
64801c97e7
Some error improvements and configuration
- 404 error instead of 500 when file not found
- add TRANSFER_BASE_STORAGE env var
- improve env var handlement
- more robust purge
2016-07-03 14:05:48 +02:00
28dbd93975
fix format (crystal tool format) 2016-07-03 01:30:32 +02:00
e6ee45582e
update email 2016-06-29 21:54:27 +02:00
Arthur Poulet
64a9e6ab90
update makefile to crystal 0.18 2016-06-17 15:44:34 +02:00
Arthur Poulet
d20ef28621
fix plain text
- add transformation txt -> plain
- add charset utf-8 by default for plain text
- fix mime render via extnam
2016-05-23 21:53:15 +02:00
Arthur Poulet
f76c1745d3
update readme 2016-05-23 14:04:27 +02:00
Arthur Poulet
250c2ba736
fix mime search for unix shebang 2016-05-21 14:18:20 +02:00
Arthur Poulet
858d182169
improve index.ecr 2016-05-20 20:11:18 +02:00
Arthur Poulet
b469b3279d
move mime search to mime_search.cr
- create a class MimeSearch
- add new magic numbers
2016-05-20 19:19:29 +02:00
Arthur Poulet
1c92ecbdcb
fix mime search 2016-05-20 18:48:30 +02:00
Arthur Poulet
5f1c408374
Improve mime search
- add magic number search
- improve lisibility
2016-05-20 18:38:19 +02:00
Arthur Poulet
b0ba37da3b
All filenames are downcased before save or send 2016-05-20 17:48:53 +02:00
Arthur Poulet
507d4f870f
add jpe 2016-05-20 17:46:58 +02:00
Arthur Poulet
5d4c759907
update README 2016-05-20 17:39:44 +02:00
Arthur Poulet
2bcbc3277c
update README 2016-05-20 17:21:01 +02:00
Arthur Poulet
25b5de72cc
Add purge system
- a Fiber check every minutes if the files must be removed
- purge every files older than 7 days (1 minutes more or less)
- each files is in a dir based on the upload time (1 minutes more or
  less) and a dedied spawn destroy it
2016-05-20 17:18:04 +02:00
Arthur Poulet
079d753a40
Improve mkdir 2016-05-20 17:17:11 +02:00
Arthur Poulet
59a71a84b9
Use ECR instead of HTML to serve the index 2016-05-20 15:10:29 +02:00
Arthur Poulet
9ef266fb3e
update README 2016-05-20 14:56:12 +02:00
Arthur Poulet
e0638f2830
add Makefile (build, doc, test, release, deps)
close #1
2016-05-20 14:35:41 +02:00
Arthur Poulet
e8da944333
use SecureRandom.hex instead of base64 2016-05-20 14:24:50 +02:00
Arthur Poulet
bfc63d82ae
add index.html, improve readme and fix some stuff 2016-05-20 00:33:23 +02:00
Arthur Poulet
e216dd4507
update readme 2016-05-19 23:20:36 +02:00
6 changed files with 41 additions and 139 deletions

View File

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

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) ## 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

2
public/images/kemal.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 25 KiB

View File

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

View File

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