Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

Commit 02efdae

Browse files
make one development branch
Co-authored-by: tnix <[email protected]>
1 parent 49ffc26 commit 02efdae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1669
-54
lines changed

README.md

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,5 @@
1-
# Meower-Server
2-
Official source code of the Meower server, written in Python. Powered by CloudLink.
1+
# server
32

4-
## NOTICE
5-
This is the APIv0 Branch of Code! This API code will only be maintained up until when New Meower is released.
3+
the go stuff, in cmd/* and pkg/* has no security features, so be careful!!!
64

7-
APIv0 will be upgraded automatically to APIv1 when Beta 6 is released. The API can be found at https://api.meower.org/
8-
9-
## Installing Dependencies
10-
* Run `pip3 install -r requirements.txt` in the downloaded and unzipped directory
11-
12-
## Running the server
13-
14-
```py
15-
git clone https://github.com/meower-media-co/Meower-Server.git --recursive
16-
cd Meower-Server
17-
python3 main.py
18-
```
19-
20-
To connect to the server, change the IP settings of your client to connect to ws://127.0.0.1:3000/.
21-
22-
### Rest API
23-
24-
This Rest API is configured to use CF Argo Tunnels for getting client IPs, but otherwise everything will function.
25-
26-
Currently supported functions of the API:
27-
28-
* /home - Gets the current homepage index.
29-
* /home?page=# - Lets you get a certain page # of the homepage.
30-
* /home?autoget - Automatically fetches all posts currently present on the page.
31-
* /ip - Gets the client's IP address and returns with plaintext. Only works if the server is communicating with a client over CF Argo Tunnels.
32-
* /posts?id=(Post ID) - Gets a Post ID, use /home to get an index of posts.
33-
* /status - Status for the Meower Server.
34-
* /posts/(Chat ID) - Gets the specified chat ID's index.
35-
* /reports - Gets the reports index (only accessable if a moderator or higher.
36-
* /inbox - Gets the specified user's inbox.
37-
* /search/home?q=(Query) - Searches home.
38-
* /search/users?q=(Query) - Searches users.
39-
* /users/(Username) - Gets the specified user's info.
40-
* /users/(Username)/posts - Gets the specified user's posts.
41-
* /statistics - Shows Meower's statistics (users, posts, and chats)
42-
### Trust keys and access control
43-
44-
In development, Meower is configured to use "meower" as a CloudLink Trust key. If you notice a forked server using this key, please request for it to be removed. This key is intended for development purposes only.
45-
46-
Meower is configured to use CloudLink's Trusted Access feature, which implements the following security features:
47-
1. IP blocker feature
48-
2. Client kicking
49-
3. Trust keys
50-
4. Protection from maliciously modified clients
51-
52-
## Contributing to the source
53-
54-
1. Make a fork of the repo
55-
2. Modify your source
56-
3. Open a PR
5+
this branch is the subject of a major rewrite

cmd/events/main.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package main
2+
3+
import (
4+
"log"
5+
"os"
6+
7+
"github.com/getsentry/sentry-go"
8+
"github.com/joho/godotenv"
9+
"github.com/meower-media-co/server/pkg/api/events"
10+
)
11+
12+
func main() {
13+
// Load dotenv
14+
godotenv.Load()
15+
16+
// Initialise Sentry
17+
sentry.Init(sentry.ClientOptions{
18+
Dsn: os.Getenv("EVENTS_SENTRY_DSN"),
19+
})
20+
21+
// Get expose address
22+
exposeAddr := os.Getenv("EVENTS_ADDRESS")
23+
if exposeAddr == "" {
24+
exposeAddr = ":3000"
25+
}
26+
27+
// Create & run server
28+
server := events.NewServer()
29+
err := server.Run(exposeAddr)
30+
if err != nil {
31+
log.Fatalln(err)
32+
}
33+
}

go.mod

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module github.com/meower-media-co/server
2+
3+
go 1.22.5
4+
5+
require (
6+
github.com/getsentry/sentry-go v0.28.1
7+
github.com/gorilla/websocket v1.5.3
8+
github.com/joho/godotenv v1.5.1
9+
github.com/redis/go-redis/v9 v9.6.1
10+
github.com/vmihailenco/msgpack/v5 v5.3.5
11+
)
12+
13+
require (
14+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
15+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
16+
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
17+
golang.org/x/sys v0.18.0 // indirect
18+
golang.org/x/text v0.14.0 // indirect
19+
)

go.sum

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
2+
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
3+
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
4+
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
5+
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
6+
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
7+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
8+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
9+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
10+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
11+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
12+
github.com/getsentry/sentry-go v0.28.1 h1:zzaSm/vHmGllRM6Tpx1492r0YDzauArdBfkJRtY6P5k=
13+
github.com/getsentry/sentry-go v0.28.1/go.mod h1:1fQZ+7l7eeJ3wYi82q5Hg8GqAPgefRq+FP/QhafYVgg=
14+
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
15+
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
16+
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
17+
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
18+
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
19+
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
20+
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
21+
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
22+
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
23+
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
24+
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
25+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
26+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
27+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
28+
github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4=
29+
github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA=
30+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
31+
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
32+
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
33+
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
34+
github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU=
35+
github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
36+
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
37+
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
38+
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
39+
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
40+
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
41+
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
42+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
43+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
44+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
45+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)