更新 Service:Coder
+28
-1
@@ -13,5 +13,32 @@ echo 'export CODER_HTTP_ADDRESS=0.0.0.0:3000' >> ~/.bashrc && source ~/.bashrc
|
|||||||
# 啟動 Coder 服務
|
# 啟動 Coder 服務
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
systemctl enable --now coder@coder
|
systemctl enable --now coder
|
||||||
|
```
|
||||||
|
|
||||||
|
# 使用
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo -u postgres psql
|
||||||
|
```
|
||||||
|
|
||||||
|
新建使用者與資料庫
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE USER coder WITH PASSWORD 'coder';
|
||||||
|
|
||||||
|
CREATE DATABASE coder;
|
||||||
|
```
|
||||||
|
|
||||||
|
設定資料庫權限
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- 1. Give ownership of the database to the app user
|
||||||
|
ALTER DATABASE coder OWNER TO coder;
|
||||||
|
|
||||||
|
-- 2. Give ownership of the public schema to the app user
|
||||||
|
ALTER SCHEMA public OWNER TO coder;
|
||||||
|
|
||||||
|
-- 3. Ensure the user has create permissions (Crucial for Postgres 15+)
|
||||||
|
GRANT USAGE, CREATE ON SCHEMA public TO coder;
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user