Skip to content

Commit

Permalink
fix typo3
Browse files Browse the repository at this point in the history
  • Loading branch information
chendelin1982 authored Jan 8, 2024
1 parent 5801b1e commit ea22f80
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
4 changes: 3 additions & 1 deletion apps/typesense/.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ W9_HTTP_PORT_SET=8109
W9_URL="yourdomain.com"
W9_NETWORK=websoft9

W9_LOGIN_API_KEY=f324f596-f07b-${W9_POWER_PASSWORD}
# Don't use W9_POWER_PASSWORD for api_key
# Some special strings can not used for api, suggest user get key by command [openssl rand -base64 24]
W9_LOGIN_API_KEY=cJ9XqddokC3OCRdx1SFQRv+uFj5QHYOT
#### --------------------------------------------------------------------------------------- ####


Expand Down
8 changes: 8 additions & 0 deletions apps/typesense/Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

[Typesense](https://typesense.org/)是一款开源搜索工具,是Algolia 或者大型搜索ElasticSearch 的替代方案

测试范例:

```
curl "http://URL/collections" -H "X-TYPESENSE-API-KEY: f324f596-f07b-XP7bz4lUmA@Ln6XH"
```

> URL 是域名或 IP:port
## 容器介绍

本项目涉及到两个容器typesense和typesense-scraper
Expand Down
27 changes: 16 additions & 11 deletions apps/typo3/cmd.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
#!/bin/bash
# customrized cmd powered by Websoft9
# customized cmd powered by Websoft9

echo $TYPO3_DB_USER
echo "TYPO3 DB User: $TYPO3_DB_USER"
if [[ -f /var/www/html/wizard ]]; then
echo "Initialization has been completed before this time!"
else
echo "" >> /var/www/html/wizard
sed -i s/127.0.0.1/mysql/g /var/www/html/typo3_src-11.5.12/typo3/sysext/install/Classes/Controller/InstallerController.php
cat InstallerController.php |grep username|grep TYPO3_CONF_VARS| awk '{print $NF}'
cat InstallerController.php |grep username|grep TYPO3_CONF_VARS| awk '{print $NF}'

sed -i "s/\['user'\] ?? ''/['user'] ?? '$TYPO3_DB_USER'/" /var/www/html/typo3_src-11.5.14/typo3/sysext/install/Classes/Controller/InstallerController.php
sed -i "s/\['password'\] ?? ''/['password'] ?? '$TYPO3_DB_PASSWORD'/" /var/www/html/typo3_src-11.5.14/typo3/sysext/install/Classes/Controller/InstallerController.php
sed -i "s/\['host'\] ?? '127.0.0.1'/['host'] ?? '$TYPO3_DB_HOST'/" /var/www/html/typo3_src-11.5.14/typo3/sysext/install/Classes/Controller/InstallerController.php
# 标记初始化已完成
touch /var/www/html/wizard

# 定义 InstallerController.php 文件的路径模式
installer_pattern="/var/www/html/typo3_src-*/typo3/sysext/install/Classes/Controller/InstallerController.php"

# 使用定义的路径模式查找文件,并对每个文件执行 sed 替换
find /var/www/html -type f -path "$installer_pattern" -exec sed -i "s/127.0.0.1/mysql/g" {} \;
find /var/www/html -type f -path "$installer_pattern" -exec sed -i "s/\['user'\] ?? ''/\['user'\] ?? '$TYPO3_DB_USER'/" {} \;
find /var/www/html -type f -path "$installer_pattern" -exec sed -i "s/\['password'\] ?? ''/\['password'\] ?? '$TYPO3_DB_PASSWORD'/" {} \;
find /var/www/html -type f -path "$installer_pattern" -exec sed -i "s/\['host'\] ?? '127.0.0.1'/\['host'\] ?? '$TYPO3_DB_HOST'/" {} \;
fi
docker-php-entrypoint apache2-foreground

# 启动 Apache
docker-php-entrypoint apache2-foreground
2 changes: 1 addition & 1 deletion apps/typo3/variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"dist": "community",
"version": [
"12.4.8",
"12.4",
"latest"
]
}
Expand Down

0 comments on commit ea22f80

Please sign in to comment.