Skip to content

Fixes #30 and updated the Dockerfile since it fails to build and compile#45

Open
m-primo wants to merge 4 commits intoZizzyDizzyMC:masterfrom
m-primo:master
Open

Fixes #30 and updated the Dockerfile since it fails to build and compile#45
m-primo wants to merge 4 commits intoZizzyDizzyMC:masterfrom
m-primo:master

Conversation

@m-primo
Copy link
Copy Markdown

@m-primo m-primo commented May 3, 2025

As I mentioned in #30, I updated the siteurl issue and added a new config key called strict-site-url, if set to true it would check the siteurl properly and won't upload if the siteurl doesn't match the request url, also I added an error message instead of empty message CSRF mismatch, and if set to false, it would just pass that and go on and upload the file, just like the API, since the API, doesn't check for this.

This is the first key change in code (notice Config.strictSiteUrl and CSRF mismatch):

	if Config.strictSiteUrl && !strictReferrerCheck(r, getSiteURL(r), []string{"Linx-Delete-Key", "Linx-Expiry", "Linx-Randomize", "X-Requested-With"}) {
 		badRequestHandler(c, w, r, RespAUTO, "CSRF mismatch")

I'm not sure how to reference a code from the source in here, so here's a link to this diff, m-primo@0bfba9f#diff-148c9bdc57383bd2555164d3c4336f2bcbe03d4edfb3a8649c7c8202260e6569R55

Here are screenshots:

  1. After the error message update:

Image

  1. After setting the siteurl to /:

Image

  1. After setting the siteurl to empty string "":

Image

Commit URL: m-primo@0bfba9f

This was for the first change.


As for the second change, I have updated the Dockerfile after your commit on Go version updates since it fails to compile and build on Docker.

Commit URL: m-primo@dfa1152


Additionally, I added a compose.yml file, updated the readme, built a self-contained binary release https://github.com/m-primo/linx-server/releases/tag/release, and uploaded the latest updates to the GitHub Container Registry https://github.com/m-primo/linx-server/pkgs/container/linx-server, since there was no binary release and no public image.


I have tested all of this on my own machine, and I have a website on a domain and all the implemented changes are working perfectly fine. I could send you the URL with some credentials (since its behind authentication) to test it live if you want.

I really wish for this pull to be merged for everyone wants to run the instance on the last updates.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant