kopia lustrzana https://github.com/reiver/greatape
Porównaj commity
6 Commity
770107b54b
...
b7cfb2e4d3
Autor | SHA1 | Data |
---|---|---|
Xeronith | b7cfb2e4d3 | |
Xeronith | 0223f92645 | |
Xeronith | 68cbeae355 | |
Xeronith | 42cee14809 | |
Xeronith | 5d208e7b6b | |
Xeronith | fe24617a85 |
|
@ -25,7 +25,6 @@
|
|||
go.work
|
||||
|
||||
### Go Patch ###
|
||||
/vendor/
|
||||
/Godeps/
|
||||
|
||||
### GoLand+all ###
|
||||
|
|
25
Dockerfile
25
Dockerfile
|
@ -1,18 +1,31 @@
|
|||
FROM golang:1.19 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
WORKDIR /src
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -a -ldflags '-linkmode external -extldflags "-static"' -o ./bin/greatape .
|
||||
RUN go mod download
|
||||
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build \
|
||||
-ldflags '-linkmode external -extldflags "-static" -X github.com/reiver/greatape/components/core.runningInContainer=true -w -s' \
|
||||
-a -o ./bin/greatape .
|
||||
|
||||
FROM scratch
|
||||
|
||||
ENV PROTOCOL="http"
|
||||
ENV DOMAIN="localhost"
|
||||
ENV PORT=80
|
||||
# development, staging, production
|
||||
ENV ENVIRONMENT=development
|
||||
|
||||
COPY --from=builder /app/bin /app
|
||||
ENV PROTOCOL=https
|
||||
ENV FQDN=yourdomain.com
|
||||
ENV PORT=7080
|
||||
|
||||
ENV POSTGRES_HOST=127.0.0.1
|
||||
ENV POSTGRES_PORT=5432
|
||||
ENV POSTGRES_DATABASE=greatape
|
||||
ENV POSTGRES_USER=postgres
|
||||
ENV POSTGRES_PASSWORD=password
|
||||
|
||||
COPY --from=builder /src/bin /app
|
||||
|
||||
EXPOSE $PORT
|
||||
|
||||
|
|
75
README.md
75
README.md
|
@ -11,16 +11,75 @@
|
|||
|
||||
**greatape** is a Fediverse technology that supports Federation via ActivityPub.
|
||||
|
||||
## Running the Project
|
||||
## 🏎️ Running the Project
|
||||
|
||||
1. Create an empty Postgres database.
|
||||
2. Clone the project repository: `git clone https://github.com/reiver/greatape`
|
||||
3. Navigate to the project directory: `cd greatape`
|
||||
4. Download the project dependencies: `go mod download`
|
||||
5. Update the `config.yaml` file in the project root directory with the actual values for your database.
|
||||
6. Run the project: `go run main.go`
|
||||
### 🚀 Using Go and Postgres
|
||||
|
||||
## Team
|
||||
1. Clone the project repository:
|
||||
```
|
||||
git clone https://github.com/reiver/greatape
|
||||
```
|
||||
2. Navigate to the project directory:
|
||||
```
|
||||
cd greatape
|
||||
```
|
||||
3. Create an empty Postgres database.
|
||||
4. Update the `config.yaml` file in the project root directory with the actual values for your database.
|
||||
5. Download the project dependencies:
|
||||
```
|
||||
go mod download
|
||||
```
|
||||
6. Run the project:
|
||||
```
|
||||
go run main.go
|
||||
```
|
||||
|
||||
### 🐳 Using Docker
|
||||
|
||||
1. Clone the project repository:
|
||||
```
|
||||
git clone https://github.com/reiver/greatape
|
||||
```
|
||||
2. Navigate to the project directory:
|
||||
```
|
||||
cd greatape
|
||||
```
|
||||
3. Build the Docker image:
|
||||
```
|
||||
docker build -t greatape .
|
||||
```
|
||||
4. Replace the environment variables below with your own and run the Docker container:
|
||||
```
|
||||
docker run \
|
||||
--name greatape \
|
||||
-e PROTOCOL=https \
|
||||
-e FQDN=yourdomain.com \
|
||||
-e PORT=7080 \
|
||||
-e POSTGRES_HOST=127.0.0.1 \
|
||||
-e POSTGRES_PORT=5432 \
|
||||
-e POSTGRES_DATABASE=greatape \
|
||||
-e POSTGRES_USER=postgres \
|
||||
-e POSTGRES_PASSWORD=password \
|
||||
-p 7080:7080 \
|
||||
greatape
|
||||
```
|
||||
|
||||
### 🐳 Using docker-compose
|
||||
|
||||
1. Clone the project repository:
|
||||
```
|
||||
git clone https://github.com/reiver/greatape
|
||||
```
|
||||
2. Navigate to the project directory:
|
||||
```
|
||||
cd greatape
|
||||
```
|
||||
3. Run the Docker containers using docker-compose:
|
||||
```
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
## 👥 Team
|
||||
|
||||
The following is a list of the people who are actively working on Great Ape (in alphabetical order):
|
||||
|
||||
|
|
10
config.yaml
10
config.yaml
|
@ -1,15 +1,11 @@
|
|||
# development, staging, production
|
||||
environment: development
|
||||
|
||||
server:
|
||||
fqdn: localhost
|
||||
protocol: http
|
||||
fqdn: yourdomain.com
|
||||
protocol: https
|
||||
ports:
|
||||
passive: 7080
|
||||
|
||||
# used for secure cookie
|
||||
# doc: https://pkg.go.dev/github.com/gorilla/securecookie@v1.1.1
|
||||
hash_key: '---INSERT-YOUR-HASH-KEY---'
|
||||
block_key: '---INSERT-YOUR-BLOCK-KEY---'
|
||||
|
||||
postgres:
|
||||
host: 127.0.0.1
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
# development, staging, production
|
||||
environment: development
|
||||
|
||||
server:
|
||||
fqdn: localhost
|
||||
protocol: http
|
||||
fqdn: yourdomain.com
|
||||
protocol: https
|
||||
ports:
|
||||
passive: 7080
|
||||
|
||||
# used for secure cookie
|
||||
# doc: https://pkg.go.dev/github.com/gorilla/securecookie@v1.1.1
|
||||
hash_key: '---INSERT-YOUR-HASH-KEY---'
|
||||
block_key: '---INSERT-YOUR-BLOCK-KEY---'
|
||||
|
||||
postgres:
|
||||
host: 127.0.0.1
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
version: "3.9"
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_PASSWORD: H8n5opZ6ESOVQ0rHMhTLQXpcSV
|
||||
POSTGRES_DB: greatape_dev
|
||||
volumes:
|
||||
- type: volume
|
||||
source: data
|
||||
target: /var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
backend:
|
||||
build: .
|
||||
ports:
|
||||
- "7080:7080"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
ENVIRONMENT: development
|
||||
PROTOCOL: https
|
||||
FQDN: yourdomain.com
|
||||
PORT: 7080
|
||||
POSTGRES_HOST: db
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: H8n5opZ6ESOVQ0rHMhTLQXpcSV
|
||||
POSTGRES_DATABASE: greatape
|
||||
deploy:
|
||||
replicas: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 10s
|
||||
max_attempts: 5
|
||||
window: 15s
|
2
go.mod
2
go.mod
|
@ -5,7 +5,7 @@ go 1.19
|
|||
require (
|
||||
github.com/robfig/cron v1.2.0
|
||||
github.com/sendgrid/sendgrid-go v3.12.0+incompatible
|
||||
github.com/xeronith/diamante v1.7.4
|
||||
github.com/xeronith/diamante v1.7.8
|
||||
google.golang.org/protobuf v1.28.1
|
||||
)
|
||||
|
||||
|
|
4
go.sum
4
go.sum
|
@ -45,8 +45,8 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
|
|||
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
||||
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
github.com/xeronith/diamante v1.7.4 h1:V7llhK1fFt4jNH3t4OsEBx3vMCk27cQ3BWqPl2DekAg=
|
||||
github.com/xeronith/diamante v1.7.4/go.mod h1:9Tm1tILSKRFRLqvGkG6fTNdLpQbsTZohTLD6xRoWkx8=
|
||||
github.com/xeronith/diamante v1.7.8 h1:Mx6nXm3eqYo79dD3D0SoX/aSYa/23QSYGrVXwQdEuok=
|
||||
github.com/xeronith/diamante v1.7.8/go.mod h1:9Tm1tILSKRFRLqvGkG6fTNdLpQbsTZohTLD6xRoWkx8=
|
||||
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
|
||||
|
|
Ładowanie…
Reference in New Issue