增加網站安全性
建議於網站根目錄放上 .htaccess
使所有 http 連線導向 https

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Continue reading...

沉寂了幾年沒有動靜的 Codeigniter 於前兩年重新復活,並且發表了 Codeigniter 4,更貼近現在 MVC 架構。
許多僅需要撰寫小型專案時,輕量且可快速建置的 Codeigniter 是不錯的選擇。

建置環境基本需求:

  1. PHP 7.4+
  2. Extensions: intl , mbstring , json

step1 使用 PHP Composer 安裝

composer create-project codeigniter4/appstarter project-root

step 2 env 檔基本設定
將專案的根目錄底下的 env...

Continue reading...

Install Python and python-venv:

sudo apt install python3-venv

Create a virtual environment to run your Flask project:

cd /home/username
python3 -m venv project_name

Install Gunicorn, Flask and other requirements:

source project_name/bin/activate
pip install wheel
pip install gunicorn flask...

Continue reading...

Flat File CMS 輕快且容易使用,唯一缺憾就是沒有比較好的評論系統。
最近研究 open source comment system,找到了 remark42 。
Remark42 不追蹤使用者紀錄,可 Google、Facebook、Github 等平台登入,也可單純用 email 或匿名留言。
系統只要簡單指令或 Docker 即可立即建構完成。

分享一下配置檔,也許可以給其他人設置上作為參考。
(沒有串接其他社群平台,僅開放以 email 方式登入留言)

docker-compose.yaml

version: "2"

services:
  remark...

Continue reading...

Update the packages index and install the dependencies:

sudo apt update
sudo apt install gnupg2 software-properties-common apt-transport-https curl

Import the Microsoft GPG key:

curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

Add the Visual Studio Code reposi...

Continue reading...