Skip to content

Commit 23557ac

Browse files
committed
Merge branches 'develop' and 'develop' of github.com:thedevs-network/kutt into develop
2 parents acba603 + b3b7a02 commit 23557ac

File tree

9 files changed

+222
-64
lines changed

9 files changed

+222
-64
lines changed

README.md

+18-5
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,33 @@ If you're coming from v1, refer to [MIGRATION.md](MIGRATION.md) to migrate data
6060

6161
## Setup
6262

63+
### Manual
64+
6365
You need to have [Node.js](https://nodejs.org/), [PostgreSQL](https://www.postgresql.org/) and [Redis](https://redis.io/) installed.
6466

65-
1. Clone this repository or [download zip](https://github.com/thedevs-network/kutt/archive/v2-beta.zip).
66-
2. Copy `.example.env` to `.env` and fill it properly.
67+
1. Clone this repository or [download the latest zip](https://github.com/thedevs-network/kutt/releases).
68+
2. Copy `.example.env` to `.env` and fill it properly ([see below](#configuration)).
6769
3. Install dependencies: `npm install`.
6870
4. Run for development: `npm run dev`.
6971
5. Run for production: `npm run build` then `npm start`.
7072

7173
### Docker
7274

73-
You need to run the app with the required envrironment variables listed in [.example.env](https://github.com/thedevs-network/kutt/blob/develop/.example.env).
75+
Download the `docker-compose.yml` and the `.docker.env`-file from the repository and configure the `.docker.env` ([see below](#configuration)).
76+
To execute Kutt you simply have to run `docker-compose up -d` command and then the app should be ready on port "3000".
77+
78+
The `docker-compose.yml` uses the official kutt docker image available on [Docker Hub](https://hub.docker.com/r/kutt/kutt).
79+
80+
### Configuration
81+
82+
For the minimal configuration the following settings have to be changed in the `.env`-file:
7483

75-
* [Official Docker hub image](https://hub.docker.com/r/kutt/kutt).
76-
* Or simply run `docker-compose up` command and then the app should be ready on port "3000".
84+
- **DEFAULT_DOMAIN**: The domain of your kutt instance
85+
- **DB_**: The DB credentials (when you use docker-compose you can skip these)
86+
- **ADMIN_EMAILS**: A comma-separated list of the administrator-accounts
87+
- **RECAPTCHA_**: Enter your credentials to use reCaptchas or delete this setting if you don't want to use it
88+
- **MAIL_**: Enter the SMTP-server's credentials (The experience shows SSL works better than STARTTLS; The mail config is required to easily create accounts, see [this comment](https://github.com/thedevs-network/kutt/issues/269#issuecomment-628604256) how it can be done manually)
89+
- **REPORT_EMAIL**: Kutt offers a form to report malicious links which are sent to this mail-address
7790

7891
## Browser Extensions
7992

client/helpers/analytics.ts

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import getConfig from "next/config";
22
import ReactGA from "react-ga";
3+
import * as Sentry from '@sentry/react';
4+
import { Integrations } from '@sentry/apm';
35

46
const { publicRuntimeConfig } = getConfig();
57

@@ -12,6 +14,19 @@ export const logPageView = () => {
1214
ReactGA.pageview(window.location.pathname);
1315
};
1416

17+
export const initSentry = () => {
18+
if (publicRuntimeConfig.SENTRY_PUBLIC_DSN) {
19+
Sentry.init({
20+
dsn: publicRuntimeConfig.SENTRY_PUBLIC_DSN,
21+
environment: process.env.NODE_ENV,
22+
integrations: [
23+
new Integrations.Tracing(),
24+
],
25+
tracesSampleRate: 1.0,
26+
});
27+
};
28+
};
29+
1530
export const logEvent = (category = "", action = "") => {
1631
if (category && action) {
1732
ReactGA.event({ category, action });

client/pages/_app.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ import cookie from "js-cookie";
77
import Head from "next/head";
88
import React from "react";
99

10-
import { initGA, logPageView } from "../helpers/analytics";
10+
import { initGA, logPageView , initSentry } from "../helpers/analytics";
1111
import { initializeStore } from "../store";
1212
import { TokenPayload } from "../types";
1313

1414
const isProd = process.env.NODE_ENV === "production";
1515
const { publicRuntimeConfig } = getConfig();
1616

17+
if (isProd) {
18+
initSentry();
19+
};
20+
1721
// TODO: types
1822
class MyApp extends App<any> {
1923
static async getInitialProps({ Component, ctx }: AppContext) {

next.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
GOOGLE_ANALYTICS: localEnv && localEnv.GOOGLE_ANALYTICS,
1010
REPORT_EMAIL: localEnv && localEnv.REPORT_EMAIL,
1111
DISALLOW_ANONYMOUS_LINKS: localEnv && localEnv.DISALLOW_ANONYMOUS_LINKS,
12-
DISALLOW_REGISTRATION: localEnv && localEnv.DISALLOW_REGISTRATION
12+
DISALLOW_REGISTRATION: localEnv && localEnv.DISALLOW_REGISTRATION,
13+
SENTRY_PUBLIC_DSN: localEnv && localEnv.SENTRY_PUBLIC_DSN,
1314
}
1415
};

package-lock.json

+160-45
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
},
3636
"homepage": "https://github.com/TheDevs-Network/kutt#readme",
3737
"dependencies": {
38+
"@sentry/apm": "^5.21.1",
39+
"@sentry/node": "^5.21.1",
40+
"@sentry/react": "^5.21.1",
3841
"axios": "^0.19.1",
3942
"babel-plugin-inline-react-svg": "^1.1.0",
4043
"bcryptjs": "^2.4.3",
@@ -74,7 +77,6 @@
7477
"prop-types": "^15.7.2",
7578
"qrcode.react": "^0.8.0",
7679
"query-string": "^6.10.1",
77-
"raven": "^2.6.4",
7880
"react": "^16.12.0",
7981
"react-copy-to-clipboard": "^5.0.2",
8082
"react-dom": "^16.12.0",

server/env.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ const env = cleanEnv(process.env, {
4040
MAIL_PASSWORD: str(),
4141
REPORT_EMAIL: str({ default: "" }),
4242
CONTACT_EMAIL: str({ default: "" }),
43-
RAVEN_DSN: str({ default: "" })
43+
SENTRY_PRIVATE_DSN: str({ default: "" }),
44+
SENTRY_PUBLIC_DSN: str({ default: "" })
4445
});
4546

4647
export default env;

0 commit comments

Comments
 (0)