mirror of
https://github.com/lukevella/rallly-selfhosted.git
synced 2025-12-10 02:42:49 +01:00
Added instructions
This commit is contained in:
parent
5ae50bfd3d
commit
10f68bdd46
24
LICENSE
24
LICENSE
@ -1,24 +0,0 @@
|
|||||||
This is free and unencumbered software released into the public domain.
|
|
||||||
|
|
||||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
||||||
distribute this software, either in source code form or as a compiled
|
|
||||||
binary, for any purpose, commercial or non-commercial, and by any
|
|
||||||
means.
|
|
||||||
|
|
||||||
In jurisdictions that recognize copyright laws, the author or authors
|
|
||||||
of this software dedicate any and all copyright interest in the
|
|
||||||
software to the public domain. We make this dedication for the benefit
|
|
||||||
of the public at large and to the detriment of our heirs and
|
|
||||||
successors. We intend this dedication to be an overt act of
|
|
||||||
relinquishment in perpetuity of all present and future rights to this
|
|
||||||
software under copyright law.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
||||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
For more information, please refer to <https://unlicense.org>
|
|
||||||
61
README.md
61
README.md
@ -1 +1,60 @@
|
|||||||
# self-host
|
[← Go to main repository](https://github.com/lukevella/rallly)
|
||||||
|
|
||||||
|
# Hosting your own instance of Rallly
|
||||||
|
|
||||||
|
The best way to run Rallly on your own server is using the public image published on docker hub. This repo contains an example configuration that allows you to get your own instance of Rallly running in just a few simple steps.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
You will need:
|
||||||
|
|
||||||
|
- Docker
|
||||||
|
- Access to an SMTP server for sending emails
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
### Copy this project
|
||||||
|
|
||||||
|
Copy the contents of this repo on to your server or clone this repo with git:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/rallly/self-hosting.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Feel free to name the contents of this folder to whatever your prefer.
|
||||||
|
|
||||||
|
### Configure the environment variables
|
||||||
|
|
||||||
|
In the root of this project you will find a file called `config.env`. Open this file with a text editor and:
|
||||||
|
|
||||||
|
- Set `SECRET_PASSWORD` - This should be a randomly generated string that will be used to encrypt user sessions. **It should be at least 32 characters long**.
|
||||||
|
|
||||||
|
- Set `NEXT_PUBLIC_BASE_URL` - This is the URL you will type in your browser to access your instance (eg. `https://rallly.example.com`). To be able to access the site using your own domain you will want to use a [reverse proxy](/reverse-proxy/).
|
||||||
|
|
||||||
|
- Set `SUPPORT_EMAIL` - This will appear as the support email in emails sent out by your instance.
|
||||||
|
|
||||||
|
- Configure `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER` and `SMTP_PWD` with the details of your SMTP server.
|
||||||
|
|
||||||
|
### Start the server
|
||||||
|
|
||||||
|
You can start the server by running:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
This command will:
|
||||||
|
|
||||||
|
- Create a postgres database
|
||||||
|
- Run migrations to set up the database schema
|
||||||
|
- Start the Next.js server on port 3000
|
||||||
|
|
||||||
|
## Updating your instance
|
||||||
|
|
||||||
|
Rallly is constantly being updated but you will need to manually pull these updates and restart the server to run the latest version. You can do this by running the following commands from within this directory:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compose down
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|||||||
7
config.env
Normal file
7
config.env
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
SECRET_PASSWORD=replace-me
|
||||||
|
NEXT_PUBLIC_BASE_URL=replace-me
|
||||||
|
SUPPORT_EMAIL=replace-me
|
||||||
|
SMTP_HOST=replace-me
|
||||||
|
SMTP_PORT=replace-me
|
||||||
|
SMTP_USER=replace-me
|
||||||
|
SMTP_PWD=replace-me
|
||||||
31
docker-compose.yml
Normal file
31
docker-compose.yml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
services:
|
||||||
|
rallly_db:
|
||||||
|
image: postgres:14.2
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- db-data:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=postgres
|
||||||
|
- POSTGRES_DB=db
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
rallly:
|
||||||
|
image: lukevella/rallly:latest
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
rallly_db:
|
||||||
|
condition: service_healthy
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgres://postgres:postgres@rallly_db:5432/db
|
||||||
|
env_file:
|
||||||
|
- config.env
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db-data:
|
||||||
|
driver: local
|
||||||
3
reverse-proxy/README.md
Normal file
3
reverse-proxy/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Using a reverse proxy
|
||||||
|
|
||||||
|
A reverse proxy can enable yourself and others to access your instance of Rallly with your own domain name. This directory contains a few example configurations for various reverse proxies.
|
||||||
18
reverse-proxy/apache2/rallly.conf
Normal file
18
reverse-proxy/apache2/rallly.conf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<VirtualHost *:80>
|
||||||
|
|
||||||
|
ServerAdmin admin@example.com
|
||||||
|
ServerName example.com
|
||||||
|
|
||||||
|
ProxyPreserveHost On
|
||||||
|
ProxyPass / http://localhost:3000/
|
||||||
|
ProxyPassReverse / http://localhost:3000/
|
||||||
|
|
||||||
|
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
|
||||||
|
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
|
||||||
|
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" forwarded
|
||||||
|
|
||||||
|
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||||
|
CustomLog ${APACHE_LOG_DIR}/access.log combined env=!forwarded
|
||||||
|
CustomLog ${APACHE_LOG_DIR}/access.log forwarded env=forwarded
|
||||||
|
|
||||||
|
</VirtualHost>
|
||||||
12
reverse-proxy/nginx/rallly
Normal file
12
reverse-proxy/nginx/rallly
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
server {
|
||||||
|
# replace example.com with your domain name
|
||||||
|
server_name example.com;
|
||||||
|
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:3000;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
reverse-proxy/traefik/docker-compose.traefik.yml
Normal file
8
reverse-proxy/traefik/docker-compose.traefik.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
version: "3.3"
|
||||||
|
services:
|
||||||
|
rallly:
|
||||||
|
labels:
|
||||||
|
traefik.enable: "true"
|
||||||
|
traefik.http.routers.plausible.rule: "Host(`example.com`)" # change to your domain name
|
||||||
|
traefik.http.routers.plausible.entrypoints: "websecure"
|
||||||
|
traefik.http.services.plausible.loadbalancer.server.port: "3000"
|
||||||
Loading…
x
Reference in New Issue
Block a user