Let me tell you a little bit about myself
Languages | Frameworks & Libraries | Tools |
---|---|---|
![]() ![]() ![]() |
![]() ![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() |
✍️A small copy-and-paste app for selfhosting
License: MIT License
I want Cocopasty to have the following features so that it is more convenient:
Currently the stylesheet for highlight.js is hosted externally at cloudflare.
While this works, I'd prefer if as few non-local calls be made. This guarantees that the site also works disconnected from the internet.
Did a code review of your backend, found some things that should be improved.
In General
Getting value from Redis...
and if it fails you log the error. Why not log Failed to get value from Redis: <error>
. That way you know where it failed.main.go
json:"Code"
err := json.NewDecoder(r.Body).Decode(&newSnippet)
fmt.Fprintf(err.Error)
database.go
line 11: You can combine your var declarations like this:
var (
connection *redis.Client
ctx context.Context
)
r.Context()
and pass it oninit
which will be executed at startup and set the connection then.error
and the handling and logging is incorrect. I'm unfamiliar with the redis library you're using, but from the looks of it you get the error by calling the Err
method.util.go
log.SetLevel(parsedLevel)
after the if. If you still want to print out the current loglevel you should put the log at the start with defer
(defer executes the code after it when the functions is exited, so after return).go.mod
github.com/MasterEvariour/cocopasty/cocopasty-backend
. I'm unsure of how well this works, as go uses git tags for versioning of the project. I recommend having the front and backend in separate repositories.Describe the bug
When clicking save, and refreshing the page, the code is not saved and the text box is empty
To Reproduce
docker-compose deploy install, in swarm mode.
navigate to page, type code, click save, refresh page
Expected behavior
Clicking save would save the code, refreshing the page would show the code saved
Desktop (please complete the following information):
Additional context
tested both with Keycloak and traefik in front of cocopasty, and without (port redirection).
No errors in the logs whatsoever.
Hello!
Trying to run this behind a reverse proxy to serve with https but im getting the same issues as described here: #5 . Nothing gets saved.
When checking the browser console for errors i can see edge/chrome throwing mixed content warnings and not allowing the connection to the backend since its http.
If i add the proxy conf with: add_header 'Content-Security-Policy' 'upgrade-insecure-requests'; so all http calls are upgraded to https i instead get SSL errors in the console which results in also nothing getting saved.
Anything that can be done regarding to this, thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.