From 20ffeac92b4ace23f0f961199628d4db46d8ebe6 Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Thu, 7 Sep 2023 16:46:24 +0100 Subject: [PATCH] Updates for 3.0.0 --- README.md | 59 ++++++++++++++++++++++++++++++------------------------ config.env | 54 ++++++++++++++++++++++++------------------------- 2 files changed, 60 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 4df0dce..7c9f63a 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,8 @@ This repository contains all the necessary information and files to self-host yo ## Table of Contents - [Requirements](#requirements) -- [Setup Instructions](#setup-instructions) +- [Version Management](#version-management) - [Using a Reverse Proxy](#using-a-reverse-proxy) -- [Configuration Options](#configuration-options) - [Update Instructions](#update-instructions) - [Links](#links) @@ -19,6 +18,19 @@ To run this project you will need: - Access to an SMTP server - x86-64 Architecture ([arm64 support has been suspended](https://github.com/lukevella/rallly/discussions/568)) +## Version Management + +Rallly uses semantic versioning and releases are published as tags on [Docker Hub](https://hub.docker.com/r/lukevella/rallly). +You can use `latest` to get the most recent release but it is recommended that you pin the image to a major version to avoid accidentally pulling in breaking changes. +You can set the version in `docker-compose.yml` by changing the following line: + +``` +- image: lukevella/rallly: +``` + +Check the [releases](https://github.com/lukevella/rallly/releases) to see what versions are available. +We follow semver versioning so you may want to set your version to a major release (e.g. `lukevella/rallly:3`) to avoid pulling in breaking changes. + ## Setup Instructions ### 1. Clone the repository @@ -30,7 +42,9 @@ cd rallly-selfhosted ### 2. Add required config -In the root of this project you will find a file called `config.env`. This is where you can set your environment variables to configure your instance. +In the root of this project you will find a file called `config.env`. +This is where you can set your environment variables to configure your instance. +This guide will go through the basics but, you can check out the full list of [configuration options](https://support.rallly.co/self-hosting/configuration-options) in the [self-hosting docs](https://support.rallly.co/self-hosting). Start by generating a secret key. **Must be at least 32-characters long**. @@ -54,20 +68,28 @@ Next, use the following environment variables to configure your SMTP server: - `SMTP_USER` - The username (if auth is enabled) - `SMTP_PWD` - The password (if auth is enabled) -### 4. Secure your instance (optional) +### 4. Secure your instance -The default behaviour of the app is the same as on the cloud-hosted version on [rallly.co](https://rallly.co). i.e. Anyone can create polls without needing to log in. You can prevent this by setting `AUTH_REQUIRED` to `true` in `config.env` which limits poll creation and admin access to logged in users. +By default, anyone can register and login on your instance. +You can restrict users by setting `ALLOWED_EMAILS`. -Additionally, you can restrict who is able to register and log in by setting `ALLOWED_EMAILS`. You can use wildcards to allow a range of email addresses. +If only you are planning on using this instance you can set `ALLOWED_EMAILS` to your email address. -```sh -# Example: only users matching the following patterns can register/login -ALLOWED_EMAILS="user@email.com,*@example.com,*@*.example.com" +``` +ALLOWED_EMAILS="john.doe@example.com" ``` -### 5. Disabling the landing page (optional) +If you would like to allow multiple users, you separate each email address with a comma. -By default the app will take you to the landing page which may not be what you want. If you want to go straight in to the app, set `DISABLE_LANDING_PAGE` to `true`. +``` +ALLOWED_EMAILS="john.doe@example.com,jane.doe@example.com" +``` + +You can also use wildcards to allow all emails from a domain. + +``` +ALLOWED_EMAILS="*@example.com" +``` ### 6. Start the server @@ -89,10 +111,6 @@ By default the app will run unencrypted on port 3000. If you want to serve the a > After setting up a reverse proxy be sure to change this line `- 3000:3000` to - `127.0.0.1:3000:3000` in `docker-compose.yml` and restart the container for it to apply changes. This prevents Rallly from being accessed remotely using HTTP on port 3000 which is a security concern. -## Configuration Options - -For a full list of configuration options, check out the official [self-hosting docs](https://support.rallly.co/self-hosting/configuration-options). - ## Update Instructions 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: @@ -103,17 +121,6 @@ docker compose pull docker compose up -d ``` -### Version management - -You can pin a specific version of Rallly by changing the `image` line in `docker-compose.yml`: - -``` -- image: lukevella/rallly: -``` - -Check the [releases](https://github.com/lukevella/rallly/releases) to see what versions are available. -We follow semver versioning so you may want to set your version to a major release (e.g. `lukevella/rallly:2`) to avoid pulling in breaking changes. - ## Links - [Source code](https://github.com/lukevella/rallly) diff --git a/config.env b/config.env index 5710f81..21cc4a1 100644 --- a/config.env +++ b/config.env @@ -1,42 +1,42 @@ # REQUIRED CONFIG +# A postgres database connection string. +# Does not need to be defined if you are using the docker-compose file in this repository +# to run your database. +DATABASE_URL=postgres://postgres:postgres@rallly_db:5432/db + # A random 32-character secret key used to encrypt user sessions SECRET_PASSWORD= + # The base url where this instance is accessible, including the scheme. # Example: https://example.com NEXT_PUBLIC_BASE_URL=http://localhost:3000 -# EMAIL CONFIG (required for sending emails) - -# All outgoing emails will show this email as the sender's email address, which also serves as the support email. -SUPPORT_EMAIL= -# The host address of your SMTP server -SMTP_HOST=localhost -# The port of your SMTP server -SMTP_PORT=25 -# Set to "true" if SSL is enabled for your SMTP connection -SMTP_SECURE=false -# The username (if auth is enabled on your SMTP server) -SMTP_USER= -# The password (if auth is enabled on your SMTP server) -SMTP_PWD= -# Set to "true" to enable TLS. Might be needed for some SMTP connections -SMTP_TLS_ENABLED=false - -# OPTIONAL CONFIG - -# Set to `true` to require authentication for creating new polls and accessing admin pages -AUTH_REQUIRED=false # Comma separated list of email addresses that are allowed to register and login. # You can use wildcard syntax to match a range of email addresses. # Example: "john@example.com,jane@example.com" or "*@example.com" ALLOWED_EMAILS= -# Whether or not to disable the landing page -DISABLE_LANDING_PAGE=false -# ADVANCED CONFIG +# EMAIL CONFIG (required for sending emails) -# If you are using the docker compose file this will be set automatically. -# Only set this if you want to use an external database. -# DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres +# The email address that will be used to send emails. If not set, SUPPORT_EMAIL will be used instead. +NOREPLY_EMAIL= + +# The email of whoever is managing this instance in case a user needs support. +SUPPORT_EMAIL= + +# The host address of your SMTP server +SMTP_HOST= + +# The port of your SMTP server +SMTP_PORT=587 + +# Set to "true" if SSL is enabled for your SMTP connection +SMTP_SECURE= + +# The username (if auth is enabled on your SMTP server) +SMTP_USER= + +# The password (if auth is enabled on your SMTP server) +SMTP_PWD=