├── .github └── FUNDING.yml ├── assets └── trollface.png ├── util ├── random.go ├── favicon.go ├── config.go ├── cache.go ├── abuseipdb.go ├── webhook.go └── logic.go ├── go.mod ├── types ├── Report.go ├── ConnWrapper.go ├── ServerStatus.go ├── Config.go └── DiscordWebhook.go ├── minepot.service ├── install.sh ├── go.sum ├── Dockerfile ├── handler ├── Connection.go ├── ServerListPing.go ├── Ping.go ├── Handshake.go └── StatusRequest.go ├── CHANGELOG.md ├── config.json ├── server.go ├── internal └── minecraft │ └── versions.go ├── README.md └── LICENSE /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: lockblock 2 | -------------------------------------------------------------------------------- /assets/trollface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LockBlock-dev/MinePot/HEAD/assets/trollface.png -------------------------------------------------------------------------------- /util/random.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "math/rand" 4 | 5 | func RandRange(min int, max int) int { 6 | return rand.Intn(max+1-min) + min 7 | } 8 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/LockBlock-dev/MinePot 2 | 3 | go 1.20 4 | 5 | require ( 6 | github.com/Tnze/go-mc v1.20.2 7 | github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021 8 | ) 9 | 10 | require github.com/google/uuid v1.3.0 // indirect 11 | -------------------------------------------------------------------------------- /types/Report.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | type Report struct { 8 | Datetime time.Time 9 | PacketsCount int 10 | ReportedAIPDB bool 11 | ReportedWebhook bool 12 | Handshake bool 13 | Ping bool 14 | } 15 | -------------------------------------------------------------------------------- /types/ConnWrapper.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import "github.com/Tnze/go-mc/net" 4 | 5 | type ConnWrapper struct { 6 | net.Conn 7 | Config *Config 8 | PacketsReceived int 9 | ReceivedProtocol int 10 | DidHandshake bool 11 | DidPing bool 12 | } 13 | -------------------------------------------------------------------------------- /minepot.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=MinePot 3 | After=network.target 4 | 5 | [Service] 6 | Type=simple 7 | ExecStartPre=/bin/mkdir -p /var/log/minepot/ 8 | ExecStartPre=/bin/mkdir -p /etc/minepot/ 9 | ExecStart=/home/MinePot/MinePot 10 | Restart=on-failure 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Prompt for sudo 4 | sudo -v 5 | 6 | # Create the MinePot directory 7 | sudo mkdir /etc/minepot 8 | # Copy the service file 9 | sudo cp ./minepot.service /etc/systemd/system/minepot.service 10 | 11 | # Copy the config 12 | sudo cp ./config.json /etc/minepot/config.json 13 | 14 | # Reload and start the service 15 | sudo systemctl daemon-reload 16 | sudo systemctl enable minepot.service 17 | sudo systemctl start minepot.service 18 | -------------------------------------------------------------------------------- /util/favicon.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "encoding/base64" 5 | "fmt" 6 | "os" 7 | 8 | "github.com/LockBlock-dev/MinePot/types" 9 | ) 10 | 11 | func GetFavicon(config *types.Config) error { 12 | faviconFile, err := os.ReadFile(config.FaviconPath) 13 | if err != nil { 14 | return fmt.Errorf("error reading the favicon file: %w", err) 15 | } 16 | 17 | config.StatusResponseData.Favicon = "data:image/png;base64," + base64.StdEncoding.EncodeToString(faviconFile) 18 | 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /util/config.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "encoding/json" 5 | "os" 6 | 7 | "github.com/LockBlock-dev/MinePot/types" 8 | ) 9 | 10 | func GetConfig() (*types.Config, error) { 11 | file, err := os.Open("/etc/minepot/config.json") 12 | if err != nil { 13 | return &types.Config{}, err 14 | } 15 | defer file.Close() 16 | 17 | decoder := json.NewDecoder(file) 18 | config := types.Config{} 19 | err = decoder.Decode(&config) 20 | if err != nil { 21 | return &types.Config{}, err 22 | } 23 | 24 | return &config, nil 25 | } 26 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/Tnze/go-mc v1.20.2 h1:arHCE/WxLCxY73C/4ZNLdOymRYtdwoXE05ohB7HVN6Q= 2 | github.com/Tnze/go-mc v1.20.2/go.mod h1:geoRj2HsXSkB3FJBuhr7wCzXegRlzWsVXd7h7jiJ6aQ= 3 | github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= 4 | github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 5 | github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021 h1:31Y+Yu373ymebRdJN1cWLLooHH8xAr0MhKTEJGV/87g= 6 | github.com/muesli/cache2go v0.0.0-20221011235721-518229cd8021/go.mod h1:WERUkUryfUWlrHnFSO/BEUZ+7Ns8aZy7iVOGewxKzcc= 7 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG GOLANG_VERSION=1.20 2 | 3 | FROM golang:${GOLANG_VERSION}-alpine as build 4 | 5 | WORKDIR /app 6 | 7 | COPY go.mod . 8 | COPY go.sum . 9 | COPY server.go . 10 | COPY ./handler handler/ 11 | COPY ./types types/ 12 | COPY ./util util/ 13 | COPY ./internal internal/ 14 | 15 | RUN set -eux; \ 16 | go mod download 17 | 18 | RUN set -eux; \ 19 | go build -ldflags "-s -w" -o /bin/minepot 20 | 21 | 22 | 23 | FROM alpine 24 | 25 | ENV PORT=25565 26 | 27 | WORKDIR /app 28 | 29 | COPY ./config.json . 30 | COPY ./assets assets/ 31 | COPY --from=build /bin/minepot /bin/minepot 32 | 33 | RUN set -eux; \ 34 | # Create the MinePot directory 35 | mkdir -p /etc/minepot; \ 36 | # Copy the config 37 | cp config.json /etc/minepot/ 38 | 39 | EXPOSE ${PORT} 40 | 41 | CMD [ "/bin/minepot" ] 42 | -------------------------------------------------------------------------------- /types/ServerStatus.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | type Version struct { 4 | Name string `json:"name"` 5 | Protocol int `json:"protocol"` 6 | } 7 | 8 | type PlayersInfo struct { 9 | Max int `json:"max"` 10 | Online int `json:"online"` 11 | Sample []Player `json:"sample"` 12 | } 13 | 14 | type Player struct { 15 | Name string `json:"name"` 16 | Id string `json:"id"` 17 | } 18 | 19 | type ServerStatus struct { 20 | Version Version `json:"version"` 21 | Players Players `json:"players"` 22 | Description string `json:"description"` 23 | Favicon string `json:"favicon"` 24 | EnforcesSecureChat bool `json:"enforcesSecureChat"` 25 | } 26 | 27 | type Players struct { 28 | Max int `json:"max"` 29 | Online int `json:"online"` 30 | Sample []Player `json:"sample"` 31 | } 32 | -------------------------------------------------------------------------------- /handler/Connection.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "log" 5 | 6 | "github.com/LockBlock-dev/MinePot/types" 7 | "github.com/LockBlock-dev/MinePot/util" 8 | ) 9 | 10 | func HandleConnection(conn types.ConnWrapper) { 11 | remoteAddrString := conn.Conn.Socket.RemoteAddr().String() 12 | 13 | defer func() { 14 | log.Println(remoteAddrString + " - Closing connection") 15 | 16 | // If the client has exceeded the packets threshold we can report it 17 | util.HandleReport(conn, remoteAddrString) 18 | 19 | if err := conn.Close(); err != nil { 20 | log.Fatal(err) 21 | } 22 | }() 23 | 24 | log.Println(remoteAddrString + " - Client connected") 25 | 26 | nextState := handleHandshake(&conn) 27 | if nextState == -1 { 28 | return 29 | } 30 | 31 | switch nextState { 32 | case 1: 33 | handleServerListPing(&conn) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [2.1.0] - 2024-07-17 9 | 10 | ### Added 11 | 12 | - Artificial random ping 13 | - Random protocol/version 14 | - Version name with client protocol mirroring 15 | 16 | ### Changed 17 | 18 | - Project layout 19 | - Minecraft protocol implementation from `go-mc` 20 | - Added a build step to get a smaller Docker image 21 | 22 | ## [2.0.0] - 2023-07-20 23 | 24 | ### Changed 25 | 26 | - Packet id field renamed 27 | - Implementation of Varints does not rely on `binary` package anymore 28 | 29 | ## [1.0.1] - 2023-04-30 30 | 31 | ### Changed 32 | 33 | - License is now GNU AGPLv3.0 34 | 35 | ## [1.0.0] - 2023-03-14 36 | 37 | ### Added 38 | 39 | - First version 40 | -------------------------------------------------------------------------------- /types/Config.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | type Config struct { 4 | Debug bool `json:"debug"` 5 | 6 | WriteLogs bool `json:"writeLogs"` 7 | LogFile string `json:"logFile"` 8 | 9 | WriteHistory bool `json:"writeHistory"` 10 | HistoryFile string `json:"historyFile"` 11 | 12 | Port int `json:"port"` 13 | PingDelayMinMs int `json:"pingDelayMinMs"` 14 | PingDelayMaxMs int `json:"pingDelayMaxMs"` 15 | IdleTimeoutS int `json:"IdleTimeoutS"` 16 | 17 | ReportThreshold int `json:"reportThreshold"` 18 | 19 | AbuseIPDBReport bool `json:"abuseIPDBReport"` 20 | AbuseIPDBKey string `json:"abuseIPDBKey"` 21 | AbuseIPDBCooldownH int `json:"abuseIPDBCooldownH"` 22 | 23 | WebhookReport bool `json:"webhookReport"` 24 | WebhookUrl string `json:"webhookUrl"` 25 | WebhookCooldownH int `json:"webhookCooldownH"` 26 | WebhookEmbedColor string `json:"webhookEmbedColor"` 27 | 28 | StatusResponse bool `json:"statusResponse"` 29 | StatusResponseData ServerStatus `json:"statusResponseData"` 30 | FaviconPath string `json:"faviconPath"` 31 | RandomVersion bool `json:"randomVersion` 32 | } 33 | -------------------------------------------------------------------------------- /util/cache.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/LockBlock-dev/MinePot/types" 7 | "github.com/muesli/cache2go" 8 | ) 9 | 10 | func AddToCache(key interface{}, lifeSpan time.Duration, data interface{}) bool { 11 | exists := cache2go.Cache("MinePot").Exists(key) 12 | if !exists { 13 | cache2go.Cache("MinePot").Add(key, lifeSpan, data) 14 | return true 15 | } 16 | 17 | return false 18 | } 19 | 20 | func shouldReport(host string, cooldown int, reportType bool) bool { 21 | item, err := cache2go.Cache("MinePot").Value(host) 22 | if err != nil { 23 | return true 24 | } 25 | 26 | if reportType { 27 | // Check if the report was reported to AIPDB and if it's older than the cooldown 28 | report := item.Data().(types.Report) 29 | if !report.ReportedAIPDB && time.Since(report.Datetime) > (time.Duration(cooldown)*time.Hour) { 30 | return true 31 | } 32 | } else { 33 | // Check if the report was reported to the webhook and if it's older than the cooldown 34 | report := item.Data().(types.Report) 35 | if !report.ReportedWebhook && time.Since(report.Datetime) > (time.Duration(cooldown)*time.Hour) { 36 | return true 37 | } 38 | } 39 | 40 | return false 41 | } 42 | -------------------------------------------------------------------------------- /handler/ServerListPing.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | 7 | "github.com/LockBlock-dev/MinePot/types" 8 | "github.com/Tnze/go-mc/data/packetid" 9 | "github.com/Tnze/go-mc/net/packet" 10 | ) 11 | 12 | func handleServerListPing(conn *types.ConnWrapper) { 13 | var p packet.Packet 14 | remoteAddrString := conn.Conn.Socket.RemoteAddr().String() 15 | 16 | for i := 0; i < 2; i++ { 17 | 18 | conn.PacketsReceived++ 19 | 20 | // Handle Server List Ping following packet : https://wiki.vg/Server_List_Ping 21 | if err := conn.ReadPacket(&p); err != nil { 22 | log.Println("Failed to parse Server List Ping packet:", err) 23 | return 24 | } 25 | 26 | if conn.Config.Debug { 27 | log.Println( 28 | remoteAddrString + 29 | " - Received packet => Length: " + 30 | fmt.Sprint(len(p.Data)) + 31 | ", Id: " + 32 | fmt.Sprint(p.ID) + 33 | ", Data: " + 34 | string(p.Data), 35 | ) 36 | } 37 | 38 | switch packetid.ClientboundPacketID(p.ID) { 39 | case packetid.ClientboundStatusResponse: 40 | if conn.Config.StatusResponse { 41 | handleStatusRequest(conn) 42 | } 43 | case packetid.ClientboundStatusPongResponse: 44 | handlePing(conn, &p) 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /handler/Ping.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "time" 7 | 8 | "github.com/LockBlock-dev/MinePot/types" 9 | "github.com/LockBlock-dev/MinePot/util" 10 | "github.com/Tnze/go-mc/net/packet" 11 | ) 12 | 13 | func handlePing(conn *types.ConnWrapper, p *packet.Packet) { 14 | var Magic packet.Long 15 | 16 | remoteAddrString := conn.Conn.Socket.RemoteAddr().String() 17 | 18 | // Handle Ping Request packet : https://wiki.vg/Server_List_Ping#Ping_Request 19 | if err := p.Scan(&Magic); err != nil { 20 | log.Println("Failed to parse Ping data:", err) 21 | return 22 | } 23 | 24 | if conn.Config.Debug { 25 | log.Println(remoteAddrString + " - Received Ping Request packet => Magic number: " + fmt.Sprint(Magic)) 26 | } 27 | 28 | // Artificial server ping 29 | time.Sleep(time.Duration(util.RandRange(conn.Config.PingDelayMinMs, conn.Config.PingDelayMaxMs)) * time.Millisecond) 30 | 31 | // Send Pong Response packet : https://wiki.vg/Server_List_Ping#Pong_Response 32 | if err := conn.WritePacket(*p); err != nil { 33 | log.Println("Failed to send Pong Response packet to client:", err) 34 | return 35 | } 36 | 37 | if conn.Config.Debug { 38 | log.Println(remoteAddrString + " - Sent Pong Response packet") 39 | } 40 | 41 | conn.DidPing = true 42 | } 43 | -------------------------------------------------------------------------------- /util/abuseipdb.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | "net/url" 7 | "os" 8 | "strings" 9 | "time" 10 | ) 11 | 12 | func Report(ip string, key string, port int) (int, error) { 13 | URI := "https://api.abuseipdb.com/api/v2/report" 14 | t := time.Now() 15 | var hostnamePart string 16 | hostname, err := os.Hostname() 17 | if err != nil { 18 | hostnamePart = "" 19 | } else { 20 | hostnamePart = " of " + hostname 21 | } 22 | 23 | payload := fmt.Sprintf( 24 | "ip=%s&categories=%s&comment=%s", 25 | url.QueryEscape(ip), 26 | url.QueryEscape("14"), 27 | url.QueryEscape(fmt.Sprintf( 28 | "%s: Minecraft server scan detected from %s on port %d%s", 29 | t.Format("2006-01-02 15:04:05"), 30 | ip, 31 | port, 32 | hostnamePart, 33 | )), 34 | ) 35 | 36 | req, err := http.NewRequest("POST", URI, strings.NewReader(payload)) 37 | if err != nil { 38 | return -1, fmt.Errorf("error creating HTTP request: %w", err) 39 | } 40 | 41 | req.Header.Set("Key", key) 42 | req.Header.Set("Content-Type", "application/x-www-form-urlencoded") 43 | 44 | client := &http.Client{} 45 | resp, err := client.Do(req) 46 | if err != nil { 47 | return -1, fmt.Errorf("error making HTTP request: %w", err) 48 | } 49 | defer resp.Body.Close() 50 | 51 | return resp.StatusCode, nil 52 | } 53 | -------------------------------------------------------------------------------- /handler/Handshake.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | 7 | "github.com/LockBlock-dev/MinePot/types" 8 | "github.com/Tnze/go-mc/net/packet" 9 | ) 10 | 11 | func handleHandshake(conn *types.ConnWrapper) int { 12 | var ( 13 | Protocol, Intention packet.VarInt 14 | ServerAddress packet.String 15 | ServerPort packet.UnsignedShort 16 | ) 17 | var p packet.Packet 18 | 19 | conn.PacketsReceived++ 20 | 21 | // Handle Handshake packet : https://wiki.vg/Server_List_Ping#Handshake 22 | if err := conn.ReadPacket(&p); err != nil { 23 | log.Println("Failed to parse Handshake packet:", err) 24 | return -1 25 | } 26 | 27 | if err := p.Scan(&Protocol, &ServerAddress, &ServerPort, &Intention); err != nil { 28 | log.Println("Failed to parse Handshake data:", err) 29 | return -1 30 | } 31 | 32 | if conn.Config.Debug { 33 | log.Println( 34 | conn.Conn.Socket.RemoteAddr().String() + 35 | " - Received Handshake packet => Protocol version: " + 36 | fmt.Sprint(Protocol) + 37 | ", Server address: " + 38 | string(ServerAddress) + 39 | ", Server port: " + 40 | fmt.Sprint(ServerPort) + 41 | ", Next state: " + 42 | fmt.Sprint(Intention), 43 | ) 44 | } 45 | 46 | conn.ReceivedProtocol = int(Protocol) 47 | conn.DidHandshake = true 48 | 49 | return int(Intention) 50 | } 51 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "debug": false, 3 | 4 | "writeLogs": false, 5 | "logFile": "/var/log/minepot/minepot.logs", 6 | 7 | "writeHistory": false, 8 | "historyFile": "/var/log/minepot/minepot.history", 9 | 10 | "port": 25565, 11 | "pingDelayMinMs": 50, 12 | "pingDelayMaxMs": 500, 13 | "idleTimeoutS": 10, 14 | 15 | "reportThreshold": 2, 16 | 17 | "abuseIPDBReport": false, 18 | "abuseIPDBKey": "XXXXXXXXXXXXXXX", 19 | "abuseIPDBCooldownH": 24, 20 | 21 | "webhookReport": false, 22 | "webhookUrl": "https://discord.com/api/webhooks/XXXXXXXXX/XXXXXXXXXXXXXX", 23 | "webhookCooldownH": 1, 24 | "webhookEmbedColor": "#00aa00", 25 | 26 | "randomVersion": true, 27 | "statusResponse": true, 28 | "statusResponseData": { 29 | "version": { 30 | "name": "Unknown", 31 | "protocol": -1 32 | }, 33 | "players": { 34 | "max": 10, 35 | "online": 2, 36 | "sample": [ 37 | { 38 | "name": "jeb_", 39 | "id": "853c80ef-3c37-49fd-aa49-938b674adae6" 40 | }, 41 | { 42 | "name": "Notch", 43 | "id": "069a79f4-44e9-4726-a5be-fca90e38aaf5" 44 | } 45 | ] 46 | }, 47 | "description": " Hello \u00A7c\u00A7l%IP%\u00A7r! You have been \u00A7f\u00A7ltrolled\u00A7r!\u00A7r\u00A7r\n \u00A7n\u00A7bhttps://github.com/LockBlock-dev/MinePot", 48 | "favicon": "" 49 | }, 50 | "faviconPath": "./assets/trollface.png" 51 | } 52 | -------------------------------------------------------------------------------- /types/DiscordWebhook.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | type DiscordWebhookPayload struct { 4 | Content string `json:"content,omitempty"` 5 | Username string `json:"username,omitempty"` 6 | AvatarURL string `json:"avatar_url,omitempty"` 7 | Embeds []DiscordWebhookEmbed `json:"embeds,omitempty"` 8 | } 9 | 10 | type DiscordWebhookEmbed struct { 11 | Title string `json:"title,omitempty"` 12 | Description string `json:"description,omitempty"` 13 | URL string `json:"url,omitempty"` 14 | Color int `json:"color,omitempty"` 15 | Fields []DiscordWebhookField `json:"fields,omitempty"` 16 | Author DiscordWebhookAuthor `json:"author,omitempty"` 17 | Footer DiscordWebhookFooter `json:"footer,omitempty"` 18 | Image DiscordWebhookImage `json:"image,omitempty"` 19 | Thumbnail DiscordWebhookThumbnail `json:"thumbnail,omitempty"` 20 | Video DiscordWebhookVideo `json:"video,omitempty"` 21 | } 22 | 23 | type DiscordWebhookField struct { 24 | Name string `json:"name"` 25 | Value string `json:"value"` 26 | Inline bool `json:"inline,omitempty"` 27 | } 28 | 29 | type DiscordWebhookAuthor struct { 30 | Name string `json:"name,omitempty"` 31 | URL string `json:"url,omitempty"` 32 | IconURL string `json:"icon_url,omitempty"` 33 | } 34 | 35 | type DiscordWebhookFooter struct { 36 | Text string `json:"text,omitempty"` 37 | IconURL string `json:"icon_url,omitempty"` 38 | ProxyIconURL string `json:"proxy_icon_url,omitempty"` 39 | } 40 | 41 | type DiscordWebhookImage struct { 42 | URL string `json:"url,omitempty"` 43 | ProxyURL string `json:"proxy_url,omitempty"` 44 | Height int `json:"height,omitempty"` 45 | Width int `json:"width,omitempty"` 46 | } 47 | 48 | type DiscordWebhookThumbnail struct { 49 | URL string `json:"url,omitempty"` 50 | ProxyURL string `json:"proxy_url,omitempty"` 51 | Height int `json:"height,omitempty"` 52 | Width int `json:"width,omitempty"` 53 | } 54 | 55 | type DiscordWebhookVideo struct { 56 | URL string `json:"url,omitempty"` 57 | Height int `json:"height,omitempty"` 58 | Width int `json:"width,omitempty"` 59 | } 60 | -------------------------------------------------------------------------------- /util/webhook.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "fmt" 7 | "net/http" 8 | "os" 9 | 10 | "github.com/LockBlock-dev/MinePot/types" 11 | ) 12 | 13 | func SendWebhook(config *types.Config, ip string, reported bool, didHandshake bool, didPing bool) error { 14 | // Parse the color string 15 | var r, g, b int 16 | fmt.Sscanf(config.WebhookEmbedColor, "#%02x%02x%02x", &r, &g, &b) 17 | // Combine the red, green, and blue color components into a single int value 18 | color := (r << 16) | (g << 8) | b 19 | 20 | var hostnamePart string 21 | hostname, err := os.Hostname() 22 | if err != nil { 23 | hostnamePart = "" 24 | } else { 25 | hostnamePart = " of " + hostname 26 | } 27 | 28 | // Create a DiscordWebhookPayload struct with the message 29 | payload := types.DiscordWebhookPayload{ 30 | Embeds: []types.DiscordWebhookEmbed{ 31 | { 32 | Title: "New scan detected on port " + fmt.Sprint(config.Port) + hostnamePart, 33 | Color: color, 34 | Fields: []types.DiscordWebhookField{ 35 | { 36 | Name: "IP", 37 | Value: "`" + ip + "`", 38 | }, 39 | { 40 | Name: "Reported to AbuseIPDB", 41 | Value: fmt.Sprintf("`%t`", reported), 42 | }, 43 | { 44 | Name: "Handshake", 45 | Value: fmt.Sprintf("`%t`", didHandshake), 46 | Inline: true, 47 | }, 48 | { 49 | Name: "Ping", 50 | Value: fmt.Sprintf("`%t`", didPing), 51 | Inline: true, 52 | }, 53 | }, 54 | }, 55 | }, 56 | } 57 | 58 | // Marshal the struct to JSON 59 | payloadJSON, err := json.Marshal(payload) 60 | if err != nil { 61 | return fmt.Errorf("error encoding JSON payload: %w", err) 62 | } 63 | 64 | // Create a new HTTP POST request with the payload as the body 65 | req, err := http.NewRequest("POST", config.WebhookUrl, bytes.NewBuffer(payloadJSON)) 66 | if err != nil { 67 | return fmt.Errorf("error creating HTTP request: %w", err) 68 | } 69 | 70 | // Set the content-type header to application/json 71 | req.Header.Set("Content-Type", "application/json") 72 | 73 | // Send the request 74 | client := http.DefaultClient 75 | resp, err := client.Do(req) 76 | if err != nil { 77 | return fmt.Errorf("error making HTTP request: %w", err) 78 | } 79 | defer resp.Body.Close() 80 | 81 | return nil 82 | } 83 | -------------------------------------------------------------------------------- /handler/StatusRequest.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "encoding/json" 5 | "log" 6 | "net" 7 | "strings" 8 | 9 | "github.com/LockBlock-dev/MinePot/internal/minecraft" 10 | "github.com/LockBlock-dev/MinePot/types" 11 | "github.com/LockBlock-dev/MinePot/util" 12 | "github.com/Tnze/go-mc/net/packet" 13 | ) 14 | 15 | func handleStatusRequest(conn *types.ConnWrapper) { 16 | remoteAddrString := conn.Conn.Socket.RemoteAddr().String() 17 | 18 | // Handle Status Request packet : https://wiki.vg/Server_List_Ping#Status_Request 19 | if conn.Config.Debug { 20 | log.Println(remoteAddrString + " - Received Status Request packet") 21 | } 22 | 23 | statusResponseData := conn.Config.StatusResponseData 24 | versions := minecraft.GetAllVersions() 25 | protocolMapping := minecraft.GetAllVersionsMapping() 26 | 27 | if conn.Config.RandomVersion { 28 | key := util.RandRange(0, len(versions)-1) 29 | version := versions[key] 30 | protocol := protocolMapping[version] 31 | 32 | statusResponseData.Version.Name = version 33 | statusResponseData.Version.Protocol = protocol 34 | } else { 35 | if conn.Config.StatusResponseData.Version.Protocol == -1 { 36 | for k, v := range protocolMapping { 37 | if v == conn.ReceivedProtocol { 38 | statusResponseData.Version.Name = k 39 | } 40 | } 41 | 42 | statusResponseData.Version.Protocol = conn.ReceivedProtocol 43 | } 44 | } 45 | 46 | ipSubstr := "%IP%" 47 | 48 | statusResponseData.Description = strings.Replace( 49 | statusResponseData.Description, 50 | ipSubstr, 51 | conn.Conn.Socket.RemoteAddr().(*net.TCPAddr).IP.String(), 52 | 1, 53 | ) 54 | 55 | // Add the favicon from its file 56 | err := util.GetFavicon(conn.Config) 57 | if err != nil { 58 | statusResponseData.Favicon = "" 59 | } 60 | 61 | // Sending Status Response packet : https://wiki.vg/Server_List_Ping#Status_Response 62 | status := statusResponseData 63 | 64 | jsonData, err := json.Marshal(status) 65 | if err != nil { 66 | log.Println("Failed to transform JSON Status Response:", err) 67 | } 68 | 69 | if err := conn.WritePacket(packet.Marshal(0x00, packet.String(jsonData))); err != nil { 70 | log.Println("Failed to send Status Response packet to client:", err) 71 | } 72 | 73 | if conn.Config.Debug { 74 | log.Println(remoteAddrString + " - Sent Status Response packet") 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | "path" 8 | "time" 9 | 10 | "github.com/LockBlock-dev/MinePot/handler" 11 | "github.com/LockBlock-dev/MinePot/types" 12 | "github.com/LockBlock-dev/MinePot/util" 13 | "github.com/Tnze/go-mc/net" 14 | "github.com/muesli/cache2go" 15 | ) 16 | 17 | func main() { 18 | config, err := util.GetConfig() 19 | if err != nil { 20 | log.Fatal(err) 21 | } 22 | 23 | var file *os.File 24 | 25 | if config.WriteLogs { 26 | // Open logs file 27 | file, err = os.OpenFile(config.LogFile, os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0644) // 644 = rw-,r--,r-- 28 | if err != nil { 29 | log.Fatal(err) 30 | } 31 | defer file.Close() 32 | } 33 | 34 | if config.WriteHistory { 35 | // Open history file 36 | historyFile, err := os.OpenFile(config.HistoryFile, os.O_TRUNC|os.O_CREATE|os.O_WRONLY, 0644) // 644 = rw-,r--,r-- 37 | if err != nil { 38 | log.Fatal(err) 39 | } 40 | defer historyFile.Close() 41 | 42 | _, err = historyFile.WriteString("datetime, ip, packets_count, reported, handshake, ping") 43 | if err != nil { 44 | log.Fatal("Failed to write history headers:", err) 45 | } 46 | } 47 | 48 | // Setup the cache 49 | _ = cache2go.Cache("MinePot") 50 | 51 | // Listen for incoming connections on TCP port X (see config.json) 52 | address := fmt.Sprintf(":%d", config.Port) 53 | listener, err := net.ListenMC(address) 54 | if err != nil { 55 | log.Fatal(err) 56 | } 57 | 58 | defer func() { 59 | listener.Close() 60 | }() 61 | 62 | log.Printf("Server listening on port %d\nYou can edit the config at /etc/minepot/config.json", config.Port) 63 | 64 | if config.WriteLogs { 65 | // Logs the logs file path 66 | cwd, err := os.Getwd() 67 | if err == nil { 68 | log.Println("Find the logs at: " + path.Join(cwd, config.LogFile)) 69 | } 70 | 71 | // Setup logs to a file 72 | log.SetOutput(file) 73 | } 74 | 75 | for { 76 | // Wait for a client to connect 77 | conn, err := listener.Accept() 78 | if err != nil { 79 | log.Println(err) 80 | return 81 | } 82 | 83 | // Set a timeout of X seconds (see config.json) 84 | conn.Socket.SetDeadline(time.Now().Add(time.Duration(config.IdleTimeoutS) * time.Second)) 85 | 86 | connWrapper := types.ConnWrapper{ 87 | Conn: conn, 88 | Config: config, 89 | } 90 | 91 | // Start a new goroutine to handle the connection 92 | go handler.HandleConnection(connWrapper) 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /util/logic.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "math" 7 | "net" 8 | "os" 9 | "time" 10 | 11 | "github.com/LockBlock-dev/MinePot/types" 12 | ) 13 | 14 | func HandleReport(conn types.ConnWrapper, addr string) { 15 | if conn.PacketsReceived >= conn.Config.ReportThreshold { 16 | host, _, err := net.SplitHostPort(addr) 17 | if err != nil { 18 | log.Println(addr+" - Failed to read host from address:", err) 19 | } 20 | 21 | var reportedAIPDB = false 22 | if conn.Config.AbuseIPDBReport && shouldReport(host, conn.Config.AbuseIPDBCooldownH, true) { 23 | respCode, err := Report(host, conn.Config.AbuseIPDBKey, conn.Config.Port) 24 | if err != nil { 25 | log.Println(addr+" - Failed to report on AbuseIPDB:", err) 26 | } else if respCode == 200 { 27 | reportedAIPDB = true 28 | } 29 | } 30 | 31 | var reportedWebhook = false 32 | if conn.Config.WebhookReport && shouldReport(host, conn.Config.WebhookCooldownH, false) { 33 | err := SendWebhook( 34 | conn.Config, 35 | host, 36 | reportedAIPDB, 37 | conn.DidHandshake, 38 | conn.DidPing, 39 | ) 40 | if err != nil { 41 | log.Println(addr+" - Failed to report on webhook:", err) 42 | } else { 43 | reportedWebhook = true 44 | } 45 | } 46 | 47 | AddToCache( 48 | host, 49 | // The maximum time between the AbuseIPDB and Webhook report (in hours) 50 | time.Duration(math.Max(float64(conn.Config.AbuseIPDBCooldownH), float64(conn.Config.WebhookCooldownH)))*time.Hour, 51 | types.Report{ 52 | Datetime: time.Now(), 53 | PacketsCount: conn.PacketsReceived, 54 | ReportedAIPDB: reportedAIPDB, 55 | ReportedWebhook: reportedWebhook, 56 | Handshake: conn.DidHandshake, 57 | Ping: conn.DidPing, 58 | }, 59 | ) 60 | 61 | if conn.Config.WriteHistory { 62 | // Open history file 63 | file, err := os.OpenFile(conn.Config.HistoryFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) // 644 = rw-,r--,r-- 64 | if err != nil { 65 | log.Println(addr+" - Failed to open history file:", err) 66 | } 67 | defer file.Close() 68 | 69 | t := time.Now() 70 | 71 | _, err = file.WriteString(fmt.Sprintf( 72 | "%s,%s,%d,%t,%t,%t\n", 73 | t.Format("2006-01-02 15:04:05"), 74 | host, 75 | conn.PacketsReceived, 76 | reportedAIPDB, 77 | conn.DidHandshake, 78 | conn.DidPing, 79 | )) 80 | if err != nil { 81 | log.Println(addr+" - Failed to write history:", err) 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /internal/minecraft/versions.go: -------------------------------------------------------------------------------- 1 | package minecraft 2 | 3 | func GetAllVersionsMapping() map[string]int { 4 | return map[string]int{ 5 | "1.7.2": 4, 6 | "1.7.4": 4, 7 | "1.7.5": 4, 8 | "1.7.6": 5, 9 | "1.7.7": 5, 10 | "1.7.8": 5, 11 | "1.7.9": 5, 12 | "1.7.10": 5, 13 | "1.8": 47, 14 | "1.8.1": 47, 15 | "1.8.2": 47, 16 | "1.8.3": 47, 17 | "1.8.4": 47, 18 | "1.8.5": 47, 19 | "1.8.6": 47, 20 | "1.8.7": 47, 21 | "1.8.8": 47, 22 | "1.8.9": 47, 23 | "1.9": 107, 24 | "1.9.1": 108, 25 | "1.9.2": 109, 26 | "1.9.3": 110, 27 | "1.9.4": 110, 28 | "1.10": 210, 29 | "1.10.1": 210, 30 | "1.10.2": 210, 31 | "1.11": 315, 32 | "1.11.1": 316, 33 | "1.11.2": 316, 34 | "1.12": 335, 35 | "1.12.1": 338, 36 | "1.12.2": 340, 37 | "1.13": 393, 38 | "1.13.1": 401, 39 | "1.13.2": 404, 40 | "1.14": 477, 41 | "1.14.1": 480, 42 | "1.14.2": 485, 43 | "1.14.3": 490, 44 | "1.14.4": 498, 45 | "1.15": 573, 46 | "1.15.1": 575, 47 | "1.15.2": 578, 48 | "1.16": 735, 49 | "1.16.1": 736, 50 | "1.16.2": 751, 51 | "1.16.3": 753, 52 | "1.16.4": 754, 53 | "1.16.5": 754, 54 | "1.17": 755, 55 | "1.17.1": 756, 56 | "1.18": 757, 57 | "1.18.1": 757, 58 | "1.18.2": 758, 59 | "1.19": 759, 60 | "1.19.1": 760, 61 | "1.19.2": 760, 62 | "1.19.3": 761, 63 | "1.19.4": 762, 64 | "1.20": 763, 65 | "1.20.1": 763, 66 | "1.20.2": 764, 67 | "1.20.3": 765, 68 | "1.20.4": 765, 69 | "1.20.5": 766, 70 | "1.20.6": 766, 71 | "1.21": 767, 72 | } 73 | } 74 | 75 | func GetAllVersions() []string { 76 | return []string{ 77 | "1.7.2", 78 | "1.7.4", 79 | "1.7.5", 80 | "1.7.6", 81 | "1.7.7", 82 | "1.7.8", 83 | "1.7.9", 84 | "1.7.10", 85 | "1.8", 86 | "1.8.1", 87 | "1.8.2", 88 | "1.8.3", 89 | "1.8.4", 90 | "1.8.5", 91 | "1.8.6", 92 | "1.8.7", 93 | "1.8.8", 94 | "1.8.9", 95 | "1.9", 96 | "1.9.1", 97 | "1.9.2", 98 | "1.9.3", 99 | "1.9.4", 100 | "1.10", 101 | "1.10.1", 102 | "1.10.2", 103 | "1.11", 104 | "1.11.1", 105 | "1.11.2", 106 | "1.12", 107 | "1.12.1", 108 | "1.12.2", 109 | "1.13", 110 | "1.13.1", 111 | "1.13.2", 112 | "1.14", 113 | "1.14.1", 114 | "1.14.2", 115 | "1.14.3", 116 | "1.14.4", 117 | "1.15", 118 | "1.15.1", 119 | "1.15.2", 120 | "1.16", 121 | "1.16.1", 122 | "1.16.2", 123 | "1.16.3", 124 | "1.16.4", 125 | "1.16.5", 126 | "1.17", 127 | "1.17.1", 128 | "1.18", 129 | "1.18.1", 130 | "1.18.2", 131 | "1.19", 132 | "1.19.1", 133 | "1.19.2", 134 | "1.19.3", 135 | "1.19.4", 136 | "1.20", 137 | "1.20.1", 138 | "1.20.2", 139 | "1.20.3", 140 | "1.20.4", 141 | "1.20.5", 142 | "1.20.6", 143 | "1.21", 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MinePot 2 | 3 | [![GitHub stars](https://img.shields.io/github/stars/LockBlock-dev/MinePot.svg)](https://github.com/LockBlock-dev/MinePot/stargazers) 4 | 5 | MinePot is a Minecraft Server Honeypot made in Golang. Its goal is to catch Minecraft Server Scanners by listening for [Handshake](https://wiki.vg/Protocol#Handshake) and [Ping](https://wiki.vg/Protocol#Status) packets. 6 | 7 | See the [changelog](/CHANGELOG.md) for the latest updates. 8 | 9 | ## Table of content 10 | 11 | - [**Features**](#features) 12 | - [**Installation**](#installation) 13 | - [**Compiling from source**](#compiling-from-source) 14 | - [**Configuring MinePot**](#configuring-minepot) 15 | - [**Config details**](#config-details) 16 | - [**FAQ**](#faq) 17 | - [**Credits**](#credits) 18 | - [**Copyright**](#copyright) 19 | 20 | ## Features 21 | 22 | - Listen on any TCP port for incoming Minecraft packets 23 | - Answer [Handshake](https://wiki.vg/Protocol#Handshake) packets 24 | - Answer [Ping](https://wiki.vg/Protocol#Status) packets 25 | - Artificial random ping 26 | - Custom Status Response : 27 | - Custom version or version mirroring (send the received protocol/version) 28 | - Fake players 29 | - Custom MOTD 30 | - Custom favicon 31 | - Random protocol/version 32 | - IP reporting to [Abuse IP DB](https://www.abuseipdb.com/) 33 | - IP reporting to a Discord Webhook 34 | - History as a [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) formatted .history file 35 | 36 | ## Installation 37 | 38 | You can use Docker or install MinePot manually. Here's how: 39 | 40 | - Download [go](https://go.dev/dl/) (go 1.20 required). 41 | - Download or clone the project. 42 | - Download the binary from the [Releases](../../releases) or [build it](#compiling-from-source) yourself. 43 | - [Configure MinePot](#configuring-minepot). 44 | - Edit the `ExecStart` line in [`minepot.service`](/minepot.service) to the MinePot binary location. 45 | e.g.: `ExecStart=/home/YOUR_USERNAME/MinePot/MinePot` 46 | - Install MinePot by using [`install.sh`](/install.sh). It will setup the tool and start it as a service for you. 47 | 48 | ## Compiling from source 49 | 50 | - Use [`build.sh`](/build.sh) or use `go build` 51 | 52 | ## Configuring MinePot 53 | 54 | If you already used [`install.sh`](/install.sh), the config can be found in `/etc/minepot/config.json`. 55 | 56 | - Open the [`config`](/config.json) in your favorite editor. 57 | - Enable the features you want to use. See [Config details](#config-details) for in-depth explanations. 58 | - Edit the Status Response as you want. You can use [mctools MOTD creator](https://mctools.org/motd-creator) for the MOTD. 59 | - Change the `faviconPath` to any PNG image you want to use. 60 | 61 | ## Config details 62 | 63 | | Item | Values | Meaning | 64 | | ------------------ | ---------------------------------------------------------- | ------------------------------------------------------------------- | 65 | | debug | `boolean` | Enable debug logs | 66 | | writeLogs | `boolean` | Enable logs file | 67 | | logFile | `text` | Path to the logs file | 68 | | writeHistory | `boolean` | Enable history file | 69 | | historyFile | `text` | Path to the history file | 70 | | port | `number` | TCP port to listen on | 71 | | pingDelayMinMs | `number` | Minimum artificial server ping (in milliseconds) | 72 | | pingDelayMaxMs | `number` | Maximum artificial server ping (in milliseconds) | 73 | | idleTimeoutS | `number` | Time to wait before the connection times out | 74 | | reportThreshold | `number` | Amount of packets before being reported | 75 | | abuseIPDBReport | `boolean` | Enable Abuse IP DB reports | 76 | | abuseIPDBKey | `text` | Abuse IP DB API key | 77 | | abuseIPDBCooldownH | `number` | Cooldown between each reports (in hours) | 78 | | webhookReport | `boolean` | Enable Discord webhook reports | 79 | | webhookUrl | `text` | Discord webhook URL | 80 | | webhookCooldownH | `number` | Cooldown between each reports (in hours) | 81 | | webhookEmbedColor | `text` | Embed hex color | 82 | | randomVersion | `boolean` | Enable random Minecraft version and protocol in the status response | 83 | | statusResponse | `boolean` | Enable Status Response | 84 | | statusResponseData | [`JSON`](https://wiki.vg/Server_List_Ping#Status_Response) | Minecraft Status Reponse data | 85 | | faviconPath | `text` | Path to the favicon PNG image | 86 | 87 | ## FAQ 88 | 89 | - Q: Do you plan to release a Windows version? 90 | A: No. 91 | 92 | ## Credits 93 | 94 | - [Wiki.vg](https://wiki.vg) Minecraft protocol documentation 95 | - [go-mc](https://github.com/Tnze/go-mc) Minecraft protocol implementation 96 | 97 | ## Copyright 98 | 99 | See the [license](/LICENSE). 100 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | --------------------------------------------------------------------------------