From 9a5fc11dffe5d2ac6cb6e7edfa97bccd417285ed Mon Sep 17 00:00:00 2001 From: Andrei Marcu Date: Fri, 14 Aug 2020 00:52:25 -0700 Subject: [PATCH 001/119] Fix GH action (again) --- .github/workflows/buildx.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildx.yaml b/.github/workflows/buildx.yaml index 50e8601..1938731 100644 --- a/.github/workflows/buildx.yaml +++ b/.github/workflows/buildx.yaml @@ -27,7 +27,7 @@ jobs: --build-arg VERSION=${VERSION} \ --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \ --build-arg VCS_REF=${GITHUB_SHA::8} \ - ${TAGS} --file ./test/Dockerfile ./test + ${TAGS} --file Dockerfile . - name: Set up Docker Buildx uses: crazy-max/ghaction-docker-buildx@v3 From ef99024433df488e2aa2d063044ee05f4d01ac78 Mon Sep 17 00:00:00 2001 From: tuxx Date: Sat, 17 Oct 2020 01:55:11 +0200 Subject: [PATCH 002/119] Add LinxShare android client to README.md (#246) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed90db5..62f4d98 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You can see what it looks like using the demo: [https://demo.linx-server.net/](h - Display common filetypes (image, video, audio, markdown, pdf) - Display syntax-highlighted code with in-place editing -- Documented API with keys if need to restrict uploads (can use [linx-client](https://github.com/andreimarcu/linx-client) for uploading through command-line) +- Documented API with keys if need to restrict uploads (can use [linx-client](https://github.com/andreimarcu/linx-client) for uploading through command-line, or [LinxShare](https://github.com/iksteen/LinxShare/) client for android - also available on the (Play Store)[https://play.google.com/store/apps/details?id=org.thegraveyard.linxshare] ) - Torrent download of files using web seeding - File expiry, deletion key, file access key, and random filename options From 91b9885ac6d6c9bf7e2837e8daf7ff3b1facea4c Mon Sep 17 00:00:00 2001 From: Andrei Marcu Date: Fri, 16 Oct 2020 16:57:09 -0700 Subject: [PATCH 003/119] Update README.md --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 62f4d98..622d950 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,20 @@ Self-hosted file/media sharing website. You can see what it looks like using the demo: [https://demo.linx-server.net/](https://demo.linx-server.net/) +### Clients +**Official** +- CLI: **linx-client** - [Source](https://github.com/andreimarcu/linx-client) + +**Unofficial** +- Android: **LinxShare** - [Source](https://github.com/iksteen/LinxShare/) | [Google Play](https://play.google.com/store/apps/details?id=org.thegraveyard.linxshare) +- CLI: **golinx** - [Source](https://github.com/mutantmonkey/golinx) + + ### Features - Display common filetypes (image, video, audio, markdown, pdf) - Display syntax-highlighted code with in-place editing -- Documented API with keys if need to restrict uploads (can use [linx-client](https://github.com/andreimarcu/linx-client) for uploading through command-line, or [LinxShare](https://github.com/iksteen/LinxShare/) client for android - also available on the (Play Store)[https://play.google.com/store/apps/details?id=org.thegraveyard.linxshare] ) +- Documented API with keys for restricting uploads - Torrent download of files using web seeding - File expiry, deletion key, file access key, and random filename options @@ -60,8 +69,8 @@ Ideally, you would use a reverse proxy such as nginx or caddy to handle TLS cert #### Using a binary release -1. Grab the latest binary from the [releases](https://github.com/andreimarcu/linx-server/releases) -2. Run ```./linx-server``` +1. Grab the latest binary from the [releases](https://github.com/andreimarcu/linx-server/releases), then run ```go install``` +2. Run ```linx-server -config path/to/linx-server.conf``` Usage From 486cc6ff778171eb2b5b231db2cc52d5f484352f Mon Sep 17 00:00:00 2001 From: Steven Tang Date: Mon, 30 Nov 2020 06:09:53 +1100 Subject: [PATCH 004/119] Remove entrypoint from sample docker-compose.yml (#252) Resolves #225 Entrypoint in Dockerfile specifies default bind, filespath, metapath. Having entrypoint in docker-compose.yml will remove those defaults. Without the entrypoint line, the command executed is: `/usr/local/bin/linx-server -bind=0.0.0.0:8080 -filespath=/data/files/ -metapath=/data/meta/ -config /data/linx-server.conf` --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 622d950..cf285b9 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,6 @@ services: linx-server: container_name: linx-server image: andreimarcu/linx-server - entrypoint: /usr/local/bin/linx-server command: -config /data/linx-server.conf volumes: - /path/to/files:/data/files From 94f63c204506d595194bd52b5f3d3c1ba19923f0 Mon Sep 17 00:00:00 2001 From: Andrei Marcu Date: Mon, 25 Jan 2021 11:29:55 -0800 Subject: [PATCH 005/119] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index cf285b9..16318be 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ +## Seeking new maintainer! +If anyone would be interested in taking on this project, I would be willing to transfer it over as development and work on issues has mostly stalled at this point. +Please [respond to this issue](https://github.com/andreimarcu/linx-server/issues/266) if interested! + +--- + linx-server ====== [![Build Status](https://travis-ci.org/andreimarcu/linx-server.svg?branch=master)](https://travis-ci.org/andreimarcu/linx-server) From 63975c2019d9a943be9f6d6f122239749b0e75f4 Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Tue, 9 Feb 2021 20:00:20 -0500 Subject: [PATCH 006/119] Extra footer text block test. --- server.go | 2 ++ templates.go | 1 + templates/base.html | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index 4d06db9..903288f 100644 --- a/server.go +++ b/server.go @@ -304,6 +304,8 @@ func main() { "path to directory containing .md files to render as custom pages") flag.Uint64Var(&Config.cleanupEveryMinutes, "cleanup-every-minutes", 0, "How often to clean up expired files in minutes (default is 0, which means files will be cleaned up as they are accessed)") + flag.StringVar(&Config.extraFooterText, "extrafootertext", "", + "Extra text above the footer for notices.") iniflags.Parse() diff --git a/templates.go b/templates.go index 7d38b51..6dcf852 100644 --- a/templates.go +++ b/templates.go @@ -87,6 +87,7 @@ func renderTemplate(tpl *pongo2.Template, context pongo2.Context, r *http.Reques context["sitepath"] = Config.sitePath context["selifpath"] = Config.selifPath context["custom_pages_names"] = customPagesNames + context["extra_footer_text"] = Config.extraFooterText var a string if Config.authFile == "" { diff --git a/templates/base.html b/templates/base.html index 7e4f82d..847a995 100644 --- a/templates/base.html +++ b/templates/base.html @@ -29,7 +29,9 @@ {% block content %}{% endblock %} - +
+ {% if disable_access_key != true %} - + {% endif %} Randomize filename + {% if default_randomized && !(forcerandom) %} checked {% endif %} /> Randomize filename
From 4579be1048c5faf0761479c1f92c7f5b4580d664 Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Sat, 27 Feb 2021 21:42:19 -0500 Subject: [PATCH 101/119] Update index.html --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 01ec49e..ab699e2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -21,7 +21,7 @@ + {% if default_randomized or not forcerandom %} checked {% endif %} /> Randomize filename
From 59cf8dbfee43831ed7891844b00bc5c0a4c3bdc2 Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Sat, 27 Feb 2021 21:53:29 -0500 Subject: [PATCH 102/119] Update index.html --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index ab699e2..8060af2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -21,7 +21,7 @@ + {% if (default_randomize && !( forcerandom)) || forcerandom %} checked {% endif %} /> Randomize filename
From fae511f7d55a06c151d2a50b2739b0cf7501fcd0 Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Wed, 3 Mar 2021 00:06:44 -0500 Subject: [PATCH 103/119] Update Readme to include new feature descriptions. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 16318be..2c8fb83 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,11 @@ maxexpiry = 86400 | ```nologs = true``` | (optionally) disable request logs in stdout | ```force-random-filename = true``` | (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 +| ```extra-footer-text = "..."``` | (optionally) Extra text above the footer for notices. +| ```max-duration-time = 0``` | Time till expiry for files over max-duration-size. (Default is 0 for no-expiry.) +| ```max-duration-size = 4294967296``` | Size of file before max-duration-time is used to determine expiry max time. (Default is 4GB) +| ```disable-access-key = true``` | Disables access key usage. (Default is false.) +| ```default-random-filename = true``` | Makes it so the random filename is not default if set false. (Default is true.) #### Cleaning up expired files From d43dcf4acdbdba303bf417da750067cfdaae501f Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Sun, 7 Mar 2021 23:04:52 -0500 Subject: [PATCH 104/119] Update default text for new features. --- server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server.go b/server.go index 985c769..82a72e3 100644 --- a/server.go +++ b/server.go @@ -313,10 +313,10 @@ func main() { "How often to clean up expired files in minutes (default is 0, which means files will be cleaned up as they are accessed)") flag.StringVar(&Config.extraFooterText, "extra-footer-text", "", "Extra text above the footer for notices.") - flag.Uint64Var(&Config.maxDurationTime, "max-duration-time", 0, "Time till expiry for files over max-duration-size") - flag.Int64Var(&Config.maxDurationSize, "max-duration-size", 4*1024*1024*1024, "Size of file before max-duration-time is used to determine expiry max time.") - flag.BoolVar(&Config.disableAccessKey, "disable-access-key", false, "Disables access key usage") - flag.BoolVar(&Config.defaultRandomFilename, "default-random-filename", true, "Makes it so the random filename is not default if set false. Default true.") + flag.Uint64Var(&Config.maxDurationTime, "max-duration-time", 0, "Time till expiry for files over max-duration-size. (Default is 0 for no-expiry.)") + flag.Int64Var(&Config.maxDurationSize, "max-duration-size", 4*1024*1024*1024, "Size of file before max-duration-time is used to determine expiry max time. (Default is 4GB)") + flag.BoolVar(&Config.disableAccessKey, "disable-access-key", false, "Disables access key usage. (Default is false.)") + flag.BoolVar(&Config.defaultRandomFilename, "default-random-filename", true, "Makes it so the random filename is not default if set false. (Default is true.)") iniflags.Parse() mux := setup() From ac7c088e91e444ddc05e9e83138d7320e1a47314 Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Wed, 17 Mar 2021 19:24:07 -0400 Subject: [PATCH 105/119] Merge remote-tracking branch 'upstream/master' --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 2c8fb83..a603003 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,3 @@ - -## Seeking new maintainer! -If anyone would be interested in taking on this project, I would be willing to transfer it over as development and work on issues has mostly stalled at this point. -Please [respond to this issue](https://github.com/andreimarcu/linx-server/issues/266) if interested! - ---- - linx-server ====== [![Build Status](https://travis-ci.org/andreimarcu/linx-server.svg?branch=master)](https://travis-ci.org/andreimarcu/linx-server) From 5b774469ea1be43c14602d2f9dd80e4783b88955 Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Wed, 17 Mar 2021 19:34:36 -0400 Subject: [PATCH 106/119] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index a603003..12aeaac 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ linx-server ====== -[![Build Status](https://travis-ci.org/andreimarcu/linx-server.svg?branch=master)](https://travis-ci.org/andreimarcu/linx-server) Self-hosted file/media sharing website. ### Demo -You can see what it looks like using the demo: [https://demo.linx-server.net/](https://demo.linx-server.net/) +You can see what it looks like using the demo: [https://put.icu/](https://put.icu/) ### Clients From 7d0950e54c3015c4dce220e06de7c59b5035c901 Mon Sep 17 00:00:00 2001 From: William Oldham Date: Sun, 11 Jul 2021 00:09:57 +0100 Subject: [PATCH 107/119] Update image.html --- templates/display/image.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/display/image.html b/templates/display/image.html index 985c504..8dcd844 100644 --- a/templates/display/image.html +++ b/templates/display/image.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% block head %} + {% endblock %} @@ -8,4 +9,4 @@ -{% endblock %} \ No newline at end of file +{% endblock %} From 084ac233ffaa51c37b32ced8126bd4fa8c176dc1 Mon Sep 17 00:00:00 2001 From: ZizzyDizzyMC Date: Fri, 20 Aug 2021 12:13:58 -0400 Subject: [PATCH 108/119] Repo Link update. Added link to this fork of Linx-server. --- templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/base.html b/templates/base.html index 17b1ea2..54fd368 100644 --- a/templates/base.html +++ b/templates/base.html @@ -30,7 +30,7 @@ {% block content %}{% endblock %}
From d63a875b12e4bf370c31ec4ee4f1d79b74c8f0e8 Mon Sep 17 00:00:00 2001 From: luckman212 Date: Sat, 9 Oct 2021 11:36:53 -0400 Subject: [PATCH 109/119] add default expiry config parameter --- pages.go | 12 +++++++----- server.go | 3 +++ templates/index.html | 2 +- templates/paste.html | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pages.go b/pages.go index ae8de42..6492651 100644 --- a/pages.go +++ b/pages.go @@ -21,9 +21,10 @@ const ( func indexHandler(c web.C, w http.ResponseWriter, r *http.Request) { err := renderTemplate(Templates["index.html"], pongo2.Context{ - "maxsize": Config.maxSize, - "expirylist": listExpirationTimes(), - "forcerandom": Config.forceRandomFilename, + "maxsize": Config.maxSize, + "expirylist": listExpirationTimes(), + "expirydefault": Config.defaultExpiry, + "forcerandom": Config.forceRandomFilename, }, r, w) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) @@ -32,8 +33,9 @@ func indexHandler(c web.C, w http.ResponseWriter, r *http.Request) { func pasteHandler(c web.C, w http.ResponseWriter, r *http.Request) { err := renderTemplate(Templates["paste.html"], pongo2.Context{ - "expirylist": listExpirationTimes(), - "forcerandom": Config.forceRandomFilename, + "expirylist": listExpirationTimes(), + "expirydefault": Config.defaultExpiry, + "forcerandom": Config.forceRandomFilename, }, r, w) if err != nil { oopsHandler(c, w, r, RespHTML, "") diff --git a/server.go b/server.go index 82a72e3..41cd932 100644 --- a/server.go +++ b/server.go @@ -56,6 +56,7 @@ var Config struct { xFrameOptions string maxSize int64 maxExpiry uint64 + defaultExpiry uint64 realIp bool noLogs bool allowHotlink bool @@ -264,6 +265,8 @@ func main() { "maximum upload file size in bytes (default 4GB)") flag.Uint64Var(&Config.maxExpiry, "maxexpiry", 0, "maximum expiration time in seconds (default is 0, which is no expiry)") + flag.Uint64Var(&Config.defaultExpiry, "default-expiry", 86400, + "default expiration time in seconds (default is 86400, which is 1 day)") flag.StringVar(&Config.certFile, "certfile", "", "path to ssl certificate (for https)") flag.StringVar(&Config.keyFile, "keyfile", "", diff --git a/templates/index.html b/templates/index.html index 8060af2..3958788 100644 --- a/templates/index.html +++ b/templates/index.html @@ -28,7 +28,7 @@