getnote.top 轻量的云笔记本 - 类notepad.cc网站的搭建

notepad.cc 是一个简洁好用的文本分享网站,特别适用于跨设备快速传输一些文本内容。但 notepad.cc 早已关闭,而且与之相似的 notepad.live 近期似乎也无法访问了。于是我在GitHub上找到的类似的开源项目,部署到了服务器上并绑定了域名 getnote.top 。

如果你想使用 getnote.top ,请先查看说明

开源项目地址:Minimalist Web Notepad - GitHub

原 "getnote.cf"已将域名将变更为 "getnote.top" ,请各位用户使用新域名访问此网站,并修改已保存的浏览器书签,或相关记录。*


安装步骤

安装步骤其实相当简单,只要服务器已经搭建了PHP运行环境即可(此项目无需数据库)。

  1. 将源码解压至网站根目录
  2. 修改 index.php 文件里的 $base_url ,确保 _tmp 文件夹的写入权限
    如何修改写入权限:使用 chown 命令修改文件夹权限;或直接将 _tmp 文件夹改为"777"权限。
  3. 配置好 Apache 或 Nginx 的 url rewrite

官方说明文档 中的安装步骤如下:

Installation

At the top of index.php file, change $base_url variable to point to your site.

Make sure the web server is allowed to write to the _tmp directory.

On Apache

You may need to enable mod_rewrite and set up .htaccess files in your site configuration.
See How To Set Up mod_rewrite for Apache.

On Nginx

To enable URL rewriting, put something like this in your configuration file:

If notepad is in the root directory:

1
2
3
location / {
rewrite ^/([a-zA-Z0-9]+)$ /index.php?f=$1;
}

If notepad is in a subdirectory:

1
2
3
location ~* ^/notes/(\w+)$ {
try_files $uri /notes/index.php?f=$1;
}

更多事项

  1. 目前此项目的功能相当简单,未来我可能会作更多改进或增加不同功能
  2. getnote.cf 属于 .cf 免费域名,暂不保证此域名能够长久使用,本文只是分享该网站的搭建过程
  3. 若此域名过期,我将更新本文并在文中告知
  4. 于2022年11月11日,网站域名已正式更换为付费域名 getnote.top

参考资料