mysql --execute=" CREATE DATABASE IF NOT EXISTS bookstackdb DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL PRIVILEGES ON bookstackdb.* TO 'bookstackuser'@'localhost' IDENTIFIED BY 'bookstackpass' WITH GRANT OPTION; FLUSH PRIVILEGES; quit"
# Set root password DB_ROOT=$(cat /dev/urandom | tr -cd'A-Za-z0-9' | head -c 14) echo"MariaDB root:${DB_ROOT}" >> TMPROOTPWD && cat $TMPROOTPWD # mysqladmin -u root password ${DB_ROOT} mysql -e "SET PASSWORD FOR root@localhost = PASSWORD('${DB_ROOT}');FLUSH PRIVILEGES;"
### PHP-FPM setup ############################################################################################################### echo -e "\n${jaune}PHP-FPM configuration ...${rescolor}" && sleep 1 fpmconf=/etc/php-fpm.d/www.conf sed -i "s|^listen =.*$|listen = /var/run/php-fpm.sock|"$fpmconf sed -i "s|^;listen.owner =.*$|listen.owner = nginx|"$fpmconf sed -i "s|^;listen.group =.*$|listen.group = nginx|"$fpmconf sed -i "s|^user = apache.*$|user = nginx ; PHP-FPM running user|"$fpmconf sed -i "s|^group = apache.*$|group = nginx ; PHP-FPM running group|"$fpmconf sed -i "s|^php_value\[session.save_path\].*$|php_value[session.save_path] = ${VARWWW}/sessions|"$fpmconf
# Clone the latest from the release branch git clone https://github.com/BookStackApp/BookStack.git --branch release --single-branch ${BOOKSTACK_DIR}
# let composer do it's things cd /usr/local/bin curl -sS https://getcomposer.org/installer | php mv composer.phar composer cd${BOOKSTACK_DIR} composer install
# Config file injection cp .env.example .env sed -i "s|^DB_DATABASE=.*$|DB_DATABASE=bookstackdb|" .env sed -i "s|^DB_USERNAME=.*$|DB_USERNAME=bookstackuser|" .env sed -i "s|^DB_PASSWORD=.*$|DB_PASSWORD=bookstackpass|" .env sed -i "s|^MAIL_PORT=.*$|MAIL_PORT=25|" .env
# Set in French if locale is FR lang=$(locale | grep LANG | cut -d= -f2 | cut -d_ -f1) if [[ $lang -eq "fr" ]]; then sed -i "s|^# Application URL.*$|APP_LANG=fr\n# Application URL|" .env fi
# Generate and update APP_KEY in .env php artisan key:generate --force
# Generate database tables and other settings php artisan migrate --force
# Application key:Used for encryption where needed. # Run `php artisan key:generate` to generate a valid key. # The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths 16 . # APP_KEY=base64:v2qr11Dmf+wWw9j6j09udZPhSHJHw9lZ2xA7dz24YPA= EOF
$docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2ff08e960aa2 linuxserver/bookstack "/init" 5 hours ago Up 5 hours 443/tcp, 0.0.0.0:9000->80/tcp bookstack 5b8d5dd33af0 linuxserver/mariadb "/init" 5 hours ago Up 5 hours 3306/tcp bookstack_db
#Nginx # By default indexes are disabled on Nginx but if you have them enabled # add this to your BookStack server block location /uploads { autoindex off; }
# The LDAP host, Adding a port is optional LDAP_SERVER=example.com:389 # If using LDAP over SSL you should also define the protocol: # LDAP_SERVER=ldaps://example.com:636
# The base DN from where users will be searched within LDAP_BASE_DN=ou=People,dc=example,dc=com
# The full DN and password of the user used to search the server # Can both be left as false to bind anonymously(否则匿名访问|注意DN需要输入完整的cn=admin + LDAP_BASE_DN) LDAP_DN=false LDAP_PASS=false
# A filter to use when searching for users # The user-provided user-name used to replace any occurrences of '${user}' LDAP_USER_FILTER=(&(uid=\${user}))
# Set the LDAP version to use when connecting to the server LDAP_VERSION=3.0
# Set the property to use as a unique identifier for this user. # Stored and used to match LDAP users with existing BookStack users. # Prefixing the value with 'BIN;' will assume the LDAP service provides the attribute value as # binary data and BookStack will convert the value to a hexidecimal representation. # Defaults to 'uid'. LDAP_ID_ATTRIBUTE=uid
# Set the default 'email' attribute. Defaults to 'mail' LDAP_EMAIL_ATTRIBUTE=mail
# Set the property to use for a user's display name. Defaults to 'cn' LDAP_DISPLAY_NAME_ATTRIBUTE=cn
# If you need to allow untrusted LDAPS certificates, add the below and uncomment (remove the #) # Only set this option if debugging or you're absolutely sure it's required for your setup. #LDAP_TLS_INSECURE=true
# If you need to debug the details coming from your LDAP server, add the below and uncomment (remove the #) # Only set this option if debugging since it will block logins and potentially show private details. #LDAP_DUMP_USER_DETAILS=true
<script> //#文件上传超时 //#BookStack 中的文件上载使用默认上传超时为 60 秒的 JavaScript 库 //#Set the file upload timeout to 120 seconds. //#You can change '120' to be the number of seconds you want the timeout to be. window.uploadTimeout = 120 * 1000; //#文件上传限制 //#BookStack 中的文件上传使用默认上载大小限制为 256MB 的 JavaScript 库。 //#Set the file upload limit to 1.5GB. //#The value is defined in MB. window.uploadLimit = 1500; </script>
# Create a new admin user php artisan bookstack:create-admin
# Delete all activity history from the system php artisan bookstack:clear-activity
# Delete all page revisions from the system php artisan bookstack:clear-revisions
# Delete all page revisions from the system including update drafts php artisan bookstack:clear-revisions -a
# Delete all page views from the system php artisan bookstack:clear-views
# Search and remove images that are not used in page content php artisan bookstack:cleanup-images
# Generate SQL commands that will upgrade the database to UTF8mb4 # See https://www.bookstackapp.com/docs/admin/ut8mb4-support/ php artisan bookstack:db-utf8mb4
# Rebuild the search index # Useful if manually inserting pages into the system php artisan bookstack:regenerate-search
# Regenerate access permissions - Used mostly in development php artisan bookstack:regenerate-permissions
# Delete all users from the system that are not "admin" or system users php artisan bookstack:delete-users
# Copy the permission settings of a specified, or all, shelf to their child books php artisan bookstack:copy-shelf-permissions --all php artisan bookstack:copy-shelf-permissions --slug=my_shelf_slug
# Update a URL in the database content of your BookStack instance. # Searches for <oldUrl> and replaces it with <newUrl> php artisan bookstack:update-url <oldUrl> <newUrl> # Example: php artisan bookstack:update-url http://docs.example.com https://demo.bookstackapp.com
# Regenerate the stored HTML content for comments from their original text content php artisan bookstack:regenerate-comment-content
0x04 补充说明
1.离线迁移图片路径处理
1 2 3 4 5
--- (1) 查看那些图片路径为 10.10.107.202 服务器的信息进行更改 SELECT * from pages WHERE html like"%10.10.107.202%"
--- (2) 替换服务器路径为wiki.weiyigeek.top UPDATE pages set html = REPLACE(html,"10.10.107.202","wiki.weiyigeek.top");
方式1.请访问本博主的B站【WeiyiGeek】首页关注UP主, 将自动随机获取解锁验证码。
Method 2.Please visit 【My Twitter】. There is an article verification code in the homepage.
方式3.扫一扫下方二维码,关注本站官方公众号
回复:验证码
将获取解锁(有效期7天)本站所有技术文章哟!