設定 Plume

如果你使用 PostgreSQL,你需要為 Plume 建立一個資料庫

service postgresql start
su - postgres
createuser -d -P plume
createdb -O plume plume

在啟用 Plume 前你需要建立一個設定檔案叫做 .env 該檔案應該與您將啟動 Plume 的目錄位於同一目錄中(~/Plume,如果您有按照前面的說明進行操作)。 如果你是以原始碼安裝, 你可以使用 cp .env.sample .env 來產生它。 以下是您應該放入 GNU/LinuxMac OS X 系統的範例

# The address of the database
# (replace USER, PASSWORD, PORT and DATABASE_NAME with your values)
#
# If you are using SQlite, use the full path of the database file (`plume.db` for instance)
# Windows user's paths are backslashes, change them to forward slashes
#DATABASE_URL=/etc/path/to/Plume/plume.db
DATABASE_URL=postgres://USER:PASSWORD@IP:PORT/DATABASE_NAME

# For PostgreSQL: migrations/postgres
# For SQlite: migrations/sqlite
MIGRATION_DIRECTORY=migrations/postgres

# The domain on which your instance will be available
BASE_URL=plu.me

# Secret key used for private cookies and CSRF protection
# You can generate one with `openssl rand -base64 32`
ROCKET_SECRET_KEY=

# Mail settings
# If you don't want to setup a mail server and/or address for plume
# and don't plan to use the "password reset" feature,
# you can comment these lines.
MAIL_SERVER=smtp.example.org
MAIL_USER=example
MAIL_PASSWORD=123456
MAIL_HELO_NAME=example.org
MAIL_ADDRESS=from@example.org

更多有關資訊你可以參閱放入 .env 中的 the documentation about environment variables

現在我們需要運行migrations Migrations 是用於資料庫更新的指令腳本 要運行 migrations 你可以在 GNU/Linux and Mac OS X上執行:

plm migration run

如果你是使用 Windows 和 DATABASE of sqlite,你會需要複製 sqlite3.dll from “C:\ProgramData\chocolatey\lib\SQLite\tools” 去編譯 plm.exe and plume.exe: copy "C:\ProgramData\chocolatey\lib\SQLite\tools\sqlite3.dll" "C:\Users\%USERNAME%\.cargo\bin\sqlite3.dll"

現在你可以運行 migrations: plm migration run

Migrations 應該在每次更新後運行 如有疑問,請運行它們

你還需要初始化搜尋引擎

plm search init

之後,您需要安裝實例和設定管理員帳戶。

plm instance new
plm users new --admin

請注意,如果你想使用 LDAP:你仍然應該建立一個管理員帳戶,至少要在您自己的 LDAP 帳戶註冊後給予管理員權限。

Windows 上,建立管理員帳戶時可能會出錯。 要解決這個問題你需要運行: plm users new --admin -n "adminusername" -N "Human Readable Admin Name" -b "Biography of Admin here" -p hackmeplease

更多資訊關於命令的資訊,以及你可以為它們提供的參數, 查看 their documentation

現在 Plume 已經設定好了,如果你在作業環境中,你可能 想要設定你的 init 系統以使其更易於管理。

設定初始系統