Skip to content

Commit

Permalink
Migrate to config.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Cohee1207 committed Nov 25, 2023
1 parent 3ec692e commit a7024a1
Show file tree
Hide file tree
Showing 17 changed files with 261 additions and 127 deletions.
10 changes: 5 additions & 5 deletions .github/readme-zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ SillyTavern 会将 API 密钥保存在目录中的 `secrets.json` 文件内。

如果要想通过点击 API 输入框旁边的按钮来查看密钥,请按照以下设置:

1. 打开 `config.conf` 文件,将里面的 `allowKeysExposure` 设置为 `true`
1. 打开 `config.yaml` 文件,将里面的 `allowKeysExposure` 设置为 `true`
2. 然后重启 SillyTavern 服务。

## 远程访问
Expand Down Expand Up @@ -207,7 +207,7 @@ SillyTavern 会将 API 密钥保存在目录中的 `secrets.json` 文件内。

然后,文件中设置的 IP 就可以访问 SillyTavern 了。

*注意:"config.conf" 文件内也有一个 "whitelist" 设置,你可以用同样的方法设置它,但如果 "whitelist.txt" 文件存在,这个设置将被忽略。
*注意:"config.yaml" 文件内也有一个 "whitelist" 设置,你可以用同样的方法设置它,但如果 "whitelist.txt" 文件存在,这个设置将被忽略。

### 2.获取 SillyTavern 服务的 IP 地址

Expand All @@ -233,19 +233,19 @@ SillyTavern 会将 API 密钥保存在目录中的 `secrets.json` 文件内。

### 向所有 IP 开放您的 SillyTavern 服务

我们不建议这样做,但您可以打开 `config.conf` 并将里面的 `whitelist` 设置改为 `false`
我们不建议这样做,但您可以打开 `config.yaml` 并将里面的 `whitelist` 设置改为 `false`

你必须删除(或重命名)SillyTavern 文件夹中的 `whitelist.txt` 文件(如果有的话)。

这通常是不安全的做法,所以我们要求在这样做时必须设置用户名和密码。

用户名和密码在`config.conf`文件中设置。
用户名和密码在`config.yaml`文件中设置。

重启 SillyTavern 服务后,只要知道用户名和密码,任何设备都可以访问。

### 还是无法访问?

*`config.conf` 文件中的端口创建一条入站/出站防火墙规则。切勿将此误认为是路由器上的端口转发,否则,有人可能会发现你的聊天隐私,那就大错特错了。
*`config.yaml` 文件中的端口创建一条入站/出站防火墙规则。切勿将此误认为是路由器上的端口转发,否则,有人可能会发现你的聊天隐私,那就大错特错了。
* 在 "设置" > "网络和 Internet" > "以太网" 中启用 "专用网络" 配置。这对 Windows 11 非常重要,否则即使添加了上述防火墙规则也无法连接。

### 性能问题?
Expand Down
10 changes: 5 additions & 5 deletions .github/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ By default, they will not be exposed to a frontend after you enter them and relo

In order to enable viewing your keys by clicking a button in the API block:

1. Set the value of `allowKeysExposure` to `true` in `config.conf` file.
1. Set the value of `allowKeysExposure` to `true` in `config.yaml` file.
2. Restart the SillyTavern server.

## Remote connections
Expand Down Expand Up @@ -211,7 +211,7 @@ CIDR masks are also accepted (eg. 10.0.0.0/24).

Now devices which have the IP specified in the file will be able to connect.

*Note: `config.conf` also has a `whitelist` array, which you can use in the same way, but this array will be ignored if `whitelist.txt` exists.*
*Note: `config.yaml` also has a `whitelist` array, which you can use in the same way, but this array will be ignored if `whitelist.txt` exists.*

### 2. Getting the IP for the ST host machine

Expand All @@ -237,19 +237,19 @@ Use http:// NOT https://

### Opening your ST to all IPs

We do not recommend doing this, but you can open `config.conf` and change `whitelist` to `false`.
We do not recommend doing this, but you can open `config.yaml` and change `whitelist` to `false`.

You must remove (or rename) `whitelist.txt` in the SillyTavern base install folder if it exists.

This is usually an insecure practice, so we require you to set a username and password when you do this.

The username and password are set in `config.conf`.
The username and password are set in `config.yaml`.

After restarting your ST server, any device will be able to connect to it, regardless of their IP as long as they know the username and password.

### Still Unable To Connect?

* Create an inbound/outbound firewall rule for the port found in `config.conf`. Do NOT mistake this for port-forwarding on your router, otherwise, someone could find your chat logs and that's a big no-no.
* Create an inbound/outbound firewall rule for the port found in `config.yaml`. Do NOT mistake this for port-forwarding on your router, otherwise, someone could find your chat logs and that's a big no-no.
* Enable the Private Network profile type in Settings > Network and Internet > Ethernet. This is VERY important for Windows 11, otherwise, you would be unable to connect even with the aforementioned firewall rules.

## Performance issues?
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public/stats.json
/uploads/
*.jsonl
/config.conf
/config.yaml
/config.conf.bak
/docker/config
.DS_Store
public/settings.json
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN \
echo "*** Create symbolic links to config directory ***" && \
for R in $RESOURCES; do ln -s "../config/$R" "public/$R"; done || true && \
\
ln -s "./config/config.conf" "config.conf" || true && \
ln -s "./config/config.yaml" "config.yaml" || true && \
ln -s "../config/settings.json" "public/settings.json" || true && \
ln -s "../../config/bg_load.css" "public/css/bg_load.css" || true && \
mkdir "config" || true
Expand Down
2 changes: 1 addition & 1 deletion Remote-Link.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo WARNING: Cloudflare Tunnel!
echo ========================================================================================================================
echo This script downloads and runs the latest cloudflared.exe from Cloudflare to set up an HTTPS tunnel to your SillyTavern!
echo Using the randomly generated temporary tunnel URL, anyone can access your SillyTavern over the Internet while the tunnel
echo is active. Keep the URL safe and secure your SillyTavern installation by setting a username and password in config.conf!
echo is active. Keep the URL safe and secure your SillyTavern installation by setting a username and password in config.yaml!
echo.
echo See https://docs.sillytavern.app/usage/remoteconnections/ for more details about how to secure your SillyTavern install.
echo.
Expand Down
57 changes: 0 additions & 57 deletions default/config.conf

This file was deleted.

53 changes: 53 additions & 0 deletions default/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# -- NETWORK CONFIGURATION --
# Listen for incoming connections
listen: true
# Server port
port: 8000
# Toggle whitelist mode
whitelistMode: true
# Whitelist of allowed IP addresses
whitelist:
- 127.0.0.1
# Toggle basic authentication for endpoints
basicAuthMode: false
# Basic authentication credentials
basicAuthUser:
username: user
password: password
# Enables CORS proxy middleware
enableCorsProxy: false
# Disable security checks - NOT RECOMMENDED
securityOverride: false
# -- ADVANCED CONFIGURATION --
# Open the browser automatically
autorun: true
# Disable thumbnail generation
disableThumbnails: false
# Thumbnail quality (0-100)
thumbnailsQuality: 95
# Allow secret keys exposure via API
allowKeysExposure: false
# Skip new default content checks
skipContentCheck: false
# Disable automatic chats backup
disableChatBackup: false
# API request overrides (for KoboldAI and Text Completion APIs)
## Format is an array of objects:
## - hosts:
## - example.com
## headers:
## Content-Type: application/json
requestOverrides: []
# -- PLUGIN CONFIGURATION --
# Enable UI extensions
enableExtensions: true
# Extension settings
extras:
# Disables automatic model download from HuggingFace
disableAutoDownload: false
# Extra models for plugins. Expects model IDs from HuggingFace model hub in ONNX format
classificationModel: Cohee/distilbert-base-uncased-go-emotions-onnx
captioningModel: Xenova/vit-gpt2-image-captioning
embeddingModel: Xenova/all-mpnet-base-v2
promptExpansionModel: Cohee/fooocus_expansion-onnx

16 changes: 8 additions & 8 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ for R in $RESOURCES; do
fi
done

if [ ! -e "config/config.conf" ]; then
echo "Resource not found, copying from defaults: config.conf"
cp -r "default/config.conf" "config/config.conf"
if [ ! -e "config/config.yaml" ]; then
echo "Resource not found, copying from defaults: config.yaml"
cp -r "default/config.yaml" "config/config.yaml"
fi

if [ ! -e "config/settings.json" ]; then
Expand All @@ -24,15 +24,15 @@ if [ ! -e "config/bg_load.css" ]; then
cp -r "default/bg_load.css" "config/bg_load.css"
fi

CONFIG_FILE="config.conf"
CONFIG_FILE="config.yaml"

if grep -q "listen = false" $CONFIG_FILE; then
echo -e "\033[1;31mThe listen parameter is set to false. If you can't connect to the server, edit the \"docker/config/config.conf\" file and restart the container.\033[0m"
if grep -q "listen: false" $CONFIG_FILE; then
echo -e "\033[1;31mThe listen parameter is set to false. If you can't connect to the server, edit the \"docker/config/config.yaml\" file and restart the container.\033[0m"
sleep 5
fi

if grep -q "whitelistMode = true" $CONFIG_FILE; then
echo -e "\033[1;31mThe whitelistMode parameter is set to true. If you can't connect to the server, edit the \"docker/config/config.conf\" file and restart the container.\033[0m"
if grep -q "whitelistMode: true" $CONFIG_FILE; then
echo -e "\033[1;31mThe whitelistMode parameter is set to true. If you can't connect to the server, edit the \"docker/config/config.yaml\" file and restart the container.\033[0m"
sleep 5
fi

Expand Down
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"vectra": "^0.2.2",
"write-file-atomic": "^5.0.1",
"ws": "^8.13.0",
"yaml": "^2.3.4",
"yargs": "^17.7.1",
"yauzl": "^2.10.0"
},
Expand Down
Loading

0 comments on commit a7024a1

Please sign in to comment.