|
2 | 2 |
|
3 | 3 | ⭐ Star us on GitHub — your support keeps us motivated! |
4 | 4 |
|
5 | | -SysRegister offered an improved web UI for the ClasseViva school register and adds a few quality-of-life features. |
| 5 | +SysRegister offers an improved web UI for the ClasseViva school register and adds a few quality-of-life features. |
6 | 6 |
|
7 | 7 | --- |
8 | 8 |
|
9 | 9 | ### SysRegister has been forced to shut down. |
10 | | -#### Recently, ClasseViva has decided to ban our servers, as a result, SysRegister can no longer access the necessary data to function, for this reason I've decided to not continue with the project. |
| 10 | +#### Recently, ClasseViva has decided to ban our servers, as a result, SysRegister can no longer access the necessary data to function. However, you can now **self-host your own instance** to continue using SysRegister! |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## 🚀 Self-Hosting Guide |
| 15 | + |
| 16 | +Self-hosting allows you to run your own instance of SysRegister, avoiding centralized server bans. You can deploy it using Docker for the easiest setup. |
| 17 | + |
| 18 | +### Prerequisites |
| 19 | + |
| 20 | +- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed |
| 21 | +- Basic knowledge of terminal/command line |
| 22 | + |
| 23 | +### Quick Start with Docker Compose |
| 24 | + |
| 25 | +#### Option 1: Automated Setup (Recommended) |
| 26 | + |
| 27 | +Run the quick start script: |
| 28 | +```bash |
| 29 | +git clone https://github.com/gablilli/sysregister-reborn.git |
| 30 | +cd sysregister-reborn |
| 31 | +./start.sh |
| 32 | +``` |
| 33 | + |
| 34 | +This script will: |
| 35 | +- Create the `.env` file with a random JWT secret |
| 36 | +- Create necessary data directories |
| 37 | +- Build and start the Docker containers |
| 38 | +- Display helpful information |
| 39 | + |
| 40 | +#### Option 2: Manual Setup |
| 41 | + |
| 42 | +1. **Clone the repository** |
| 43 | + ```bash |
| 44 | + git clone https://github.com/gablilli/sysregister-reborn.git |
| 45 | + cd sysregister-reborn |
| 46 | + ``` |
| 47 | + |
| 48 | +2. **Create environment file** |
| 49 | + ```bash |
| 50 | + cp .env.example .env |
| 51 | + ``` |
| 52 | + |
| 53 | +3. **Edit the `.env` file** with your configuration: |
| 54 | + ```env |
| 55 | + # Database (SQLite - default configuration) |
| 56 | + DATABASE_URL="file:/app/data/database.db" |
| 57 | + |
| 58 | + # Authentication - IMPORTANT: Generate a secure random key! |
| 59 | + JWT_SECRET="your-super-secret-jwt-key-change-this" |
| 60 | + |
| 61 | + # PostHog Analytics (Optional - leave empty to disable) |
| 62 | + NEXT_PUBLIC_POSTHOG_KEY="" |
| 63 | + NEXT_PUBLIC_POSTHOG_HOST="" |
| 64 | + ``` |
| 65 | + |
| 66 | +4. **Start the application** |
| 67 | + ```bash |
| 68 | + docker-compose up -d |
| 69 | + ``` |
| 70 | + |
| 71 | +5. **Access SysRegister** |
| 72 | + |
| 73 | + Open your browser and navigate to `http://localhost:3000` |
| 74 | + |
| 75 | +### Configuration Options |
| 76 | + |
| 77 | +#### Environment Variables |
| 78 | + |
| 79 | +| Variable | Description | Required | Default | |
| 80 | +|----------|-------------|----------|---------| |
| 81 | +| `DATABASE_URL` | Database connection string | Yes | `file:/app/data/database.db` | |
| 82 | +| `JWT_SECRET` | Secret key for JWT authentication | Yes | - | |
| 83 | +| `NEXT_PUBLIC_POSTHOG_KEY` | PostHog analytics key | No | - | |
| 84 | +| `NEXT_PUBLIC_POSTHOG_HOST` | PostHog analytics host | No | - | |
| 85 | + |
| 86 | +#### Ports |
| 87 | + |
| 88 | +The application runs on port `3000` by default. You can change this in `docker-compose.yml`: |
| 89 | + |
| 90 | +```yaml |
| 91 | +ports: |
| 92 | + - "8080:3000" # Access on port 8080 instead |
| 93 | +``` |
| 94 | +
|
| 95 | +### Data Persistence |
| 96 | +
|
| 97 | +The following directories are persisted using Docker volumes: |
| 98 | +
|
| 99 | +- `./data` - SQLite database |
| 100 | +- `./userassets` - User uploaded content (avatars, banners) |
| 101 | + |
| 102 | +These directories will be created automatically on first run. |
| 103 | + |
| 104 | +### Managing the Application |
| 105 | + |
| 106 | +**View logs:** |
| 107 | +```bash |
| 108 | +docker-compose logs -f |
| 109 | +``` |
| 110 | + |
| 111 | +**Stop the application:** |
| 112 | +```bash |
| 113 | +docker-compose down |
| 114 | +``` |
| 115 | + |
| 116 | +**Restart the application:** |
| 117 | +```bash |
| 118 | +docker-compose restart |
| 119 | +``` |
| 120 | + |
| 121 | +**Update to latest version:** |
| 122 | +```bash |
| 123 | +git pull |
| 124 | +docker-compose down |
| 125 | +docker-compose build --no-cache |
| 126 | +docker-compose up -d |
| 127 | +``` |
| 128 | + |
| 129 | +### Manual Docker Build (Advanced) |
| 130 | + |
| 131 | +If you prefer to build and run manually: |
| 132 | + |
| 133 | +```bash |
| 134 | +# Build the image |
| 135 | +docker build -t sysregister . |
| 136 | +
|
| 137 | +# Run the container |
| 138 | +docker run -d \ |
| 139 | + -p 3000:3000 \ |
| 140 | + -e DATABASE_URL="file:/app/data/database.db" \ |
| 141 | + -e JWT_SECRET="your-secret-key" \ |
| 142 | + -v $(pwd)/data:/app/data \ |
| 143 | + -v $(pwd)/userassets:/app/public/userassets \ |
| 144 | + --name sysregister \ |
| 145 | + sysregister |
| 146 | +``` |
| 147 | + |
| 148 | +### Local Development (Without Docker) |
| 149 | + |
| 150 | +1. **Install dependencies** |
| 151 | + ```bash |
| 152 | + npm install |
| 153 | + ``` |
| 154 | + |
| 155 | +2. **Set up environment** |
| 156 | + ```bash |
| 157 | + cp .env.example .env |
| 158 | + # Edit .env with your configuration |
| 159 | + ``` |
| 160 | + |
| 161 | +3. **Generate Prisma client** |
| 162 | + ```bash |
| 163 | + npx prisma generate |
| 164 | + ``` |
| 165 | + |
| 166 | +4. **Run database migrations** |
| 167 | + ```bash |
| 168 | + npx prisma migrate deploy |
| 169 | + ``` |
| 170 | + |
| 171 | +5. **Start development server** |
| 172 | + ```bash |
| 173 | + npm run dev |
| 174 | + ``` |
| 175 | + |
| 176 | +6. **Build for production** |
| 177 | + ```bash |
| 178 | + npm run build |
| 179 | + npm start |
| 180 | + ``` |
| 181 | + |
| 182 | +### Troubleshooting |
| 183 | + |
| 184 | +**Issue: Database locked errors** |
| 185 | +- Ensure only one instance is running |
| 186 | +- Check that the `./data` directory has proper permissions |
| 187 | + |
| 188 | +**Issue: Cannot connect to ClasseViva** |
| 189 | +- This is expected if you're running behind a banned IP |
| 190 | +- Consider using a VPN or proxy |
| 191 | + |
| 192 | +**Issue: User assets not persisting** |
| 193 | +- Verify the `./userassets` volume is properly mounted |
| 194 | +- Check directory permissions |
| 195 | + |
| 196 | +### Security Recommendations |
| 197 | + |
| 198 | +- **Always change the default `JWT_SECRET`** to a strong, random value |
| 199 | +- Use HTTPS in production (consider using a reverse proxy like Nginx or Caddy) |
| 200 | +- Keep your instance updated with the latest security patches |
| 201 | +- Regularly backup the `./data` directory |
| 202 | + |
| 203 | +### Contributing |
| 204 | + |
| 205 | +Contributions are welcome! Please feel free to submit a Pull Request. |
| 206 | + |
| 207 | +### License |
| 208 | + |
| 209 | +See LICENSE file for details. |
11 | 210 |
|
0 commit comments