peppermint-lab / peppermint Goto Github PK
View Code? Open in Web Editor NEWAn open source ticket management & help desk solution. A zendesk/freshdesk alternative
Home Page: https://peppermint.sh
License: Other
An open source ticket management & help desk solution. A zendesk/freshdesk alternative
Home Page: https://peppermint.sh
License: Other
[SOLVED??]
After posting, I thought to modify the docker-compose file's base URL value from http://localhost to http://localhost:5000. This seemed to do the trick and the application is now correctly loading. I checked the documentation and noticed the discrepancy: the Getting Started page on the docs.peppermint.sh website does not include the port number in the compose file. This must have been where I copied it from.
I also noticed the docker-compose files in the actual repository all have different port numbers:
Is there any reason they aren't all consistent? Perhaps this is a lack of understanding on my part, but I hope my experience accurately captures the kinds of questions a new user may face.
Hi all,
I've heard a lot about this project from the /r/selfhosted Reddit page, so I wanted to give it a try.
I'm currently trying to run it from my Linux Mint 20.04 desktop and am receiving the following errors after attempting to login with the provided default credentials:
Just to rule out any issues on my local machine, I followed the same process to install on my server machine, which has multiple other services running on it without issues. The server is running Ubuntu Server 21.10. In both instance, the result is the same as shown in the screenshot above, and the docker logs contain the following messages immediately after loading the main page:
[next-auth][error][CLIENT_FETCH_ERROR]
https://next-auth.js.org/errors#client_fetch_error request to http://localhost/api/auth/csrf failed, reason: connect ECONNREFUSED 127.0.0.1:80 {
error: {
message: 'request to http://localhost/api/auth/csrf failed, reason: connect ECONNREFUSED 127.0.0.1:80',
stack: 'FetchError: request to http://localhost/api/auth/csrf failed, reason: connect ECONNREFUSED 127.0.0.1:80\n' +
' at ClientRequest.<anonymous> (/app/node_modules/node-fetch/lib/index.js:1461:11)\n' +
' at ClientRequest.emit (events.js:400:28)\n' +
' at Socket.socketErrorListener (_http_client.js:475:9)\n' +
' at Socket.emit (events.js:400:28)\n' +
' at emitErrorNT (internal/streams/destroy.js:106:8)\n' +
' at emitErrorCloseNT (internal/streams/destroy.js:74:3)\n' +
' at processTicksAndRejections (internal/process/task_queues.js:82:21)',
name: 'FetchError'
},
path: 'csrf',
header: {
host: '192.168.1.196:5000',
connection: 'keep-alive',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36',
accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'sec-gpc': '1',
referer: 'http://192.168.1.196:5000/',
'accept-encoding': 'gzip, deflate',
'accept-language': 'en-US,en;q=0.9',
cookie: 'next-auth.csrf-token=90da3b9b4598ad84915c78e066c3e80d58097b04627ce8010b39159a9a06703e%7C22b35255cc213368fd8569b04233e1473909018618a734ec290ef39e981acf88; next-auth.callback-url=http%3A%2F%2Flocalhost'
},
message: 'request to http://localhost/api/auth/csrf failed, reason: connect ECONNREFUSED 127.0.0.1:80'
}
undefined
One interesting thing to note is that even with it running on a remote machine, it still is trying to redirect after logging in to localhost, which obviously wouldn't work. I feel confident that I do not have any other services running that are using the same ports:
kadar@shadowserve:~/snap/docker/peppermint$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 754/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 896/sshd: /usr/sbin
tcp6 0 0 :::22 :::* LISTEN 896/sshd: /usr/sbin
udp 0 0 127.0.0.53:53 0.0.0.0:* 754/systemd-resolve
kadar@shadowserve:~/snap/docker/peppermint$ dps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1bc559d02c8c pepperlabs/peppermint:latest "docker-entrypoint.s…" 5 minutes ago Up 3 seconds 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp, 5001/tcp peppermint
e62691081585 postgres:latest "docker-entrypoint.s…" 5 minutes ago Up 5 minutes 5432/tcp postgres
Attempting to login using default credentials results in the screenshot above. Appreciate any help in troubleshooting and resolving this, and happy to provide more information, thanks!
Custom auth error page
Wonder if it does
Implement dark theme
peppermint | PrismaClientValidationError: Argument id: Got invalid value NaN on prisma.updateOneClient. Provided Float, expected Int.
peppermint | Argument number: Got invalid value 12345678 on prisma.updateOneClient. Provided Int, expected String or NullableStringFieldUpdateOperationsInput or Null.
peppermint |
peppermint | at Document.validate (/usr/src/app/node_modules/@prisma/client/runtime/index.js:32546:19)
peppermint | at NewPrismaClient._executeRequest (/usr/src/app/node_modules/@prisma/client/runtime/index.js:34652:17)
peppermint | at consumer (/usr/src/app/node_modules/@prisma/client/runtime/index.js:34597:23)
peppermint | at /usr/src/app/node_modules/@prisma/client/runtime/index.js:34599:47
peppermint | at AsyncResource.runInAsyncScope (async_hooks.js:197:9)
peppermint | at NewPrismaClient._request (/usr/src/app/node_modules/@prisma/client/runtime/index.js:34599:25)
peppermint | at Object.then (/usr/src/app/node_modules/@prisma/client/runtime/index.js:34707:39)
peppermint | at runMicrotasks ()
peppermint | at processTicksAndRejections (internal/process/task_queues.js:95:5) {
peppermint | clientVersion: '2.25.0'
peppermint | }
Hey folks.
An issue with your website's SSl cert is making your website inaccessbile. Also, when you visit the plain http version there's a 404 with the following message
"Code: DEPLOYMENT_NOT_FOUND ID: lhr1::8p4pc-1635892770606-bfaadd4fbaed
www.peppermint.sh might be available. Click here to learn how to assign it to a project."
FYI
Click on Log in
button always leads to redirect and newer displays error:
<Button
...
onClick={() => {
onSubmit();
setTimeout(() => history.push("/"), 1000);
}}
>
A better way is to block login button while request is sending and then redirect user or display error without refreshing and don't clean values in form. Antd buttons have loading
attribute that looks good for this goal.
Possible view the demo button on the homepage
Hi,
I've cloned the repo and started the dev mode. When I try to log in using [email protected] and 1234 as user-password, I get this error on console:
POST http://localhost:5000/api/v1/auth/login [HTTP/1.1 422 Unprocessable Entity 5ms]
This is my example.env
file:
NODE_ENV=development PORT=5000 MONGO_URI_DEV=mongodb://127.0.0.1:27017/ MONGO_URI_DOCKER= JWT_SECRET=""
Unfortunately, I'm not entirely sure what I've done wrong. Do you know where could I start taking a look? Thanks.
Allow us to set the port in the base url. I have mine sitting behind reverse proxy and I end up at baseurl:5020 when the reverse proxy handles the the 80>5020 transversal.
The 'Home', 'History', and 'Admin' links in the navigation bar take you to some page when clicked on them. The 'Tickets' link has a drop down which causes the navigation flow to feel a bit off. Perhaps it would be better to also make the 'Tickets' link clickable so that when clicked, it can take you to the 'Open Tickets' by default.
As a good ticket system we need different queues for different teams.
It should also be possible that the tickets will be create in the queue based on the receiver (see also #78)
Currently there is no way to change the priority of a ticket. This is a very useful feature as the initial ticket creator may mischaracterize it. This becomes even more useful when you implement ticket creation by non-logged in individuals.
Create a custom 404 page rather than use the default nextjs page
Hi @potts99, I chanced upon this repository from the Explore page. I wanted to know if anything was open for me (and any others who found this) to contribute. For example, I can see that there's a TypeScript migration in the works. I also wanted to throw my two cents towards support for linting and testing, as the current one seems to lack unit tests, and the coding style seems slightly inconsistent between files and sometimes between lines in the same file.
Also, there seem to be a few places with pretty high code duplication, like some files in the controller and middleware directories. For example, maybe this might be a more concise way of implementing the middleware/authCheck.js (though I haven't tested to make sure it works the same). Let me know if that's something you'd want me to pursue.
const jwt = require("jsonwebtoken");
const { prisma } = require("../../prisma/prisma");
const status = {
NOT_LOGGED_IN: {
code: 401,
message: "You must be logged in",
},
NOT_AUTHENTICATED: {
code: 401,
message: "You must be authenticated",
},
FORBIDDEN: {
code: 403,
message: "Forbidden",
},
ERROR: {
code: 500,
message: "There was an error processing your request",
},
};
/**
* Utility function to authenticate and authorize user.
* When can this throw a 500 ERROR?
*
* @param {*} req the initial request
* @param {boolean} checkIfAdmin set to true if we are attempting to authorize the user.
* @returns {string} the status of the request.
*/
const getUser = async (req, checkIfAdmin = false) => {
const { token } = req.cookies;
if (!token) {
throw new Error('NOT_LOGGED_IN');
}
jwt.verify(token, process.env.JWT_SECRET, async (err, payload) => {
if (err) {
console.log(err);
const message = checkIfAdmin ? 'NOT_AUTHENTICATED' : 'NOT_LOGGED_IN';
throw new Error(message);
}
const { id } = payload;
const user = await prisma.user.findUnique({
where: {
id,
},
});
if (checkIfAdmin && !user.isAdmin) {
throw new Error('FORBIDDEN');
}
return user;
});
}
/**
* Check to make sure the request is coming from a valid user.
*/
exports.isAuth = (req, res, next) => {
try {
const user = await getUser(req);
req.user = user;
next();
}
catch (err) {
console.log(err);
const { code, message } = status[err.message];
return res.status(code).json({ message });
}
}
/**
* Check to make sure the request is coming from a user whose role is ADMIN.
*/
exports.isAdmin = (req, res, next) => {
try {
const user = getUser(req, true);
req.user = user;
next();
}
catch (err) {
console.log(err);
const { code, message } = status[err.message];
return res.status(code).json({ message });
}
}
Hello,
fist up - thanks for all this work! I really welcome the simplicity which gets rid of all the stuff we don't need or want (ツ)
So i've spun up an installation today using Docker (Docker-Compose) with a nginx-proxy in front of it (jwilder/nginx-proxy). Everything seemed nice on the first tests here. Creation of users, clients and tickets is working nicely as expected.
I am not able to change the engineers/asignees on any Tickets. I checked development-env, logs & browserconsole but could not get my hands on any useful logging or error.
Is this a mistake on my side (which i assume (ツ) )? Thanks!
Add the ability to add webhooks when tickets related actions are completed such as
Add a global notification component to allow for api results to error or send a successful message
Ticket issue or notes won't update in production
Clicking on this button: https://i.imgur.com/EvFKX19.png causes issues. When you click it, it becomes the active link meaning even if you are on the home page it says that is the active link when all that does is take you to pmint.dev
Issues:
file upload issue
File upload refetch file list api when ticket is uploaded
Add admin default to read me
Ideas:
Ticket row clickable
Ticket drop down to have open ticket page and completed page
Spinners to loading of data on fetch
More user types?
More ticket status types
Hi,
I tried installing Peppermint with the docker-compose file provided behind my Apache reverse proxy (the url looks like: https://www.mywebsite.fr/peppermint), but as I understand in the documentation, the reverse proxy works only for subdomain configurations, not subdirectories ?
When I install it then I get the following in the browser:
https://user-images.githubusercontent.com/25644865/156941506-85f8f687-9d8b-4f51-a76c-646cc67850d0.mov
Is there a (simple) way to get it work for subdirectories as well ?
Thank you for your work !
There appears to be some sort of redirect loop when navigating back on the login page.
When I'm on https://demo.pmint.dev/login, navigating back in Chrome takes me to https://demo.pmint.dev/Login. Navigating back again takes me to https://demo.pmint.dev/login, and this cycle repeats.
https://demo.pmint.dev/login times out.
Currently the application only supports being run on the bare domain, i.e. https://website.com.
If you proxy the application into a subdir, for example https://website.com/ticketing, the application does not work, the resources will point to the bare domain.
This can be solved by creating an environment arg for the BASE_URL like many applications do, which will pre-append the subdir onto any other URL.
Start to work on unit tests & e2e testing to get some automated tests rolling
Hi,
Is it known if this will run on ARM devices? And if they are unsupported, would it be possible for either an ARM version or for some advice on how I could port it to ARM?
Appreciate you taking the time to make this!
Image for arm
Create a global state to seamlessly share data across components
Similar to #18 when clicking a button that isn't a tab it still highlights it:
https://i.imgur.com/Oj1r9DA.gif
In the 'History' tab, it might be beneficial to display a 'Last Updated' date for each row on this page to show when the ticket information has been updated.
Hello,
it would be really nice if peppermint can fetch mails from an imap-account and create tickets based on this
When I go to https://demo.pmint.dev
it redirects me to /Login
which then redirects me to /login
which causes a nightmare for browser navigation log
hey 👋
this looks like a super cool project and I would really love to try it out. I'm looking to install it on a Raspberry Pi, but I'm not quite sure how to do that. would it be possible for you to create some kind of install script or something that would allow me to get this setup?
System similar to feedback fish to allow users to send feedback / issues rather than have to post on discord or github. Potentially open source the solution
Alongside the notification system being built which gives users a better indication of api's failing / succeeding -> all api routes need to be updated to following the same sort of system which reliably tells the front end if the event was a success or failure
Add support to sending when certain jobs are completed
Editor to allow for custom layout to be added to email
Marketplace app times out with no other error messages.
Currently the uncompressed size of the image is 2.74GB
Compressed is 992.58 MB
65% decrease
Need to look into trying to reduce this size
I attempted to rename the default user by editing it and turning it into my user, but none of the changes would stick. I then made a new user for myself (and misspelled my name in the process). When I attempted to edit my new user, none of the changes I submitted saved for that user either.
I initially suspected that perhaps the logged in user couldn't change their account, but perhaps there's something wrong with the edit functionality entirely.
Hello from Reddit! I'm just putting an official request here that can be actioned upon. I'd love to see SSO of some form (OIDC, SAML, or LDAP, namely) implemented in this project. Most teams who are using ticketing platforms will not wish to rely on the internal authentication of Peppermint for security and convenience reasons.
Hello,
would it be possible to allow this solution to use an already running Postgres instance on a custom port?
Thank you in advance!
Add field to a ticket that allows a user to add time spent working on a ticket
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.