Code Monkey home page Code Monkey logo

airlift's People

Contributors

franzf avatar lapwat avatar moshee avatar zackboe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airlift's Issues

web: split up javascripts

According to web best practices, javascript should be included somewhere near the end of the content anyways so as not to block rendering.

Instead of putting the one global js file in the head, we should be able to add them to the end of the content as needed. Each page has its own specific js, as well as maybe some common stuff that can be included along with it.

thumb: fatal error: concurrent map writes

fatal error: concurrent map writes

goroutine 419 [running]:
runtime.throw(0xa802e0, 0x15)
        /usr/local/go/src/runtime/panic.go:530 +0x90 fp=0xc8260edcf0 sp=0xc8260edcd8
runtime.mapassign1(0x89d4a0, 0xc82025a600, 0xc8260edf40, 0xc8260ede40)
        /usr/local/go/src/runtime/hashmap.go:540 +0x54b fp=0xc8260edd98 sp=0xc8260edcf0
ktkr.us/pkg/airlift/thumb.(*Cache).getThumb.func1(0xc82018a7e0, 0xc82148a220)
        /home/moshee/projects/go/src/ktkr.us/pkg/airlift/thumb/thumb.go:302 +0xdbd fp=0xc8260edf90 sp=0xc8260edd9
8
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc8260edf98 sp=0xc8260edf90
created by ktkr.us/pkg/airlift/thumb.(*Cache).getThumb
        /home/moshee/projects/go/src/ktkr.us/pkg/airlift/thumb/thumb.go:304 +0x1f9

Updater mechanism

Include an updater mechanism (separate shell script?) that does the following:

  • Checking against a known newest version (github releases?)
  • Downloading and replacing the binary.
  • Gracefully stopping the server and accepting requests on a new process.

A built in updater on the binary would be less than ideal, since we would want to leave airlift easily packageable by downstream, which already have their own package managers, et al.

Can't install

If I do a go get -u ktkr.us/pkg/airlift, I get the error:

    imports ktkr.us/pkg/gas: /Users/mtiller/Source/GoWorkspace/src/ktkr.us/pkg/gas exists but /Users/mtiller/Source/GoWorkspace/src/ktkr.us/pkg/gas/.git does not - stale checkout?
# cd .; git clone https://github.com/moshee/gas/out /Users/mtiller/Source/GoWorkspace/src/ktkr.us/pkg/gas/out
Cloning into '/Users/mtiller/Source/GoWorkspace/src/ktkr.us/pkg/gas/out'...
fatal: repository 'https://github.com/moshee/gas/out/' not found

Cannot get the projet

Hi,

Few months ago, I've build your project to put it in the Docker Hub. But, recently I can't build the image. Go cannot get the package. Here is the error:

$ docker build -t airlifd .
Sending build context to Docker daemon 671.7 kB
Step 1 : FROM golang
 ---> 12057194b5fc
Step 2 : MAINTAINER moshee <[email protected]>
 ---> Running in a6114cb79e4d
 ---> a17f4955ca5f
Removing intermediate container a6114cb79e4d
Step 3 : RUN go get -u ktkr.us/pkg/airlift/cmd/airliftd
 ---> Running in 43504e065998
package ktkr.us/pkg/airlift/cmd/airliftd: unrecognized import path "ktkr.us/pkg/airlift/cmd/airliftd"
The command '/bin/sh -c go get -u ktkr.us/pkg/airlift/cmd/airliftd' returned a non-zero code: 1

I cannot get the project on my laptop neither. Maybe I miss something in the Go configuration but it seems like this is a 404 error from your repo.

web: refresh config values on form submit

The values shown on the form do not necessarily reflect the real values, such as in the case of the server limiting the hash length to 64 when the user entered a greater number.

Customizable cache location

Good afternoon,

I am doing some testing,
and it would seem that while a file is being uploaded,
it is being cached on the root file system instead of where you specify upload.

I can't figure out where it is being cached currently,
but it's a bit of a headache to not have the separation of file systems.

Would it be possible to be allowed to specify cache location,
or at the very least know where it is being cached currently.

Make web interface URL routes unreachable with IDs

In the beginning I didn't want to make ID lengths configurable because it could possibly collide with routes like /config and /history. This can be easily solved by putting all of the page and control routes under a path like /-/ (so /config would be /-/config). IDs can never collide because - is not a valid character. godoc.org uses this.

web: better error checking on uploader

There are still various possible HTML error pages that can return from the JSON API (e.g. when nginx returns its own error page). Make error checking more robust.

Development

Hey there

Is development on this app on hold? I tested it with a 5GB file and after it was done uploaded, the link was made instantly which it amazing. I tested a few other scripts in node/php/go/python and some took a while to process after it was done uploading.

Do you know if the download speeds are being throttled? I tried downloading the file after uploading and it was stuck at 1MB/s

cache: retry hashing to avoid collision

While the chance is small, reducing the hash length this dramatically will have a negative impact on the collision strength of the file hash. We can just keep reading out of the Shake256 hash object until we get a hash that doesn't exist. This, however, will remove the behavior that uploading the exact same file twice will not create two separate files on the server.

Clipboard uploading from the web view

Allow the user the upload the clipboard from the web view. Mostly useful on Windows (Print Screen -> Upload) in lieu of creating a Windows client.

Package static content like HTML and CSS with the binary.

The ideal solution would be having the binary extract files on launch to the process owner's $HOME/.airlift-server. Include some sort of versioning (hash checks?) so the binary knows when to overwrite content, but allow the user to edit his own copies by giving higher priority to local versions. (Ex: load .airlift-server/static/style-local.css over style.css?)

on win10, when upload a file, always report Error, it always occours

hi, moshee!
I run this program on windows 10, when upload a file, it always report a error blow

Error: rename d:\airliftd\uploads\EC2_az.csv d:\airliftd\uploads\jcoQ.EC2_az.csv: 
The process cannot access the file because it is being used by another process.

and when I go to the upload folder, the file was uploaded success, but the hash prefix was not added to the filename.

I don't know what's going on, maybe the code contains bug?

some logs

2020/11/10 09:45:37 route.go:340: === Session: 2020-11-10 09:45 =========================
2020/11/10 09:45:37 route.go:346: GAS_PORT, GAS_TLS_PORT, and GAS_FAST_CGI are deprecated, please use GAS_LISTEN
2020/11/10 09:45:37 gas.go:336: Server listening on port 60606
2020/11/10 09:45:47 route.go:318: [ 999µs]             ::1 HTTP/1.1     GET (200) localhost/
2020/11/10 09:45:49 route.go:318: [   0ns]             ::1 HTTP/1.1     GET (200) localhost/-/login
2020/11/10 09:45:52 util.go:102: reroute error: reroute: no cookie found
2020/11/10 09:45:52 route.go:318: [  39ms]             ::1 HTTP/1.1    POST (302) localhost/-/login
2020/11/10 09:45:52 route.go:318: [   1ms]             ::1 HTTP/1.1     GET (200) localhost/
2020/11/10 09:45:54 route.go:318: [   0ns]             ::1 HTTP/1.1     GET (200) localhost/
2020/11/10 09:45:56 route.go:318: [   0ns]             ::1 HTTP/1.1     GET (200) localhost/
2020/11/10 09:45:58 route.go:318: [   1ms]             ::1 HTTP/1.1     GET (200) localhost/-/history/1
2020/11/10 09:45:59 route.go:318: [   1ms]             ::1 HTTP/1.1     GET (200) localhost/
2020/11/10 09:46:05 server.go:552: POST postFile: rename d:\airliftd\uploads\xxxx.docx d:\airliftd\uploads\DNsM.xxxx.docx: The process cannot access the file because it is being used by another process.
2020/11/10 09:46:05 route.go:318: [   7ms]             ::1 HTTP/1.1    POST (500) localhost/upload/web

cache: file being added may overwrite an existing file

In a pathological case, a file being uploaded that has the same name as an existing file ID-prefixed file may overwrite it before it gets its own ID prepended in cache.Put. Should use a temp location (either in the data directory or in os.TempDir()) prior to prepending the file ID.

thumb: investigate memory leak

Memory usage goes up every time uncached twitter thumbnail is requested and could eventually start crashing if GC doesn't kick in and memory size is small

web: make form submission message position:fixed

With an ever-expanding config page, sometimes that message can be hidden higher up on the page, especially on mobile. Current behavior also violates a golden rule, which is to never shift controls underneath the user's mouse.

admin & non admin password

This is a feature request. It would be nice to be able to have 2 passwords. 1 for Admin and 1 for everyone else. So that I can give a url and password to somebody and they don't have access to the upload and configure links? But can upload to the server.

web: "Server error: OK" uploading when cookie has expired

Trying to upload a file from the web interface having left the page open after the cookie expired causes a weird failure.

The cookies need to last longer. They're supposed to last for a week after the last activity. Not sure what's going on.

Also, it seems like under certain circumstances trying to log in after this happens redirects back to /upload/web, which is wrong.

Install documentation

I ran into an issue when trying to install using go get because the docs include the -d flag which prevents it from installing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.