From 3167ab7ff08aa09b32d4aed892c7601a038f946f Mon Sep 17 00:00:00 2001 From: Andrei Marcu Date: Thu, 12 Mar 2020 18:34:08 -0700 Subject: [PATCH] README: Update screenshots --- README.md | 117 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 98bf585..ff22db3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -linx-server +linx-server ====== [![Build Status](https://travis-ci.org/andreimarcu/linx-server.svg?branch=master)](https://travis-ci.org/andreimarcu/linx-server) @@ -19,14 +19,45 @@ You can see what it looks like using the demo: [https://demo.linx-server.net/](h ### Screenshots - + + + -Get release and run +Getting started ------------------- + +#### Using Docker +Example running +``` +docker run -p 8080:8080 -v /path/to/meta:/data/meta -v /path/to/files:/data/files andreimarcu/linx-server +``` + +Example with docker-compose +``` +version: '2.2' +services: + linx-server: + container_name: linx-server + image: andreimarcu/linx-server + entrypoint: /usr/local/bin/linx-server -bind=0.0.0.0:8080 -filespath=/data/files/ -metapath=/data/meta/ + command: -sitename=Linx -siteurl=https://linx.example.com + volumes: + - /path/to/files:/data/files + - /path/to/meta:/data/meta + network_mode: bridge + ports: + - "8080:8080" + restart: unless-stopped +``` +Ideally, you would use a reverse proxy such as nginx or caddy to handle TLS certificates. + +#### Using a binary release + 1. Grab the latest binary from the [releases](https://github.com/andreimarcu/linx-server/releases) 2. Run ```./linx-server``` + Usage ----- @@ -38,30 +69,36 @@ maxsize = 4294967296 allowhotlink = true # etc ``` -...and then invoke ```linx-server -config path/to/config.ini``` +...and then invoke ```linx-server -config path/to/config.ini``` #### Options -- ```-bind 127.0.0.1:8080``` -- what to bind to (default is 127.0.0.1:8080) -- ```-sitename myLinx``` -- the site name displayed on top (default is inferred from Host header) -- ```-siteurl "https://mylinx.example.org/"``` -- the site url (default is inferred from execution context) -- ```-selifpath "selif"``` -- path relative to site base url (the "selif" in mylinx.example.org/selif/image.jpg) where files are accessed directly (default: selif) -- ```-maxsize 4294967296``` -- maximum upload file size in bytes (default 4GB) -- ```-maxexpiry 86400``` -- maximum expiration time in seconds (default is 0, which is no expiry) -- ```-allowhotlink``` -- Allow file hotlinking -- ```-contentsecuritypolicy "..."``` -- Content-Security-Policy header for pages (default is "default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; frame-ancestors 'self';") -- ```-filecontentsecuritypolicy "..."``` -- Content-Security-Policy header for files (default is "default-src 'none'; img-src 'self'; object-src 'self'; media-src 'self'; style-src 'self' 'unsafe-inline'; frame-ancestors 'self';") -- ```-refererpolicy "..."``` -- Referrer-Policy header for pages (default is "same-origin") -- ```-filereferrerpolicy "..."``` -- Referrer-Policy header for files (default is "same-origin") -- ```-xframeoptions "..." ``` -- X-Frame-Options header (default is "SAMEORIGIN") -- ```-remoteuploads``` -- (optionally) enable remote uploads (/upload?url=https://...) -- ```-nologs``` -- (optionally) disable request logs in stdout -- ```-force-random-filename``` -- (optionally) force the use of random filenames -- ```-custompagespath "custom_pages"``` -- (optionally) specify path to directory containing markdown pages (must end in .md) that will be added to the site navigation (this can be useful for providing contact/support information and so on). For example, custom_pages/My_Page.md will become My Page in the site navigation + +|Option|Description +|------|----------- +| ```-bind 127.0.0.1:8080``` | what to bind to (default is 127.0.0.1:8080) +| ```-sitename myLinx``` | the site name displayed on top (default is inferred from Host header) +| ```-siteurl "https://mylinx.example.org/"``` | the site url (default is inferred from execution context) +| ```-selifpath "selif"``` | path relative to site base url (the "selif" in mylinx.example.org/selif/image.jpg) where files are accessed directly (default: selif) +| ```-maxsize 4294967296``` | maximum upload file size in bytes (default 4GB) +| ```-maxexpiry 86400``` | maximum expiration time in seconds (default is 0, which is no expiry) +| ```-allowhotlink``` | Allow file hotlinking +| ```-contentsecuritypolicy "..."``` | Content-Security-Policy header for pages (default is "default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; frame-ancestors 'self';") +| ```-filecontentsecuritypolicy "..."``` | Content-Security-Policy header for files (default is "default-src 'none'; img-src 'self'; object-src 'self'; media-src 'self'; style-src 'self' 'unsafe-inline'; frame-ancestors 'self';") +| ```-refererpolicy "..."``` | Referrer-Policy header for pages (default is "same-origin") +| ```-filereferrerpolicy "..."``` | Referrer-Policy header for files (default is "same-origin") +| ```-xframeoptions "..." ``` | X-Frame-Options header (default is "SAMEORIGIN") +| ```-remoteuploads``` | (optionally) enable remote uploads (/upload?url=https://...) +| ```-nologs``` | (optionally) disable request logs in stdout +| ```-force-random-filename``` | (optionally) force the use of random filenames +| ```-custompagespath "custom_pages"``` | (optionally) specify path to directory containing markdown pages (must end in .md) that will be added to the site navigation (this can be useful for providing contact/support information and so on). For example, custom_pages/My_Page.md will become My Page in the site navigation #### Require API Keys for uploads -- ```-authfile path/to/authfile``` -- (optionally) require authorization for upload/delete by providing a newline-separated file of scrypted auth keys -- ```-remoteauthfile path/to/remoteauthfile``` -- (optionally) require authorization for remote uploads by providing a newline-separated file of scrypted auth keys -- ```-basicauth``` -- (optionally) allow basic authorization to upload or paste files from browser when `-authfile` is enabled. When uploading, you will be prompted to enter a user and password - leave the user blank and use your auth key as the password + +|Option|Description +|------|----------- +| ```-authfile path/to/authfile``` | (optionally) require authorization for upload/delete by providing a newline-separated file of scrypted auth keys +| ```-remoteauthfile path/to/remoteauthfile``` | (optionally) require authorization for remote uploads by providing a newline-separated file of scrypted auth keys +| ```-basicauth``` | (optionally) allow basic authorization to upload or paste files from browser when `-authfile` is enabled. When uploading, you will be prompted to enter a user and password - leave the user blank and use your auth key as the password A helper utility ```linx-genkey``` is provided which hashes keys to the format required in the auth files. @@ -75,14 +112,20 @@ The following storage backends are available: #### SSL with built-in server -- ```-certfile path/to/your.crt``` -- Path to the ssl certificate (required if you want to use the https server) -- ```-keyfile path/to/your.key``` -- Path to the ssl key (required if you want to use the https server) +|Option|Description +|------|----------- +| ```-certfile path/to/your.crt``` | Path to the ssl certificate (required if you want to use the https server) +| ```-keyfile path/to/your.key``` | Path to the ssl key (required if you want to use the https server) #### Use with http proxy -- ```-realip``` -- let linx-server know you (nginx, etc) are providing the X-Real-IP and/or X-Forwarded-For headers. +|Option|Description +|------|----------- +| ```-realip``` | let linx-server know you (nginx, etc) are providing the X-Real-IP and/or X-Forwarded-For headers. #### Use with fastcgi -- ```-fastcgi``` -- serve through fastcgi +|Option|Description +|------|----------- +| ```-fastcgi``` | serve through fastcgi Cleaning up expired files @@ -96,10 +139,12 @@ of scheduled task. You should be careful to ensure that only one instance of `linx-client` runs at a time to avoid unexpected behavior. It does not implement any type of locking. -#### Options -- ```-filespath files/``` -- Path to stored uploads (default is files/) -- ```-metapath meta/``` -- Path to stored information about uploads (default is meta/) -- ```-nologs``` -- (optionally) disable deletion logs in stdout + +|Option|Description +|------|----------- +| ```-filespath files/``` | Path to stored uploads (default is files/) +| ```-nologs``` | (optionally) disable deletion logs in stdout +| ```-metapath meta/``` | Path to stored information about uploads (default is meta/) Deployment @@ -133,16 +178,6 @@ Run linx-server with the ```-certfile path/to/cert.file``` and ```-keyfile path/ #### 3. Using the built-in http server Run linx-server normally. -#### 4. Using Docker with the built-in http server -First, build the image: -```docker build -t linx-server .``` - -You'll need some directories for the persistent storage. For the purposes of this example, we will use `/media/meta` and `/media/files`. - -Then, run it: -```docker run -p 8080:8080 -v /media/meta:/data/meta -v /media/files:/data/files linx-server``` - - Development ----------- Any help is welcome, PRs will be reviewed and merged accordingly.