{"id":22859174,"url":"https://github.com/skyone-wzw/blog-server","last_synced_at":"2025-04-30T17:45:40.392Z","repository":{"id":246613767,"uuid":"738045423","full_name":"skyone-wzw/blog-server","owner":"skyone-wzw","description":"A Blog server. tailwind \u0026 next.js. Fediverse comment support.","archived":false,"fork":false,"pushed_at":"2025-03-22T13:20:21.000Z","size":11066,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T18:34:20.696Z","etag":null,"topics":["activitypub","blog","blog-engine","cms","fediverse","markdown","nextjs"],"latest_commit_sha":null,"homepage":"https://blog-server.akk.moe","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skyone-wzw.png","metadata":{"files":{"readme":"README.en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-02T09:35:37.000Z","updated_at":"2025-03-22T13:19:25.000Z","dependencies_parsed_at":"2024-06-29T04:40:56.682Z","dependency_job_id":"43e9e50e-9475-480b-a7ed-489755affb84","html_url":"https://github.com/skyone-wzw/blog-server","commit_stats":null,"previous_names":["skyone-wzw/blog-server"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyone-wzw%2Fblog-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyone-wzw%2Fblog-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyone-wzw%2Fblog-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyone-wzw%2Fblog-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyone-wzw","download_url":"https://codeload.github.com/skyone-wzw/blog-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251754034,"owners_count":21638431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activitypub","blog","blog-engine","cms","fediverse","markdown","nextjs"],"created_at":"2024-12-13T09:06:15.839Z","updated_at":"2025-04-30T17:45:40.375Z","avatar_url":"https://github.com/skyone-wzw.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blog-Server\n\n![License](https://img.shields.io/github/license/skyone-wzw/blog-server) ![GitHub Release](https://img.shields.io/github/v/release/skyone-wzw/blog-server)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"README.md\"\u003e中文文档\u003c/a\u003e | English\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eA simple blog server. Based on Node.js, Next.js and SQLite.\u003c/p\u003e\n\n![preview](previews/preview01.en.png)\n\n[MORE PREVIEWS](#more-previews)\n\n\u003e The project name has not been determined yet, maybe you can give me some suggestions?\n\n## Features\n\n* [x] Support WebFinger, [ActivityPub](https://en.wikipedia.org/wiki/ActivityPub) [Federated](https://en.wikipedia.org/wiki/Federation_(information_technology)) comment system (disabled by default)\n* [x] Support GFM (GitHub Flavored Markdown)\n* [x] Online editing articles\n* [x] React Server Components\n* [x] Multi-language support (based on `next-intl`)\n* [x] Docker quick deployment\n* [x] Custom website in the admin panel\n* [x] Online upload custom cover\n* [ ] Global search\n\nThere are many features that have not been implemented yet, but it has reached the level of normal use. Suggestions and code contributions are welcome. The database part should not have backward compatibility issues, but the configuration file and environment variables may change.\n\n**Note:** The master branch is the development branch, which may have problems such as unable to run, incompatible database changes, etc. Please use the Release version.\n\n~~Regarding memory usage, due to the use of Node.js and no special optimization\n(lazy + don't know + for simple deployment), it is naturally incomparable with\ncompiled languages. About 220MB in idle state, and about 20MB additional usage\nwhen rendering an article with 30,000 words containing a large number of mathematical\nformulas (only the first rendering, less than 1 second), so a blog with small\ntraffic generally uses 300MB.~~\n\nAfter several radical optimizations of the rendering logic, both memory usage\nand rendering speed have been significantly improved, and the loss caused by\nreal-time rendering can be ignored.\n\n## Quick Start\n\n### Run using Docker\n\nDownload `docker-compose.yml` to your local\n\n```shell\nwget https://raw.githubusercontent.com/skyone-wzw/blog-server/master/docker-compose.yml\n```\n\nEdit environment variables (no need to modify for local testing)\n\n* `DATABASE_URL`: Database file path, default is `file:./data/data.db`\n* `DATA_DIR`: Data directory, default is `./data`\n* `SECRET_KEY`: AES encryption key, required, a string of length 32\n* `SECRET_IV`: AES encryption vector, required, a string of length 16\n* `AUTH_EMAIL`: Backend login email, required\n* `AUTH_PASSWORD`: Backend login password, required\n\n```shell\ndocker-compose up -d\n```\n\nOpen your browser and visit `http://localhost:3000`.\n\n### Download precompiled version from Release\n\nDownload the latest precompiled version from [Release](https://github.com/skyone-wzw/blog-server/releases). Unzip to any directory, synchronize the database and start the server:\n\n```shell\nnpm prisma generate\nnpm run start\n```\n\nOpen your browser and visit `http://localhost:3000`.\n\n### Build from source\n\nClone the repository and install dependencies\n\n```shell\ngit clone https://github.com/skyone-wzw/blog-server.git --depth=1\ncd blog-server\nnpm install\n```\n\nBuild the project\n\n```shell\nnpx prisma generate\nnpm run run patch-font\nnpm run build\n```\n\nCreate work dir and copy the necessary files\n\n```shell\ncp -r .next/standalone build\ncp -r .next/static build/.next/static\ncp -r public build/public\n```\n\nThen flow the steps in [Download precompiled version from Release](#download-precompiled-version-from-release).\n\n## Configuration\n\nThere are two configuration files: `.env` and `data/config.json`. Other custom content\n(such as website title, logo, author, etc.) can be set in the website backend.\n\n### Environment variables\n\nYou can set the data directory and database file path in the `.env` file\n(located in the project root directory), the environment variables written\nto this file will be automatically loaded, of course, setting environment\nvariables directly is also possible.\n\n```ini\n# Required\nDATABASE_URL=\"file:./data/data.db\"\n\n# Optional, default is ./data\nDATA_DIR=./data\n\n# Optional, you can set it in data/config.json\nSECRET_KEY=\"12345678123456781234567812345678\"\nSECRET_IV=\"1234567812345678\"\nAUTH_EMAIL=abc@example.com\nAUTH_PASSWORD=123456\n```\n\n### Configure file\n\nThe `data/config.json` file (the data directory is specified by the environment variable `DATA_DIR`) is an alternative to environment variables. If you don't want to use environment variables, you can also choose a configuration file. But in any case, you must set the `DATABASE_URL` environment variable.\n\n**Note: Environment variables take precedence over configuration files.**\n\nRefer to the following example, all options are optional\n\n```json\n{\n  \"auth\": {\n    \"email\": \"\",\n    \"password\": \"\"\n  },\n  \"secret\": {\n    \"key\": \"\",\n    \"iv\": \"\"\n  },\n  \"dir\": {\n    \"data\": \"./data\",\n    \"image\": \"./data/post\",\n    \"cover\": \"./data/cover\",\n    \"random\": \"./data/cover/random\",\n    \"custom\": \"./data/custom\",\n    \"cache\": \"./data/cache\"\n  }\n}\n```\n\n\u003e Environment variables take precedence over configuration files, and environment\n\u003e variables are read after loading the configuration file, but `DATA_DIR` is\n\u003e an exception because the location of the configuration file is also determined by `DATA_DIR`.\n\u003e \n\u003e In short, the configuration file is located at `$DATA_DIR/config.json`,\n\u003e and environment variables take precedence over the configuration file.\n\n### Configuration item description\n\nIn environment variables:\n\n* `DATA_DIR`: Data directory\n* `DATABASE_URL`: Database file path, format is `file:/path/to/database.db`\n* `SECRET_KEY`: AES encryption key\n* `SECRET_IV`: AES encryption vector\n* `AUTH_EMAIL`: Backend login email\n* `AUTH_PASSWORD`: Backend login password\n\nIn configuration file:\n\n* `auth.email`: Backend login email\n* `auth.password`: Backend login password\n* `secret.key`: AES encryption key\n* `secret.iv`: AES encryption vector\n* `dir.data`: Data directory, it is recommended to use the environment variable `DATA_DIR`\n* `dir.image`: Image directory\n* `dir.cover`: Cover directory\n* `dir.random`: Random cover directory\n* `dir.custom`: Custom directory\n* `dir.cache`: Cache directory\n\n## Article cover background image\n\nBy default, the article cover background image is random. You can put your image\nin the `data/cover/random` directory. The image with the path `data/cover/[slug].(jpg|png|webp)`\nwill be used as the cover of the corresponding article. The specific matching rules are as follows:\n\n1. Find `data/cover/[slug].(jpg|png|webp)`, if it exists, use it, if there are multiple formats, randomly select one\n2. Find `data/cover/random/`, if it exists, randomly select one\n3. If no image is found when the program starts, create `data/cover/random/default.webp` as the default image\n\n\n## More Previews\n\n![preview02](previews/preview02.en.png)\n\n![preview03](previews/preview03.en.png)\n\n![preview04](previews/preview04.en.png)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyone-wzw%2Fblog-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyone-wzw%2Fblog-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyone-wzw%2Fblog-server/lists"}