Compare commits

...

5 commits

Author SHA1 Message Date
909606a996
Archive Fling
Update README, make Swagger UI page accessible
2021-01-12 04:29:09 +01:00
3b047f4b56
Update README, make Swagger UI page accessible
All checks were successful
continuous-integration/drone/push Build is passing
2020-07-29 19:25:41 +02:00
5c6bd1b1ad
Merge branch 'master' of git.friedl.net:incubator/fling
All checks were successful
continuous-integration/drone/push Build is passing
2020-07-29 01:53:31 +02:00
ab005b28e7
Use local URL, add Readme
Use local url in prod config. The local url works if docker is started
on localhost. If the container is deployed to a domain, the base URL
must be specified via REACT_APP_API environment variable.
2020-07-29 01:50:42 +02:00
0cfccffb1e Merge pull request 'Read configuration from environment' (#3) from dynamic-config into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: incubator/fling#3
2020-07-28 23:04:08 +00:00
2 changed files with 76 additions and 29 deletions

View file

@ -1,38 +1,68 @@
**12.01.2021: Fling has moved to the attic**
Fling was a good learning experiment for a non-trivial React app with a REST
backend. However, it never really got any traction and I'm not using it anymore.
Other projects are more important to me and maintaining Fling does not make any
sense. As of now docker containers are deleted and the artifacts are not
distributed anymore. You are free to fork and build your own version but no more
work will be done in this repository.
Alternatives:
- If you are looking for mature self-hosted file sharing solution,
[ownCloud](https://owncloud.com/) is in many ways similar to Fling and then
some.
- If you want an even simpler solution for sharing files over http,
[dirl](https://github.com/arminfriedl/dirl) might meet your needs.
# Fling
Have you ever missed the simplicity of an USB Stick when sharing data over the
net?
Zero-friction sharing is a surprisingly unsolved problem. There's no reasonably
ubiquitous solution installed on everybody's machine. Online providers are often
packed with features, but miss out on things like direct download urls, a space
for others to easily _upload_ to you, or require registration from all
participants. I don't remember any of these things being a problem with USB 🤔.
Fling is a self-hosted file share. It is simple like USB without missing out on
the good parts of the web:
- Drop files on a fling and share the URL. That's it. The fling way of life.
Other features include:
- Choose your own, meaningful name for your sharing URL
the good parts of a web app:
- Just drop files on a Fling and share the URL
- Choose your own name for your share-URL
- Share a direct download link
- Choose to let others upload files just as simple
- Let others upload files
- Protect your fling by a password - no registration required
- Let a fling expire after a date or a number of clicks (or keep it forever)
- Let a fling expire after a date or a number of clicks
# Fling is a API
It gets even better!
# API
Fling is distributed as both, a backend service and a web interface. You can use
the backend on its own with any [HTTP client](examples).
Fling is a backend service and a web interface. But you can use anything else
that speaks HTTP if you prefer. In fact, we generate and publish a javascript
and python client for the Fling API on every build. If you like it bare-bones
there is also a querysheet in the examples folder with raw HTTP calls.
Per default Fling publishes a Swagger UI page and an OpenAPI spec. You can find
them here:
Fling also has a code-first OpenAPI compliant spec. O mon Dieu, it just checks
_all_ the boxes!
``` http
http://<host>:<port>/swagger-ui.html
http://<host>:<port>/v3/api-docs
```
# Fling as a container
It gets even even better better!
If starting the fling container locally, the default `<host>:<port>` is
http://localhost:3000. You can also find a recent version of it via
https://fling.friedl.net/swagger-ui.html and
https://fling.friedl.net/v3/api-docs.
Fling is self-hosted. But it is packaged up in a docker container for easy
deployment. Run `docker run --rm -p3000:3000 arminfriedl/fling` and go to
http://localhost:3000. Admin user is `adminName:adminPassword`.
# Starting Fling from Docker
A Fling container is provided at https://hub.docker.com/repository/docker/arminfriedl/fling.
1. Run `docker run --rm -p3000:3000 arminfriedl/fling`
2. Go to the default http://localhost:3000
3. Log in with `adminName:adminPassword`.
## Configuring Fling
The Fling container can be configured by environment variables.
The web interface configuration ([config.js](web/fling/public/config.js)/[config.js.template](container/var/www/fling/config.js.template)) will be
filled by `envsubst` when the container starts up.
``` sh
# The base URL of the Fling API service
FLING_API_BASE=http://localhost:3000
# Log level of the application
FLING_LOG_LEVEL=warn
# Max. upload size in bytes. Checked on client side.
FLING_FILESIZE=209715200
```
The Fling service configuration is a standard spring configuration. It can be
set by environement variables or any other [configuration externalization supported by spring boot]
(https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config)).
Refer to the [application-prod.yml](service/fling/src/main/resources/application-prod.yml) for configuration options.

View file

@ -61,6 +61,23 @@ server {
proxy_set_header Connection "upgrade";
}
# handle openapi requests by openapi servlet
location /swagger-ui {
proxy_pass http://localhost:8080;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
# Required for web sockets to function
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# always respond with index.html for unknown paths
# (routing is client side)
location / {