Skip to content

Commit

Permalink
https
Browse files Browse the repository at this point in the history
  • Loading branch information
KTachibanaM committed Jul 9, 2024
1 parent caa43fc commit 962b6eb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker-compose.self-contained.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
- INSTANCE_INFINITE_SCROLL=1
- INSTANCE_BASE64_MEDIA=1
- INSTANCE_HOSTNAME=localhost:8081
# - INSTANCE_HTTPS=1
# optional for setups without redis and/or ng1inx
# - DISABLE_REDIS=1
# - DISABLE_NGINX=1
Expand Down
1 change: 1 addition & 0 deletions docs/self-contained-docker-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ In addition to the [regular Nitter docker image](https://github.com/sekai-soft/n
| INSTANCE_THEME | No | Default theme of the web UI. Available options are `Black`, `Dracula`, `Mastodon`, `Nitter`, `Pleroma`, `Twitter` and `Twitter Dark`. Defaults to `Nitter`. |
| INSTANCE_INFINITE_SCROLL | No | Use `1` to enable infinite scrolling. Enabling this option will load Javascript on the web UI. |
| INSTANCE_HOSTNAME | No | The hostname used to render public-facing URLs such as hyperlinks in RSS feeds. Defaults to `localhost:8080`. |
| INSTANCE_HTTPS | No | Use `1` to enable serving https traffic. |

* After the container is up, Nitter is available at port 8081 within the container if Nginx is enabled, and at port 8080 within the container if Nginx is disabled.

Expand Down
1 change: 1 addition & 0 deletions scripts/dump_env_and_procfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ echo REDIS_PASSWORD=$REDIS_PASSWORD >> /src/.env

echo Dumping instance customization env...
echo INSTANCE_PORT=$INSTANCE_PORT >> /src/.env
echo INSTANCE_HTTPS=$INSTANCE_HTTPS >> /src/.env
echo FLY_APP_NAME=$FLY_APP_NAME >> /src/.env
echo INSTANCE_HOSTNAME=$INSTANCE_HOSTNAME >> /src/.env
echo INSTANCE_BASE64_MEDIA=$INSTANCE_BASE64_MEDIA >> /src/.env
Expand Down
5 changes: 4 additions & 1 deletion scripts/gen_nitter_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
HOSTNAME_PLZ_CHANGE = "[HOSTNAME_PLZ_CHANGE]"
TITLE_PLZ_CHANGE = "[TITLE_PLZ_CHANGE]"
PORT_PLZ_CHANGE = "[PORT_PLZ_CHANGE]"
HTTPS_PLZ_CHANGE = "[HTTPS_PLZ_CHANGE]"
REDIS_HOST_PLZ_CHANGE = "[REDIS_HOST_PLZ_CHANGE]"
REDIS_PORT_PLZ_CHANGE = "[REDIS_PORT_PLZ_CHANGE]"
REDIS_PASSWORD_PLZ_CHANGE = "[REDIS_PASSWORD_PLZ_CHANGE]"
Expand All @@ -17,7 +18,7 @@
title = "[TITLE_PLZ_CHANGE]"
address = "0.0.0.0"
port = [PORT_PLZ_CHANGE]
https = false # disable to enable cookies when not using https
https = [HTTPS_PLZ_CHANGE] # disable to enable cookies when not using https
httpMaxConnections = 100
staticDir = "./public"
Expand Down Expand Up @@ -83,6 +84,7 @@ def main() -> str:
redis_password = getenv_treat_empty_string_as_none("REDIS_PASSWORD", "")

# other customizations
https = "true" if os.getenv("INSTANCE_HTTPS") == "1" else "false"
base64_media = "true" if os.getenv("INSTANCE_BASE64_MEDIA") == "1" else "false"
title = getenv_treat_empty_string_as_none("INSTANCE_TITLE", "My Nitter instance")
theme = getenv_treat_empty_string_as_none("INSTANCE_THEME", "Nitter")
Expand All @@ -91,6 +93,7 @@ def main() -> str:
return TEMPLATE \
.replace(HOSTNAME_PLZ_CHANGE, hostname) \
.replace(PORT_PLZ_CHANGE, port) \
.replace(HTTPS_PLZ_CHANGE, https) \
.replace(REDIS_HOST_PLZ_CHANGE, redis_host) \
.replace(REDIS_PORT_PLZ_CHANGE, redis_port) \
.replace(REDIS_PASSWORD_PLZ_CHANGE, redis_password) \
Expand Down

0 comments on commit 962b6eb

Please sign in to comment.