The backend API server for the EduPage2 project.
There are 3 ways to install and run the server:
Important
For bare-metal and Docker installs, you will also need to clone the EduPage2 flutter project, build it for the web, and place the build files in cmd/server/web
- Install Golang
- Clone the repository
git clone https://github.com/DislikesSchool/EduPage2-server.git
- Install dependencies
go mod download
- Build the project
go build ./cmd/server
- Run the server
./server
- Clone the repository
git clone https://github.com/DislikesSchool/EduPage2-server.git
- Build the Docker image
docker build -t edupage2-server .
- Run the Docker container
docker run --mount type=bind,src=./config.yaml,dst=/config.yaml,ro --mount type=bind,src=./logs,dst=/logs -p 8080:8080 edupage2-server
- Clone the repository
git clone https://github.com/DislikesSchool/EduPage2-server.git
- Start the container
docker compose up -d
The server can be configured using the config.yaml
file. Copy the config.example.yaml
file and edit it to your liking.
cp config.example.yaml config.yaml
The default configuration is as follows:
# General server configuration
server:
# The host address to bind to (do not change this unless you know what you are doing)
host: "0.0.0.0"
# The port to bind to
port: "8080"
# The mode to run the server in (either "development" or "production")
mode: "production"
# School configuration
schools:
# Whitelisted schools (users will only be allowed to login if they are a member of this school)
whitelist:
- "schoolname" # This is your school's unique name (https://schoolname.edupage.org)
# Whether to use the whitelist as a blacklist instead
blacklist: false # Set this to true with a empty whitelist to allow users from any school
# JWT configuration
jwt:
# The secret key to use for signing JWT tokens (change this to a secure random value)
secret: "YourDefaultSecretKey"
If you want to host a public instance, remove all schools from the whitelist and set blacklist
to true
.
The server provides a RESTful API for the frontend to interact with. The API documentation can be found here, or at the same endpoint on your own instance.