i is a minimal program for uploading files to your server and getting a "i.example.com/file.png" link back, similar to imgur.com. It is compatible with the open source image capture program Share X.
It does not serve the files or handle authentification. It is meant to be used with a server like nginx or caddy.
- golang
- Open
i.go
and edit the configuration (set theroot
andwebRoot
variable to your desired values) - Compile with
go build
- Create a init.d service (if you are using another system skip this part)
- Copy the exampleservice file to /etc/init.d/ and call it
i
- Edit it and change the
WWW_USER
to the user you want andAPPROOT
to the directory that the executable is in. - Make it executable
sudo chmod +x /etc/init.d/i
- Make it a service
sudo update-rc.d i defaults
- Copy the exampleservice file to /etc/init.d/ and call it
- Add a custom sharex uploader like this:
-
Install the
apach2-utils
to generate a htpasswd file for authentification -
Create a reverse proxy for your webserver. For example use i.example.com/upload to upload the images (by default to port 9005). Add basic auth to hande the authentification.
location /upload { auth_basic "Restricted Content"; auth_basic_user_file /etc/fileupload.htpasswd; proxy_pass http://localhost:9005; }
-
Create a .htpasswd file using
htpasswd -c /etc/fileupload.htpasswd user
and enter a password. -
Base64 encode user:password
echo -n user:yourpassword | base64
and add a headerAuthorization: Basic <your base64>
in sharex
- Create a reverse proxy for your webserver. For example use i.example.com/upload to upload the images (by default to port 9005).
- Create a hashed password with
caddy hash-password
, add basic auth to handle the authentification.i.example.com { root * /var/www/i.example.com file_server basicauth /upload { user hashed_password } reverse_proxy /upload localhost:9005 }
- Base64 encode user:password
echo -n user:yourpassword | base64
and add a headerAuthorization: Basic <your base64>
in sharex (image in the nginx example)
- idk figure it out, should be similar to nginx ¯\_(ツ)_/¯