-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
env_example
92 lines (79 loc) · 3.52 KB
/
env_example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh
# SPDX-License-Identifier: CC0-1.0
#
# env_example
#
# This file is a component of ShadyURL by Elizabeth Myers.
#
# To the extent possible under law, the person who associated CC0 with
# ShadyURL has waived all copyright and related or neighboring rights
# to ShadyURL.
#
# You should have received a copy of the CC0 legalcode along with this
# work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# This is the .env config file for ShadyURL.
# Configure it to your site needs.
# Be sure to carefully read over each directive.
# Local sitename, if you wish to change it
SITENAME=ShadyURL
# Hostname to use for shady links
SHADY_HOST="localhost:3000"
# Your site's base host, non-shady links
BASE_HOST="localhost:3000"
# IP and port to bind to
BIND="0.0.0.0:3000"
# Source to retrieve client IP's from (case-sensitive)
# Options:
# - RightmostForwarded: Select the rightmost IP in the Forwarded header
# - RightmostXForwardedFor: Select the rightmost IP in the X-Forwarded-For header
# - XRealIp: Select the IP from the X-Real-Ip header
# - FlyClientIp: Select the IP from the Fly-Client-IP header
# - TrueClientIp: Select the IP from the True-Client-IP header
# - CfConnectingIp: Select the IP from the CF-Connecting-IP header
# - ConnectInfo: Select the IP from the client's raw connection info (default)
#
# When in doubt:
# - You likely want RightmostXForwardedFor if this is behind nginx or most webservers
# - If running bare without a server in front, ConnectInfo is what you want (not recommended)
#
# See https://docs.rs/axum-client-ip/latest/axum_client_ip/enum.SecureClientIpSource.html for
# detailed documentation on each option.
IP_SOURCE="RightmostXForwardedFor"
# Database URL to connect to, following the format:
# protocol://username:password@host:port/database
#
# SQLite is also supported, in that case it's just a path to a file, as below.
#
# Be sure to run from the source dir:
# . ./.env && sea-orm-cli migrate -u "$DATABASE_URL" up
DATABASE_URL="sqlite:/:memory:"
# Redis URL, must start with redis:// as below.
REDIS_URL="redis://127.0.0.1"
# Redis pool size, defaults to 3, increase if you need more
REDIS_POOL_SIZE=3
# Set the log level, this uses the EnvFilter syntax from tracing.
# For production, it's recommended to keep this at warn or error.
RUST_LOG="warn"
# URL cache parameters.
# The URL cache is used to cache if a URL matches a banned regex.
# If it does, it is disallowed for shadifying.
# - URL_CACHE_TTL: maximum time a URL can live in the cache. (default: 3 days)
# - URL_CACHE_IDLE: maximum time a URL can be idle in the cache. (default: 1 day)
# - URL_CACHE_MAX_ENTRIES: maximum cache entries allowed (default: 5000)
URL_CACHE_TTL="3d"
URL_CACHE_IDLE="1d"
URL_CACHE_MAX_ENTRIES=5000
# Ban cache parameters.
# The ban cache is used to cache if a given IP is in a banned IP block.
# If it is, the user cannot shadify their URL.
# - BAN_CACHE_TTL: maximum time an IP can live in the cache. (default: 3 days)
# - BAN_CACHE_IDLE: maximum time an IP can be idle in the cache. (default: 1 day)
# - BAN_CACHE_MAX_ENTRIES: maximum cache entries allowed (default: 5000)
BAN_CACHE_TTL="3d"
BAN_CACHE_IDLE="1d"
BAN_CACHE_MAX_ENTRIES=5000
# Set the CSRF encryption key.
# If unset, a random one will be generated each application start (invalidating all previous sessions).
# This default MUST be changed. Generate a new one with:
# cargo run generate-key
CSRF_KEY="V2h5IGRpZCB5b3Ugd2FzdGUgeW91ciB0aW1lIGRlY29kaW5nIHRoaXMgdGhpbmc/IEdvIHRvdWNoIGdyYXNzLg=="