minimalist web notepad
1.0.0
這是現已不存在的 notepad.cc 的開源克隆:「雲端中的一張紙」。
請參閱 https://notes.orga.cat 或 https://notes.orga.cat/whatever 上的示範。
確保允許 Web 伺服器寫入_tmp
目錄。
您可能需要在網站配置中啟用 mod_rewrite 並允許.htaccess
檔案。請參閱如何為 Apache 設定 mod_rewrite。
若要啟用 URL 重寫,請在設定檔中新增以下內容:
如果專案位於根目錄:
location / {
rewrite ^/([a-zA-Z0-9_-]+)$ /index.php?note=$1;
}
如果項目位於子目錄中:
location ~* ^/notes/([a-zA-Z0-9_-]+)$ {
try_files $uri /notes/index.php?note=$1;
}
如果 Nginx 中需要傳遞參數(如?raw
),則需要在$1
匹配的末尾加上&$args
:
location ~* ^/notes/([a-zA-Z0-9_-]+)$ {
try_files $uri /notes/index.php?note=$1&$args;
}
使用命令列介面,您可以儲存和檢索筆記。以下是一些使用curl
的範例:
檢索筆記的內容並將其儲存到本機檔案:
curl https://example.com/notes/test > test.txt
將特定文字儲存到註釋中:
curl https://example.com/notes/test -d 'hello,
welcome to my pad!
'
將本機檔案(例如/etc/hosts
)的內容儲存到註解中:
cat /etc/hosts | curl https://example.com/notes/hosts --data-binary @-
版權所有 2012 佩雷·奧爾加 [email protected]
根據 Apache 許可證 2.0 版(“許可證”)獲得許可;除非遵守許可,否則您不得使用本作品。您可以在以下位置取得許可證副本:
http://www.apache.org/licenses/LICENSE-2.0
除非適用法律要求或書面同意,否則根據許可證分發的軟體均以「原樣」分發,不帶任何明示或暗示的保證或條件。請參閱許可證,了解許可證下管理權限和限制的特定語言。