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
除非适用法律要求或书面同意,否则根据许可证分发的软件均按“原样”分发,不带任何明示或暗示的保证或条件。请参阅许可证,了解许可证下管理权限和限制的特定语言。