Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
refactor: module name
Browse files Browse the repository at this point in the history
  • Loading branch information
dwisiswant0 committed Jul 3, 2022
1 parent ef9bb80 commit 0c5bdf9
Show file tree
Hide file tree
Showing 29 changed files with 71 additions and 71 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
builds:
- binary: teler
main: cmd/teler/main.go
main: main.go
goos:
- linux
- windows
Expand All @@ -11,7 +11,7 @@ builds:
- arm
- arm64
ldflags:
- -s -w -X ktbs.dev/teler/common.Version=v{{.Version}}
- -s -w -X teler.app/common.Version=v{{.Version}}

archives:
- id: tgz
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ COPY ./go.mod .
RUN go mod download

COPY . .
RUN go build -ldflags "-s -w -X ktbs.dev/teler/common.Version=${VERSION}" \
-o ./bin/teler ./cmd/teler
RUN go build -ldflags "-s -w -X teler.app/common.Version=${VERSION}" \
-o ./bin/teler .

FROM alpine:latest

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ help:
build:
@echo "--- Building ${APP_NAME} ${VERSION}"
@echo "GOPATH=${GOPATH}"
go build -ldflags "-s -w -X ktbs.dev/teler/common.Version=${VERSION}" -buildvcs=false -o ./bin/${APP_NAME} ./cmd/${APP_NAME}
go build -ldflags "-s -w -X teler.app/common.Version=${VERSION}" -buildvcs=false -o ./bin/${APP_NAME} .

build-all:
@echo "--- Cross-platform build ${APP_NAME} ${VERSION}"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</p>

<!-- [![Gitter](https://badges.gitter.im/kitabisa-teler/community.svg)](https://gitter.im/kitabisa-teler/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -->
<!-- [![Go report](https://goreportcard.com/badge/ktbs.dev/teler)](https://goreportcard.com/report/ktbs.dev/teler) -->
<!-- [![Go report](https://goreportcard.com/badge/teler.app)](https://goreportcard.com/report/teler.app) -->

<p align="center">
Real-time HTTP Intrusion Detection
Expand Down Expand Up @@ -88,7 +88,7 @@ Here is a preview of `teler` with conditions of use as:

## Documentation

All related documentation about installation, usage & configuration is on our [Wiki page](https://www.notion.so/kitabisa/teler-a1fd9d874e9a4448a45d9d3add434b54).
All related documentation about installation, usage & configuration is on **[teler.app](https://teler.app)**.

## Supporting Materials

Expand Down
2 changes: 1 addition & 1 deletion common/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package common
import (
"os"

"ktbs.dev/teler/pkg/parsers"
"teler.app/pkg/parsers"
)

// Options contains the configuration options
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module ktbs.dev/teler
module teler.app

go 1.18

Expand Down
6 changes: 3 additions & 3 deletions internal/alert/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package alert
import (
"reflect"

"ktbs.dev/teler/common"
"ktbs.dev/teler/pkg/matchers"
"ktbs.dev/teler/pkg/utils"
"teler.app/common"
"teler.app/pkg/matchers"
"teler.app/pkg/utils"
)

// New will initialize notification provider & send threat alerts
Expand Down
2 changes: 1 addition & 1 deletion internal/alert/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"

"github.com/bwmarrin/discordgo"
"ktbs.dev/teler/pkg/errors"
"teler.app/pkg/errors"
)

// token can be webhook URL if webhooked is true
Expand Down
2 changes: 1 addition & 1 deletion internal/alert/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

telegramBot "github.com/go-telegram-bot-api/telegram-bot-api"
"ktbs.dev/teler/pkg/errors"
"teler.app/pkg/errors"
)

func toTelegram(token string, chatID string, log map[string]string) {
Expand Down
4 changes: 2 additions & 2 deletions internal/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/r3labs/sse/v2"
"goji.io"
"goji.io/pat"
"ktbs.dev/teler/common"
"ktbs.dev/teler/pkg/errors"
"teler.app/common"
"teler.app/pkg/errors"
)

// Run SSE
Expand Down
2 changes: 1 addition & 1 deletion internal/event/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package event

import (
"github.com/r3labs/sse/v2"
"ktbs.dev/teler/common"
"teler.app/common"
)

type server struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/runner/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package runner

import (
"github.com/projectdiscovery/gologger"
"ktbs.dev/teler/common"
"teler.app/common"
)

// showBanner is used to show the banner to the user
Expand Down
4 changes: 2 additions & 2 deletions internal/runner/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package runner

import (
"github.com/projectdiscovery/gologger"
"ktbs.dev/teler/pkg/cache"
"ktbs.dev/teler/pkg/errors"
"teler.app/pkg/cache"
"teler.app/pkg/errors"
)

func rmCache() {
Expand Down
6 changes: 3 additions & 3 deletions internal/runner/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"reflect"

"ktbs.dev/teler/common"
"ktbs.dev/teler/pkg/errors"
"ktbs.dev/teler/pkg/logs"
"teler.app/common"
"teler.app/pkg/errors"
"teler.app/pkg/logs"
)

func log(options *common.Options, data map[string]string) {
Expand Down
6 changes: 3 additions & 3 deletions internal/runner/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"github.com/projectdiscovery/gologger"
"github.com/prometheus/client_golang/prometheus/promhttp"
"ktbs.dev/teler/common"
"ktbs.dev/teler/pkg/errors"
"ktbs.dev/teler/pkg/metrics"
"teler.app/common"
"teler.app/pkg/errors"
"teler.app/pkg/metrics"
)

func metric(options *common.Options) {
Expand Down
8 changes: 4 additions & 4 deletions internal/runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"strings"

"ktbs.dev/teler/common"
"ktbs.dev/teler/pkg/cache"
"ktbs.dev/teler/pkg/errors"
"ktbs.dev/teler/pkg/requests"
"teler.app/common"
"teler.app/pkg/cache"
"teler.app/pkg/errors"
"teler.app/pkg/requests"
)

// ParseOptions will parse args/opts
Expand Down
12 changes: 6 additions & 6 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"github.com/projectdiscovery/gologger"
"github.com/remeh/sizedwaitgroup"
"github.com/satyrius/gonx"
"ktbs.dev/teler/common"
"ktbs.dev/teler/internal/alert"
"ktbs.dev/teler/internal/event"
"ktbs.dev/teler/pkg/errors"
"ktbs.dev/teler/pkg/metrics"
"ktbs.dev/teler/pkg/teler"
"teler.app/common"
"teler.app/internal/alert"
"teler.app/internal/event"
"teler.app/pkg/errors"
"teler.app/pkg/metrics"
"teler.app/pkg/teler"
)

// New read & pass stdin log
Expand Down
10 changes: 5 additions & 5 deletions internal/runner/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"strings"

"gopkg.in/validator.v2"
"ktbs.dev/teler/common"
"ktbs.dev/teler/pkg/errors"
"ktbs.dev/teler/pkg/matchers"
"ktbs.dev/teler/pkg/parsers"
"ktbs.dev/teler/pkg/utils"
"teler.app/common"
"teler.app/pkg/errors"
"teler.app/pkg/matchers"
"teler.app/pkg/parsers"
"teler.app/pkg/utils"
)

func validate(options *common.Options) {
Expand Down
2 changes: 1 addition & 1 deletion internal/runner/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

"ktbs.dev/teler/common"
"teler.app/common"
)

func showVersion() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/teler/main.go → main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/gologger/levels"
"go.uber.org/automaxprocs/maxprocs"
"ktbs.dev/teler/internal/runner"
"teler.app/internal/runner"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/kirsle/configdir"
"ktbs.dev/teler/pkg/errors"
"teler.app/pkg/errors"
)

// Cache defines resources cache file informations
Expand Down
2 changes: 1 addition & 1 deletion pkg/logs/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"

"ktbs.dev/teler/common"
"teler.app/common"
)

// File write detected threats into it
Expand Down
2 changes: 1 addition & 1 deletion pkg/logs/zinc.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"io/ioutil"
"net/http"

e "ktbs.dev/teler/pkg/errors"
e "teler.app/pkg/errors"
)

// Zinc logs insertion
Expand Down
2 changes: 1 addition & 1 deletion pkg/matchers/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"strings"

"ktbs.dev/teler/pkg/errors"
"teler.app/pkg/errors"
)

func errValidate(key string) {
Expand Down
28 changes: 14 additions & 14 deletions pkg/matchers/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

"ktbs.dev/teler/pkg/errors"
"teler.app/pkg/errors"
)

func TestIsLogformat(t *testing.T) {
Expand All @@ -22,21 +22,21 @@ func TestIsLogformat(t *testing.T) {
}{
{
name: "Invalid log format",
args: args {
args: args{
s: "",
},
wantErr: true,
},
{
name: "Invalid log format: need $ sign",
args: args {
args: args{
s: "remote_addr",
},
wantErr: true,
},
{
name: "Log format is valid",
args: args {
args: args{
s: "$request_method",
},
wantErr: false,
Expand Down Expand Up @@ -67,21 +67,21 @@ func TestIsToken(t *testing.T) {
}{
{
name: "Invalid token",
args: args {
args: args{
s: "hola",
},
wantErr: true,
},
{
name: "Token is valid",
args: args {
args: args{
s: "xoxp-0123456789-012345678901-y",
},
wantErr: false,
},
{
name: "Token is valid",
args: args {
args: args{
s: "012345678:abcdefghijklmnopqrstuvwxyz012345678",
},
wantErr: false,
Expand Down Expand Up @@ -112,21 +112,21 @@ func TestIsHexcolor(t *testing.T) {
}{
{
name: "Invalid hex color code",
args: args {
args: args{
s: "\u2713",
},
wantErr: true,
},
{
name: "Invalid hex color code",
args: args {
args: args{
s: "#af01",
},
wantErr: true,
},
{
name: "Hex color code is valid",
args: args {
args: args{
s: "#F00000",
},
wantErr: false,
Expand Down Expand Up @@ -176,14 +176,14 @@ func TestIsChannel(t *testing.T) {
}{
{
name: "Invalid Slack channel ID",
args: args {
args: args{
s: "hola",
},
wantErr: true,
},
{
name: "Slack channel ID is valid",
args: args {
args: args{
s: randomChannelID(),
},
wantErr: false,
Expand Down Expand Up @@ -214,14 +214,14 @@ func TestIsChatID(t *testing.T) {
}{
{
name: "Invalid Telegram chat_id",
args: args {
args: args{
s: "hola",
},
wantErr: true,
},
{
name: "Telegram chat_id is valid",
args: args {
args: args{
s: "12345678",
},
wantErr: false,
Expand Down
2 changes: 1 addition & 1 deletion pkg/metrics/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"

"github.com/prometheus/client_golang/prometheus"
"ktbs.dev/teler/common"
"teler.app/common"
)

// PrometheusInsert logs into metrics
Expand Down

0 comments on commit 0c5bdf9

Please sign in to comment.