commit d9bda755d13af496a3217bfec31deb868a579164 Author: Laysense Web Date: Sat Nov 21 17:29:12 2026 +0800 Rebuild Laysense site with Webman and SQLite CMS diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62f9980 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/vendor/ +/runtime/ +/storage/* +!/storage/.gitignore +/.env +/.taste-skill/ +/shots/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..79893ee --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# 来笙 Laysense 官网 + +PHP Webman、原生 CSS 和 SQLite 实现的来笙官网。公开页面由服务端渲染,菜单和 CMS 编辑工具使用原生 JavaScript。运行时只依赖 PHP、Composer 依赖和本机 SQLite 文件。 + +## 本地启动 + +需要 Linux、PHP 8.2+ CLI、Composer 2,以及启用 `pcntl`、`posix`、`pdo_sqlite`、`dom` 和 `mbstring` 的 PHP 环境。 + +```sh +composer install +php bin/install.php +php bin/admin.php admin@example.com +LAYSENSE_SECURE_COOKIES=0 php start.php start +``` + +打开 `http://127.0.0.1:8787`。后台入口为 `/admin`。创建管理员命令会交互读取密码,对同一邮箱再次执行会轮换密码并使旧会话失效。本地 HTTP 测试时关闭 Secure Cookie,生产 HTTPS 环境使用默认设置。 + +## 后台编辑 + +- **页面**可修改首屏标题、简介、图片、按钮,以及每页的 SEO 标题和描述。页面正文按区块编辑,支持受限 HTML 和预览。 +- **文章与动态**使用 Markdown,支持正文预览、摘要、标签和公告、新闻、产品分类。状态选「草稿」可撤回公开文章。已发布文章改网址标识后,旧标识会自动跳转。 +- 首页动态、分类列表和站点地图随发布状态更新。源代码和 SQLite 数据分开管理。安装命令可重复执行,已编辑的内容会保留。 + +## 生产运行 + +1. 以运行服务的用户执行 `composer install --no-dev --optimize-autoloader`、`php bin/install.php` 和管理员创建命令。 +2. 通过 systemd 或其他进程管理器以前台命令 `php start.php start` 运行。默认监听 `127.0.0.1:8787`。 +3. 由 Nginx 等反向代理处理 `laysense.cn` 的 HTTPS,并将请求转发给 Webman。项目根目录保持在公共站点根目录之外。 + +下面的 Nginx 片段可放入现有 HTTPS 虚拟主机。 + +```nginx +location / { + proxy_pass http://127.0.0.1:8787; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + client_max_body_size 2m; +} +``` + +| 环境变量 | 默认值与用途 | +| --- | --- | +| `LAYSENSE_SITE_URL` | `https://laysense.cn` · canonical、分享链接和站点地图的正式站点地址 | +| `LAYSENSE_LISTEN` | `http://127.0.0.1:8787` · Webman 监听地址 | +| `LAYSENSE_WORKERS` | `2` · Webman worker 数量 | +| `LAYSENSE_DB` | `storage/laysense.sqlite` · SQLite 文件路径。生产可指向独立的持久化目录 | +| `LAYSENSE_SECURE_COOKIES` | 默认启用 · 本地 HTTP 测试设为 `0` | +| `LAYSENSE_TRUSTED_PROXIES` | 默认空 · 逗号分隔的受信反代 IP。使用上述 Nginx 片段时可设为 `127.0.0.1` | + +SQLite 已启用 WAL。迁移服务器或做线上备份时,可用 `sqlite3 storage/laysense.sqlite ".backup 'laysense-backup.sqlite'"` 取得一致备份。更新代码时保留数据库文件及其存放目录。服务用户需要对 SQLite 目录和 `runtime/` 有写权限。 + +## 迁移范围 + +- 保留 `/`、`/pagepan`、`/highspeaker`、`/sc`、`/shnu-sc`。旧的动态、分类、标签和已知公告地址通过 301 跳转。SEO 包含 canonical、Open Graph、面包屑与文章结构化数据、XML sitemap 和 robots.txt。 +- 迁移五页可获取的产品和服务说明、价格、机构信息、问答、对比表、微信二维码和四段 PAGEPAN 演示视频。LayFi 的原始标志地址返回 404,页面保留项目名称和原有站点链接。 +- 旧站 2024 年 11 月 10 日关于减少全球服务器部署的公告返回空白正文。迁移保留标题、日期、标签和旧链接,正文补录前会标记为不索引。 +- SHNU 旧页首屏写 ¥69,详细报价表与正文写 ¥66。新版保留报价表中的 ¥66,并保留旧页学生资格及学分说明。两处普通软著页面的咨询按钮现在直达该页既有的企业微信入口。 +- 中文公开页复用页头、页尾、首屏、内容区块、动态列表及同一套 CSS。历史迁移内容见 `resources/seed.json`,结构见 `resources/schema.sql`。 diff --git a/app/Content/Database.php b/app/Content/Database.php new file mode 100644 index 0000000..159c7fe --- /dev/null +++ b/app/Content/Database.php @@ -0,0 +1,104 @@ + PDO::FETCH_ASSOC]); + $pdo->exec('PRAGMA busy_timeout = 5000'); + $pdo->exec('PRAGMA foreign_keys = ON'); + self::$connection = $pdo; + + return $pdo; + } + + public static function initialize(): void + { + $root = dirname(__DIR__, 2); + $seed = json_decode(file_get_contents($root . '/resources/seed.json'), true, flags: JSON_THROW_ON_ERROR); + $pdo = self::connect(); + $pdo->exec('PRAGMA journal_mode = WAL'); + + self::write(function (PDO $pdo) use ($root, $seed): void { + $pdo->exec(file_get_contents($root . '/resources/schema.sql')); + $site = $pdo->prepare('INSERT OR IGNORE INTO site_settings (id, payload) VALUES (1, ?)'); + $site->execute([self::json($seed['site'])]); + + $pageQuery = $pdo->prepare('INSERT OR IGNORE INTO pages + (slug, name, title, description, heading, accent, lead, image, alt, actions, quicklinks, partners) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); + $sectionQuery = $pdo->prepare('INSERT OR IGNORE INTO sections + (page_slug, key, title, lead, style, body, position) VALUES (?, ?, ?, ?, ?, ?, ?)'); + foreach ($seed['pages'] as $page) { + $pageQuery->execute([ + $page['slug'], $page['name'], $page['title'], $page['description'], $page['heading'], + $page['accent'], $page['lead'], $page['image'], $page['alt'], + self::json($page['actions']), self::json($page['quicklinks']), self::json($page['partners'] ?? []), + ]); + if ($pageQuery->rowCount() !== 1) { + continue; + } + foreach ($page['sections'] as $index => $section) { + $sectionQuery->execute([ + $page['slug'], $section['key'], $section['title'], $section['lead'], + $section['style'], Html::sanitize($section['body']), $index, + ]); + } + } + + $article = $pdo->prepare('INSERT OR IGNORE INTO articles + (slug, title, category, summary, body, tags, status, published_at, updated_at, legacy_path) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); + foreach ($seed['articles'] as $item) { + $exists = $pdo->prepare('SELECT 1 FROM article_redirects WHERE slug = ?'); + $exists->execute([$item['slug']]); + if ($exists->fetchColumn()) { + continue; + } + $article->execute([ + $item['slug'], $item['title'], $item['category'], $item['summary'], $item['body'], + self::json($item['tags']), $item['status'], $item['date'], $item['date'], $item['legacy'], + ]); + } + }); + } + + public static function write(callable $operation): mixed + { + $pdo = self::connect(); + $pdo->exec('BEGIN IMMEDIATE'); + try { + $result = $operation($pdo); + $pdo->exec('COMMIT'); + + return $result; + } catch (Throwable $error) { + $pdo->exec('ROLLBACK'); + throw $error; + } + } + + public static function json(array $data): string + { + return json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR); + } +} diff --git a/app/Content/Html.php b/app/Content/Html.php new file mode 100644 index 0000000..3ba1497 --- /dev/null +++ b/app/Content/Html.php @@ -0,0 +1,97 @@ + ['href'], 'article' => [], 'b' => [], 'blockquote' => [], 'br' => [], + 'caption' => [], 'code' => [], 'dd' => [], 'details' => [], 'div' => ['role', 'aria-label', 'tabindex'], + 'dl' => [], 'dt' => [], 'em' => [], 'h3' => [], 'h4' => [], 'h5' => [], 'hr' => [], 'i' => [], + 'img' => ['src', 'alt', 'loading', 'width', 'height'], 'label' => ['for'], + 'li' => [], 'ol' => [], 'p' => [], 'pre' => [], 'progress' => ['max', 'value'], 's' => [], + 'small' => [], 'source' => ['src', 'type'], 'span' => [], 'strong' => [], 'summary' => [], + 'table' => [], 'tbody' => [], 'td' => ['colspan', 'rowspan'], 'tfoot' => [], + 'th' => ['scope', 'colspan', 'rowspan'], 'thead' => [], 'tr' => [], 'ul' => [], + 'video' => ['controls', 'muted', 'playsinline', 'poster', 'preload'], + ]; + + public static function url(string $value, bool $media = false): bool + { + if ($value === '' || preg_match('/[\x00-\x20\x7f\\\\]/', $value)) { + return false; + } + if (str_starts_with($value, '/')) { + return !str_starts_with($value, '//'); + } + if (str_starts_with($value, '#')) { + return !$media && strlen($value) > 1; + } + $scheme = strtolower((string) parse_url($value, PHP_URL_SCHEME)); + + return in_array($scheme, $media ? ['https'] : ['https', 'http', 'mailto', 'tel'], true); + } + + public static function markdown(string $text): string + { + static $converter; + $converter ??= new CommonMarkConverter(['html_input' => 'strip', 'allow_unsafe_links' => false, 'max_nesting_level' => 30]); + + $html = $converter->convert($text)->getContent(); + + return str_replace(['

', '

'], ['

', '

'], $html); + } + + public static function sanitize(string $html): string + { + $document = new DOMDocument('1.0', 'UTF-8'); + $document->loadHTML('' . $html . '', LIBXML_NOERROR | LIBXML_NOWARNING | LIBXML_NONET); + $body = $document->getElementsByTagName('body')->item(0); + if (!$body) { + return ''; + } + self::sanitizeChildren($body); + $output = ''; + foreach ($body->childNodes as $child) { + $output .= $document->saveHTML($child); + } + + return trim($output); + } + + private static function sanitizeChildren(DOMNode $parent): void + { + foreach (iterator_to_array($parent->childNodes) as $element) { + if ($element->nodeType === XML_COMMENT_NODE) { + $parent->removeChild($element); + continue; + } + if (!$element instanceof DOMElement) { + continue; + } + if (!array_key_exists($element->tagName, self::TAGS)) { + $parent->removeChild($element); + continue; + } + $allowed = [...self::TAGS[$element->tagName], 'class', 'id']; + foreach (iterator_to_array($element->attributes) as $attribute) { + $name = $attribute->name; + $value = $attribute->value; + if (!in_array($name, $allowed, true) + || ($name === 'href' && !self::url($value)) + || (in_array($name, ['src', 'poster'], true) && !self::url($value, true)) + || ($name === 'tabindex' && $value !== '0')) { + $element->removeAttribute($name); + } + } + self::sanitizeChildren($element); + } + } +} diff --git a/app/Content/Repository.php b/app/Content/Repository.php new file mode 100644 index 0000000..2e77dfe --- /dev/null +++ b/app/Content/Repository.php @@ -0,0 +1,221 @@ + '公告', 'news' => '新闻', 'product' => '产品']; + private PDO $pdo; + + public function __construct() + { + $this->pdo = Database::connect(); + } + + public function site(): array + { + return json_decode((string) $this->pdo->query('SELECT payload FROM site_settings WHERE id = 1')->fetchColumn(), true, flags: JSON_THROW_ON_ERROR); + } + + public function pages(): array + { + return $this->pdo->query('SELECT slug, name, title, updated_at FROM pages ORDER BY rowid')->fetchAll(); + } + + public function page(string $slug): ?array + { + $page = $this->one('SELECT * FROM pages WHERE slug = ?', [$slug]); + if (!$page) { + return null; + } + foreach (['actions', 'quicklinks', 'partners'] as $key) { + $page[$key] = json_decode($page[$key], true, flags: JSON_THROW_ON_ERROR); + } + $query = $this->pdo->prepare('SELECT * FROM sections WHERE page_slug = ? ORDER BY position, key'); + $query->execute([$slug]); + $page['sections'] = $query->fetchAll(); + + return $page; + } + + public function section(string $page, string $key): ?array + { + return $this->one('SELECT * FROM sections WHERE page_slug = ? AND key = ?', [$page, $key]); + } + + public function savePage(string $slug, array $data, int $version): void + { + $query = $this->pdo->prepare('UPDATE pages SET title = ?, description = ?, heading = ?, accent = ?, lead = ?, + image = ?, alt = ?, actions = ?, updated_at = ?, version = version + 1 WHERE slug = ? AND version = ?'); + $query->execute([ + $data['title'], $data['description'], $data['heading'], $data['accent'], $data['lead'], + $data['image'], $data['alt'], Database::json($data['actions']), self::now(), $slug, $version, + ]); + self::checkVersion($query->rowCount()); + } + + public function saveSection(string $page, string $key, array $data, int $version): void + { + Database::write(function (PDO $pdo) use ($page, $key, $data, $version): void { + $query = $pdo->prepare('UPDATE sections SET title = ?, lead = ?, body = ?, version = version + 1 + WHERE page_slug = ? AND key = ? AND version = ?'); + $query->execute([$data['title'], $data['lead'], $data['body'], $page, $key, $version]); + self::checkVersion($query->rowCount()); + $query = $pdo->prepare('UPDATE pages SET updated_at = ? WHERE slug = ?'); + $query->execute([self::now(), $page]); + }); + } + + public function articles(?string $category = null, ?string $tag = null, bool $public = true, int $limit = 30, int $offset = 0): array + { + $sql = 'SELECT * FROM articles WHERE 1 = 1'; + $args = []; + if ($public) { + $sql .= " AND status = 'published' AND published_at IS NOT NULL"; + } + if ($category !== null) { + $sql .= ' AND category = ?'; + $args[] = $category; + } + if ($tag !== null) { + $sql .= ' AND EXISTS (SELECT 1 FROM json_each(articles.tags) WHERE value = ?)'; + $args[] = $tag; + } + $order = $public ? 'published_at' : 'updated_at'; + $query = $this->pdo->prepare($sql . ' ORDER BY ' . $order . ' DESC, id DESC LIMIT ? OFFSET ?'); + $query->execute([...$args, $limit, $offset]); + + return array_map(self::decodeArticle(...), $query->fetchAll()); + } + + public function articleById(int $id): ?array + { + return self::decodeArticle($this->one('SELECT * FROM articles WHERE id = ?', [$id])); + } + + public function published(string $slug): ?array + { + return self::decodeArticle($this->one("SELECT * FROM articles WHERE slug = ? AND status = 'published'", [$slug])); + } + + public function articleRedirect(string $slug): ?array + { + return $this->one("SELECT articles.slug FROM article_redirects + JOIN articles ON articles.id = article_redirects.article_id + WHERE article_redirects.slug = ? AND articles.status = 'published'", [$slug]); + } + + public function legacyArticle(string $path): ?array + { + return $this->one("SELECT slug FROM articles WHERE legacy_path = ? AND status = 'published'", [$path]); + } + + public function saveArticle(?int $id, array $data, int $version): int + { + return Database::write(function (PDO $pdo) use ($id, $data, $version): int { + $old = $id !== null ? $this->articleById($id) : null; + if ($id !== null && (!$old || $old['version'] !== $version)) { + self::checkVersion(0); + } + $existing = $this->one('SELECT id FROM articles WHERE slug = ?', [$data['slug']]); + $redirect = $this->one('SELECT article_id FROM article_redirects WHERE slug = ?', [$data['slug']]); + if (($existing && $existing['id'] !== $id) || ($redirect && $redirect['article_id'] !== $id)) { + throw new RuntimeException('此网址标识已被使用。'); + } + $publishedAt = $old['published_at'] ?? ($data['status'] === 'published' ? self::now() : null); + $values = [ + $data['slug'], $data['title'], $data['category'], $data['summary'], $data['body'], + Database::json($data['tags']), $data['status'], $publishedAt, self::now(), + ]; + if ($id === null) { + $query = $pdo->prepare('INSERT INTO articles + (slug, title, category, summary, body, tags, status, published_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)'); + $query->execute($values); + + return (int) $pdo->lastInsertId(); + } + if ($old['slug'] !== $data['slug']) { + $pdo->prepare('DELETE FROM article_redirects WHERE slug = ? AND article_id = ?')->execute([$data['slug'], $id]); + $pdo->prepare('INSERT INTO article_redirects (slug, article_id) VALUES (?, ?)')->execute([$old['slug'], $id]); + } + $query = $pdo->prepare('UPDATE articles SET slug = ?, title = ?, category = ?, summary = ?, body = ?, tags = ?, + status = ?, published_at = ?, updated_at = ?, version = version + 1 WHERE id = ? AND version = ?'); + $query->execute([...$values, $id, $version]); + self::checkVersion($query->rowCount()); + + return $id; + }); + } + + public function sitemapArticles(): iterable + { + $query = $this->pdo->query("SELECT slug, updated_at FROM articles WHERE status = 'published' AND trim(body) <> '' ORDER BY slug"); + yield from $query; + } + + public function administrator(string $email): ?array + { + return $this->one('SELECT id, email, password_hash FROM users WHERE email = ?', [$email]); + } + + public function administratorById(int $id): ?array + { + return $this->one('SELECT id, email, password_hash FROM users WHERE id = ?', [$id]); + } + + public function recordLoginAttempt(string $address): bool + { + return Database::write(function (PDO $pdo) use ($address): bool { + $now = time(); + $pdo->prepare('DELETE FROM login_attempts WHERE expires_at <= ?')->execute([$now]); + $current = $this->one('SELECT attempts FROM login_attempts WHERE address = ?', [$address]); + if ($current && $current['attempts'] >= 12) { + return false; + } + $query = $pdo->prepare('INSERT INTO login_attempts (address, attempts, expires_at) VALUES (?, 1, ?) + ON CONFLICT (address) DO UPDATE SET attempts = attempts + 1'); + $query->execute([$address, $now + 900]); + + return true; + }); + } + + public function clearLoginAttempts(string $address): void + { + $this->pdo->prepare('DELETE FROM login_attempts WHERE address = ?')->execute([$address]); + } + + private function one(string $sql, array $args): ?array + { + $query = $this->pdo->prepare($sql); + $query->execute($args); + + return $query->fetch() ?: null; + } + + private static function decodeArticle(?array $article): ?array + { + if ($article !== null) { + $article['tags'] = json_decode($article['tags'], true, flags: JSON_THROW_ON_ERROR); + } + + return $article; + } + + private static function now(): string + { + return date('Y-m-d H:i:s'); + } + + private static function checkVersion(int $count): void + { + if ($count !== 1) { + throw new RuntimeException('此内容已在其他窗口更新。请保留你的修改,重新打开后再合并。'); + } + } +} diff --git a/app/Content/View.php b/app/Content/View.php new file mode 100644 index 0000000..22b5f4d --- /dev/null +++ b/app/Content/View.php @@ -0,0 +1,65 @@ + $html]); + $headers = [ + 'Content-Type' => 'text/html; charset=utf-8', + 'X-Content-Type-Options' => 'nosniff', + 'Referrer-Policy' => 'strict-origin-when-cross-origin', + 'X-Frame-Options' => 'DENY', + 'Content-Security-Policy' => "default-src 'self'; img-src 'self' https:; media-src 'self' https:; " + . "style-src 'self'; script-src 'self'; frame-ancestors 'none'; form-action 'self'; base-uri 'none'; object-src 'none'", + ]; + if ($admin) { + $headers['Cache-Control'] = 'no-store'; + $headers['X-Robots-Tag'] = 'noindex, nofollow'; + } elseif (($data['noindex'] ?? false) || $status >= 400) { + $headers['X-Robots-Tag'] = 'noindex'; + } + + return new Response($status, $headers, $page); + } + + public static function fragment(string $template, array $data = []): string + { + extract($data, EXTR_SKIP); + ob_start(); + try { + require dirname(__DIR__) . '/view/' . $template . '.php'; + + return (string) ob_get_contents(); + } finally { + ob_end_clean(); + } + } + + public static function escape(string|int|null $value): string + { + return htmlspecialchars((string) $value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); + } + + public static function absolute(string $path): string + { + return rtrim(getenv('LAYSENSE_SITE_URL') ?: 'https://laysense.cn', '/') . $path; + } + + public static function date(?string $value, string $format = 'Y年n月j日'): string + { + return $value ? date($format, strtotime($value)) : ''; + } + + public static function redirect(string $path, int $status = 303): Response + { + return new Response($status, ['Location' => $path, 'Cache-Control' => $status === 301 ? 'public, max-age=300' : 'no-store'], ''); + } +} diff --git a/app/Controller/AdminController.php b/app/Controller/AdminController.php new file mode 100644 index 0000000..117ed2d --- /dev/null +++ b/app/Controller/AdminController.php @@ -0,0 +1,345 @@ +signedIn($request)) { + return View::redirect('/admin'); + } + $error = ''; + $email = ''; + $status = 200; + if ($request->method() === 'POST') { + if (!$this->validToken($request)) { + return $this->error($request, '表单已过期,请刷新后重试。', 403); + } + $email = strtolower($this->input($request, 'email')); + $password = $this->input($request, 'password', trimValue: false); + $repo = new Repository(); + $address = $this->address($request); + if (!$repo->recordLoginAttempt($address)) { + $error = '尝试次数过多,请在 15 分钟后重试。'; + $status = 429; + } else { + $user = strlen($email) <= 254 ? $repo->administrator($email) : null; + $hash = $user['password_hash'] ?? '$2y$12$XGNKW.dBbfpUrZT8MYvWquCW1dBN3fIlVb29tlaoFIge3YDWG0AzG'; + if (strlen($password) <= 72 && password_verify($password, $hash) && $user) { + $request->sessionRegenerateId(true); + $request->session()->flush(); + $request->session()->set('admin_id', $user['id']); + $request->session()->set('auth_version', hash('sha256', $user['password_hash'])); + $request->session()->set('admin_since', time()); + $repo->clearLoginAttempts($address); + + return View::redirect('/admin'); + } + $error = '邮箱或密码有误。'; + $status = 422; + } + } + + return $this->render($request, 'admin-login', ['title' => '登录内容管理', 'error' => $error, 'email' => $email], $status); + } + + public function logout(Request $request): Response + { + if ($failure = $this->guard($request)) { + return $failure; + } + $request->session()->flush(); + $request->sessionRegenerateId(true); + + return View::redirect('/admin/login'); + } + + public function dashboard(Request $request): Response + { + if ($failure = $this->guard($request)) { + return $failure; + } + $repo = new Repository(); + + return $this->render($request, 'admin-dashboard', [ + 'title' => '内容管理', 'pages' => $repo->pages(), 'articles' => $repo->articles(public: false, limit: 5), + ]); + } + + public function articles(Request $request): Response + { + if ($failure = $this->guard($request)) { + return $failure; + } + $page = max(1, min(10000, (int) $request->get('page', 1))); + $articles = (new Repository())->articles(public: false, limit: 31, offset: ($page - 1) * 30); + + return $this->render($request, 'admin-articles', [ + 'title' => '文章与动态', 'articles' => array_slice($articles, 0, 30), 'pageNumber' => $page, 'hasNext' => count($articles) > 30, + ]); + } + + public function article(Request $request, ?string $id = null): Response + { + if ($failure = $this->guard($request)) { + return $failure; + } + $repo = new Repository(); + $article = $id !== null ? $repo->articleById((int) $id) : [ + 'title' => '', 'slug' => '', 'summary' => '', 'category' => 'news', 'body' => '', + 'tags' => [], 'status' => 'draft', 'version' => 0, + ]; + if (!$article) { + return $this->error($request, '找不到这篇文章。', 404); + } + $error = ''; + if ($request->method() === 'POST') { + $data = $this->articleInput($request); + $article = array_replace($article, $data, ['version' => $this->version($request)]); + try { + if (mb_strlen($data['title']) < 1 || mb_strlen($data['title']) > 120 + || !preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/D', $data['slug']) || strlen($data['slug']) > 100 + || mb_strlen($data['summary']) > 250 || strlen($data['body']) > 200000 + || !isset(Repository::CATEGORIES[$data['category']]) + || !in_array($data['status'], ['draft', 'published'], true)) { + throw new RuntimeException('请检查标题、网址标识、分类、摘要和正文长度。'); + } + if ($data['status'] === 'published' && trim(Html::markdown($data['body'])) === '') { + throw new RuntimeException('发布前请填写文章正文。'); + } + $saved = $repo->saveArticle($id === null ? null : (int) $id, $data, $this->version($request)); + + return View::redirect('/admin/articles/' . $saved . '?saved=1'); + } catch (RuntimeException $exception) { + $error = $this->validationMessage($exception); + } + } + + return $this->render($request, 'admin-article', [ + 'title' => $id === null ? '新建文章' : '编辑文章', 'article' => $article, 'error' => $error, + 'articleId' => $id, 'saved' => $request->get('saved') === '1', + ], $error !== '' ? 422 : 200); + } + + public function page(Request $request, string $slug): Response + { + if ($failure = $this->guard($request)) { + return $failure; + } + $repo = new Repository(); + $page = $repo->page($slug); + if (!$page) { + return $this->error($request, '找不到此页面。', 404); + } + $error = ''; + if ($request->method() === 'POST') { + $data = []; + foreach (['title', 'description', 'heading', 'accent', 'lead', 'image', 'alt'] as $field) { + $data[$field] = $this->input($request, $field); + } + $data['actions'] = []; + $validButtons = true; + foreach ([1, 2] as $index) { + $label = $this->input($request, 'label' . $index); + $url = $this->input($request, 'url' . $index); + if ($label === '' && $url === '') { + continue; + } + $data['actions'][] = [$url, $label]; + $validButtons = $validButtons && mb_strlen($label) <= 50 && $label !== '' && strlen($url) <= 1000 && Html::url($url); + } + $page = array_replace($page, $data, ['version' => $this->version($request)]); + try { + if ($data['title'] === '' || mb_strlen($data['title']) > 160 || + $data['description'] === '' || mb_strlen($data['description']) > 300 || + $data['heading'] === '' || mb_strlen($data['heading'] . $data['accent']) > 110 || + mb_strlen($data['lead']) > 600 || mb_strlen($data['alt']) > 200 || + strlen($data['image']) > 1000 || ($data['image'] !== '' && !Html::url($data['image'], true)) || !$validButtons) { + throw new RuntimeException('请检查页面标题、说明、图片地址和按钮链接。'); + } + $repo->savePage($slug, $data, $this->version($request)); + + return View::redirect('/admin/pages/' . $slug . '?saved=1'); + } catch (RuntimeException $exception) { + $error = $this->validationMessage($exception); + } + } + + return $this->render($request, 'admin-page', [ + 'title' => '编辑 ' . $page['name'], 'page' => $page, 'error' => $error, 'saved' => $request->get('saved') === '1', + ], $error !== '' ? 422 : 200); + } + + public function section(Request $request, string $slug, string $key): Response + { + if ($failure = $this->guard($request)) { + return $failure; + } + $repo = new Repository(); + $section = $repo->section($slug, $key); + if (!$section) { + return $this->error($request, '找不到此区块。', 404); + } + $error = ''; + if ($request->method() === 'POST') { + $data = [ + 'title' => $this->input($request, 'title'), 'lead' => $this->input($request, 'lead'), + 'body' => $this->input($request, 'body'), + ]; + $section = array_replace($section, $data, ['version' => $this->version($request)]); + try { + if ($data['title'] === '' || mb_strlen($data['title']) > 100 || mb_strlen($data['lead']) > 500 || strlen($data['body']) > 300000) { + throw new RuntimeException('请填写区块标题,并检查说明及正文长度。'); + } + $data['body'] = Html::sanitize($data['body']); + $repo->saveSection($slug, $key, $data, $this->version($request)); + + return View::redirect('/admin/pages/' . $slug . '/' . $key . '?saved=1'); + } catch (RuntimeException $exception) { + $error = $this->validationMessage($exception); + } + } + + return $this->render($request, 'admin-section', [ + 'title' => '编辑区块', 'section' => $section, 'error' => $error, 'saved' => $request->get('saved') === '1', + ], $error !== '' ? 422 : 200); + } + + public function preview(Request $request): Response + { + if ($failure = $this->guard($request)) { + return $failure; + } + $body = $this->input($request, 'body'); + if (strlen($body) > 300000) { + return new Response(413, ['Cache-Control' => 'no-store'], '正文太长。'); + } + $html = $this->input($request, 'format') === 'html' ? Html::sanitize($body) : Html::markdown($body); + + return new Response(200, [ + 'Content-Type' => 'text/html; charset=utf-8', 'Cache-Control' => 'no-store', 'X-Robots-Tag' => 'noindex, nofollow', + 'Content-Security-Policy' => "default-src 'none'; frame-ancestors 'none'; sandbox", + ], $html); + } + + private function guard(Request $request): ?Response + { + if (!$this->signedIn($request)) { + return View::redirect('/admin/login'); + } + if ($request->method() === 'POST' && !$this->validToken($request)) { + return $this->error($request, '表单已过期,请刷新后重试。', 403); + } + + return null; + } + + private function signedIn(Request $request): bool + { + $session = $request->session(); + $id = $session->get('admin_id'); + if (!is_int($id) || (int) $session->get('admin_since') < time() - 8 * 60 * 60) { + return false; + } + $user = (new Repository())->administratorById($id); + if (!$user || !hash_equals(hash('sha256', $user['password_hash']), (string) $session->get('auth_version'))) { + $session->flush(); + + return false; + } + $this->user = $user; + + return true; + } + + private function token(Request $request): string + { + $session = $request->session(); + $token = $session->get('csrf'); + if (!is_string($token)) { + $token = bin2hex(random_bytes(32)); + $session->set('csrf', $token); + } + + return $token; + } + + private function validToken(Request $request): bool + { + return hash_equals($this->token($request), $this->input($request, 'csrf')); + } + + private function input(Request $request, string $key, bool $trimValue = true): string + { + $value = $request->post($key, ''); + if (!is_string($value) || !mb_check_encoding($value, 'UTF-8')) { + return ''; + } + + return $trimValue ? trim($value) : $value; + } + + private function version(Request $request): int + { + $version = $this->input($request, 'version'); + + return ctype_digit($version) ? (int) $version : -1; + } + + private function articleInput(Request $request): array + { + $data = []; + foreach (['title', 'slug', 'category', 'summary', 'body', 'status'] as $key) { + $data[$key] = $this->input($request, $key); + } + $tags = preg_split('/[,,\r\n]+/u', $this->input($request, 'tags')); + $data['tags'] = array_values(array_unique(array_slice(array_filter( + array_map('trim', $tags), + static fn (string $tag): bool => $tag !== '' && mb_strlen($tag) <= 80 && !str_contains($tag, '/'), + ), 0, 12))); + + return $data; + } + + private function address(Request $request): string + { + $peer = $request->getRemoteIp(); + $trusted = explode(',', getenv('LAYSENSE_TRUSTED_PROXIES') ?: ''); + $candidate = $request->header('x-real-ip', ''); + + return in_array($peer, $trusted, true) && filter_var($candidate, FILTER_VALIDATE_IP) ? $candidate : $peer; + } + + private function validationMessage(RuntimeException $exception): string + { + if ($exception instanceof \PDOException) { + error_log($exception->getMessage()); + + return '保存失败,请稍后重试。'; + } + + return $exception->getMessage(); + } + + private function render(Request $request, string $view, array $data, int $status = 200): Response + { + return View::render($view, $data + ['token' => $this->token($request), 'user' => $this->user], $status, true); + } + + private function error(Request $request, string $message, int $status): Response + { + return $this->render($request, 'admin-error', ['title' => $message], $status); + } +} diff --git a/app/Controller/SiteController.php b/app/Controller/SiteController.php new file mode 100644 index 0000000..842dd46 --- /dev/null +++ b/app/Controller/SiteController.php @@ -0,0 +1,167 @@ +page($request, 'home'); + } + + public function page(Request $request, string $slug): Response + { + $repo = new Repository(); + $page = $repo->page($slug); + if (!$page) { + return $this->missing($request); + } + $isHome = $slug === 'home'; + + return View::render('page', [ + 'site' => $repo->site(), + 'page' => $page, + 'path' => $isHome ? '/' : '/' . $slug, + 'title' => $page['title'], + 'description' => $page['description'], + 'socialImage' => $page['image'], + 'socialAlt' => $page['alt'], + 'articles' => $isHome ? $repo->articles(limit: 3) : [], + ]); + } + + public function archive(Request $request, ?string $category = null, ?string $tag = null): Response + { + $repo = new Repository(); + $title = $category ? Repository::CATEGORIES[$category] : ($tag ?: '来笙动态'); + $path = '/articles' . ($category ? '/category/' . $category : ($tag ? '/tag/' . rawurlencode($tag) : '')); + $number = $request->get('page', '1'); + if (!is_scalar($number) || !preg_match('/^[1-9][0-9]{0,4}$/D', (string) $number)) { + return $this->missing($request); + } + $page = (int) $number; + $articles = $repo->articles($category, $tag, limit: 21, offset: ($page - 1) * 20); + if ($page > 1 && $articles === []) { + return $this->missing($request); + } + + return View::render('archive', [ + 'site' => $repo->site(), 'title' => $title . ' · 来笙', 'headline' => $title, + 'description' => '查看来笙的公告、新闻和产品动态。', + 'path' => $path . ($page > 1 ? '?page=' . $page : ''), 'archivePath' => $path, + 'category' => $category, 'tag' => $tag, 'pageNumber' => $page, + 'hasNext' => count($articles) > 20, 'articles' => array_slice($articles, 0, 20), + 'noindex' => $articles === [], + ]); + } + + public function tagged(Request $request, string $tag): Response + { + $tag = rawurldecode($tag); + if (mb_strlen($tag) > 80 || $tag === '') { + return $this->missing($request); + } + + return $this->archive($request, tag: $tag); + } + + public function article(Request $request, string $slug): Response + { + $repo = new Repository(); + $article = $repo->published($slug); + if (!$article) { + $redirect = $repo->articleRedirect($slug); + + return $redirect ? View::redirect('/articles/' . $redirect['slug'], 301) : $this->missing($request); + } + $articleHtml = Html::markdown($article['body']); + + return View::render('article', [ + 'site' => $repo->site(), 'article' => $article, 'articleHtml' => $articleHtml, + 'title' => $article['title'] . ' · 来笙', + 'description' => $article['summary'] ?: mb_substr(trim(strip_tags($articleHtml)), 0, 150) ?: $article['title'], + 'path' => '/articles/' . $article['slug'], 'noindex' => trim($articleHtml) === '', + ]); + } + + public function legacyArticle(Request $request, string $id): Response + { + $article = (new Repository())->legacyArticle('/news/id/' . $id . '.html'); + + return $article ? View::redirect('/articles/' . $article['slug'], 301) : $this->missing($request); + } + + public function legacyCategory(Request $request, string $id): Response + { + $target = [ + '1' => '/articles/category/product', '2' => '/articles/category/news', '3' => '/articles/category/announcement', + '5' => '/#supported-projects', '6' => '/#partners', + ][$id] ?? null; + + return $target ? View::redirect($target, 301) : $this->missing($request); + } + + public function legacyTag(Request $request, string $tag): Response + { + return View::redirect('/articles/tag/' . rawurlencode(rawurldecode($tag)), 301); + } + + public function sitemap(Request $request): Response + { + $repo = new Repository(); + $xml = ['', '']; + $pages = $repo->pages(); + if ($repo->articles(limit: 1)) { + $pages[] = ['slug' => 'articles', 'updated_at' => null]; + } + foreach ($pages as $page) { + $xml[] = $this->sitemapUrl($page['slug'] === 'home' ? '/' : '/' . $page['slug'], $page['updated_at']); + } + foreach ($repo->sitemapArticles() as $article) { + $xml[] = $this->sitemapUrl('/articles/' . $article['slug'], $article['updated_at']); + } + $xml[] = ''; + + return new Response(200, ['Content-Type' => 'application/xml; charset=utf-8'], implode("\n", $xml) . "\n"); + } + + public function robots(Request $request): Response + { + return new Response(200, ['Content-Type' => 'text/plain; charset=utf-8'], + "User-agent: *\nAllow: /\nDisallow: /admin\nSitemap: " . View::absolute('/sitemap.xml') . "\n"); + } + + public function missing(Request $request): Response + { + $path = $request->path(); + if ($request->method() === 'GET' && strlen($path) > 1 && str_ends_with($path, '/')) { + $normal = rtrim($path, '/'); + if (preg_match('~^/(?:pagepan|highspeaker|sc|shnu-sc|articles(?:/[a-z0-9-]+){0,2})$~D', $normal)) { + $query = $request->queryString(); + + return View::redirect($normal . ($query !== '' ? '?' . $query : ''), 301); + } + } + + return View::render('missing', [ + 'site' => (new Repository())->site(), 'title' => '页面未找到 · 来笙', 'description' => '', + 'path' => null, 'noindex' => true, + ], 404); + } + + private function sitemapUrl(string $path, ?string $updated): string + { + $url = htmlspecialchars(View::absolute($path), ENT_XML1 | ENT_QUOTES, 'UTF-8'); + $date = $updated ? '' . View::date($updated, 'Y-m-d') . '' : ''; + + return ' ' . $url . '' . $date . ''; + } +} diff --git a/app/view/admin-article-list.php b/app/view/admin-article-list.php new file mode 100644 index 0000000..6f90911 --- /dev/null +++ b/app/view/admin-article-list.php @@ -0,0 +1,20 @@ + + + + +

暂无文章。

+ diff --git a/app/view/admin-article.php b/app/view/admin-article.php new file mode 100644 index 0000000..5ec5bc8 --- /dev/null +++ b/app/view/admin-article.php @@ -0,0 +1,37 @@ + +返回文章列表 +
+

+ + 查看公开页面 + +
+ +
+ + + +
+ + +
+ + + 'markdown', 'body' => $article['body']]) ?> +
+ + +
+
diff --git a/app/view/admin-articles.php b/app/view/admin-articles.php new file mode 100644 index 0000000..e98542d --- /dev/null +++ b/app/view/admin-articles.php @@ -0,0 +1,17 @@ + +
+

文章与动态

+ 新建文章 +
+
+ $articles]) ?> +
+ 1 || $hasNext): ?> + + diff --git a/app/view/admin-dashboard.php b/app/view/admin-dashboard.php new file mode 100644 index 0000000..6d16c2e --- /dev/null +++ b/app/view/admin-dashboard.php @@ -0,0 +1,24 @@ + +
+

内容管理

管理网站页面、文章、公告和产品动态。

+ 新建文章 +
+
+

网站页面

+ +
+
+

最近编辑的文章

管理全部文章
+ $articles]) ?> +
diff --git a/app/view/admin-editor.php b/app/view/admin-editor.php new file mode 100644 index 0000000..5226839 --- /dev/null +++ b/app/view/admin-editor.php @@ -0,0 +1,22 @@ + +
+ +
+
+ + + + +
+ +
+ + +

支持段落、标题、链接、图片、列表、表格和折叠问答。保存时会清理脚本、内联样式等标签或属性。

+ + +
diff --git a/app/view/admin-error.php b/app/view/admin-error.php new file mode 100644 index 0000000..7c12341 --- /dev/null +++ b/app/view/admin-error.php @@ -0,0 +1,2 @@ +

+返回内容管理 diff --git a/app/view/admin-feedback.php b/app/view/admin-feedback.php new file mode 100644 index 0000000..24b64f6 --- /dev/null +++ b/app/view/admin-feedback.php @@ -0,0 +1,3 @@ + + +

已保存。

diff --git a/app/view/admin-layout.php b/app/view/admin-layout.php new file mode 100644 index 0000000..9726c81 --- /dev/null +++ b/app/view/admin-layout.php @@ -0,0 +1,40 @@ + + + + + + + + <?= $e($title) ?> · 来笙 CMS + + + + + + + +
+
+ 来笙 Laysense + + + + 返回网站 + +
+
+
+ + diff --git a/app/view/admin-login.php b/app/view/admin-login.php new file mode 100644 index 0000000..bb07c2c --- /dev/null +++ b/app/view/admin-login.php @@ -0,0 +1,16 @@ + +
+

登录内容管理

+

编辑来笙网站的页面、公告和文章。

+ +
+ + + + +
+
diff --git a/app/view/admin-page.php b/app/view/admin-page.php new file mode 100644 index 0000000..127a228 --- /dev/null +++ b/app/view/admin-page.php @@ -0,0 +1,46 @@ + +返回内容管理 +
+

+ 查看公开页面 +
+ +
+

首屏与 SEO

+ + + + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+

内容区块

+ +
diff --git a/app/view/admin-section.php b/app/view/admin-section.php new file mode 100644 index 0000000..ad49fef --- /dev/null +++ b/app/view/admin-section.php @@ -0,0 +1,21 @@ + +返回页面编辑 +
+

· #

+ 查看公开区块 +
+ +
+ + + + + 'html', 'body' => $section['body']]) ?> +
+
diff --git a/app/view/archive.php b/app/view/archive.php new file mode 100644 index 0000000..2e5842f --- /dev/null +++ b/app/view/archive.php @@ -0,0 +1,29 @@ + +
+
+
+ 全部动态 +

+

来笙的公告、新闻和产品动态。

+
+ + $articles]) ?> + 1 || $hasNext): ?> + + +
+
diff --git a/app/view/article-list.php b/app/view/article-list.php new file mode 100644 index 0000000..2d2e1ea --- /dev/null +++ b/app/view/article-list.php @@ -0,0 +1,23 @@ + + + + +

暂无已发布的动态。

+ diff --git a/app/view/article.php b/app/view/article.php new file mode 100644 index 0000000..27a0237 --- /dev/null +++ b/app/view/article.php @@ -0,0 +1,35 @@ + +
+
+ 全部动态 +
+ +

+

+ +
+
+ + + +

此公告的原文暂不可用。

+ +
+ + + +
+
diff --git a/app/view/layout.php b/app/view/layout.php new file mode 100644 index 0000000..9afbb0a --- /dev/null +++ b/app/view/layout.php @@ -0,0 +1,108 @@ + + + + + + + <?= $e($title) ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + Laysense 来笙 + + + + 联系来笙 +
+
+
+ + + diff --git a/app/view/missing.php b/app/view/missing.php new file mode 100644 index 0000000..8bd5597 --- /dev/null +++ b/app/view/missing.php @@ -0,0 +1,8 @@ +
+
+

404

+

页面未找到

+

请检查网址,或回到首页浏览产品与服务。

+ 返回首页 +
+
diff --git a/app/view/page.php b/app/view/page.php new file mode 100644 index 0000000..98d5f05 --- /dev/null +++ b/app/view/page.php @@ -0,0 +1,98 @@ + +
+
+
+ + + +

上海来笙信息科技有限公司

+ +


+

+
+ [$url, $label]): ?> + + +
+
+ +
+ <?= $e($page['alt']) ?> +
+ +
+ + + +
+ + + + + $section, 'moment' => $home && $section['key'] === 'about']) ?> + + +
+
+
+

来笙动态

+ 查看全部动态 +
+ $articles]) ?> +
+
+ +
+
+

支持项目与合作伙伴

+ 'supported-projects', '来笙合作伙伴' => 'partners'] as $group => $id): ?> +
+

+ +
+ +
+
+ + diff --git a/app/view/section.php b/app/view/section.php new file mode 100644 index 0000000..6e615c3 --- /dev/null +++ b/app/view/section.php @@ -0,0 +1,14 @@ + +
> +
+
+

+

+
+
+
+
diff --git a/bin/admin.php b/bin/admin.php new file mode 100644 index 0000000..a50ea56 --- /dev/null +++ b/bin/admin.php @@ -0,0 +1,38 @@ + 72 || str_contains($password, "\0")) { + fwrite(STDERR, "密码需至少 12 字符,并且最多 72 字节。\n"); + exit(1); +} + +Database::initialize(); +$hash = password_hash($password, PASSWORD_DEFAULT); +$query = Database::connect()->prepare('INSERT INTO users (email, password_hash) VALUES (?, ?) + ON CONFLICT (email) DO UPDATE SET password_hash = excluded.password_hash'); +$query->execute([$email, $hash]); +fwrite(STDOUT, "管理员账户已就绪。\n"); diff --git a/bin/install.php b/bin/install.php new file mode 100644 index 0000000..15aee30 --- /dev/null +++ b/bin/install.php @@ -0,0 +1,11 @@ +=8.1", + "psr/log": "^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8 || ^2.0", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "php-console/php-console": "^3.1.8", + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^10.5.17 || ^11.0.7", + "predis/predis": "^1.1 || ^2", + "psr/clock": "^1.0", + "rollbar/rollbar": "^4.0", + "ruflin/elastica": "^7 || ^8", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "psr/clock": "Required to pass a clock to the Logger and control the timestamp of log records", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/3.13.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2026-11-16T10:43:05+00:00", + "published-time": "2026-11-16T10:45:37+00:00" + }, + { + "name": "nette/schema", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/nette/schema.git", + "reference": "af9fa8a86bfca9b02b10346220db26e62ef942ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/schema/zipball/af9fa8a86bfca9b02b10346220db26e62ef942ec", + "reference": "af9fa8a86bfca9b02b10346220db26e62ef942ec", + "shasum": "" + }, + "require": { + "nette/utils": "^4.0", + "php": "8.1 - 8.6" + }, + "require-dev": { + "nette/phpstan-rules": "^1.0.7", + "nette/tester": "^2.6", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.3@stable", + "tracy/tracy": "^2.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + } + ], + "description": "📐 Nette Schema: validates and normalizes data such as configuration or API input against a schema described in a few readable lines of PHP, with precise error messages.", + "homepage": "https://doc.nette.org/schema", + "keywords": [ + "configuration", + "data validation", + "nette", + "normalization", + "schema", + "validation" + ], + "support": { + "issues": "https://github.com/nette/schema/issues", + "source": "https://github.com/nette/schema/tree/v1.4.0" + }, + "time": "2026-10-22T02:12:50+00:00", + "published-time": "2026-10-22T02:14:45+00:00" + }, + { + "name": "nette/utils", + "version": "v4.1.6", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "6bf24518accf32cf845bca305e0b92078700fd01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/6bf24518accf32cf845bca305e0b92078700fd01", + "reference": "6bf24518accf32cf845bca305e0b92078700fd01", + "shasum": "" + }, + "require": { + "php": "8.2 - 8.6" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "^1.2", + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.5", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1@stable", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::chr(), ord() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.1.6" + }, + "time": "2026-10-20T17:07:56+00:00", + "published-time": "2026-10-20T17:48:30+00:00" + }, + { + "name": "nikic/fast-route", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/nikic/FastRoute.git", + "reference": "7476684f39bb9124b3be69ed3d84b66723920298" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/FastRoute/zipball/7476684f39bb9124b3be69ed3d84b66723920298", + "reference": "7476684f39bb9124b3be69ed3d84b66723920298", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|~5.7" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "FastRoute\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov", + "email": "nikic@php.net" + } + ], + "description": "Fast request router for PHP", + "keywords": [ + "router", + "routing" + ], + "support": { + "issues": "https://github.com/nikic/FastRoute/issues", + "source": "https://github.com/nikic/FastRoute/tree/1.3.1" + }, + "time": "2026-07-09T19:38:47+00:00", + "published-time": "2026-07-09T19:39:54+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00", + "published-time": "2021-11-05T16:53:27+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00", + "published-time": "2019-03-25T15:31:44+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00", + "published-time": "2024-09-11T13:21:14+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.8.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "feb1edf4e546af3b85c5caebe8359a20db230ca3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/feb1edf4e546af3b85c5caebe8359a20db230ca3", + "reference": "feb1edf4e546af3b85c5caebe8359a20db230ca3", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.8-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.8.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-09-16T14:15:10+00:00", + "published-time": "2026-11-04T11:25:34+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.43.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74", + "reference": "9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.43.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-09-25T15:50:05+00:00", + "published-time": "2026-09-30T10:23:35+00:00" + }, + { + "name": "workerman/coroutine", + "version": "v1.1.7", + "source": { + "type": "git", + "url": "https://github.com/workerman-php/coroutine.git", + "reference": "68a905d50f7ec1efcedc1ec317a75dcc3dea3f0f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/workerman-php/coroutine/zipball/68a905d50f7ec1efcedc1ec317a75dcc3dea3f0f", + "reference": "68a905d50f7ec1efcedc1ec317a75dcc3dea3f0f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "workerman/workerman": "^5.1" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "psr/log": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Workerman\\": "src", + "Workerman\\Coroutine\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Workerman coroutine", + "support": { + "issues": "https://github.com/workerman-php/coroutine/issues", + "source": "https://github.com/workerman-php/coroutine/tree/v1.1.7" + }, + "time": "2026-10-24T05:06:43+00:00", + "published-time": "2026-10-25T02:55:21+00:00" + }, + { + "name": "workerman/webman-framework", + "version": "v2.2.5", + "source": { + "type": "git", + "url": "https://github.com/walkor/webman-framework.git", + "reference": "263ef955d8ba6a0cb6fbc1bd0912589ed67c0c8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/walkor/webman-framework/zipball/263ef955d8ba6a0cb6fbc1bd0912589ed67c0c8d", + "reference": "263ef955d8ba6a0cb6fbc1bd0912589ed67c0c8d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "nikic/fast-route": "^1.3", + "php": ">=8.1", + "psr/container": ">=1.0", + "psr/log": "^2.0 || ^3.0", + "workerman/workerman": "^5.1 || dev-master" + }, + "suggest": { + "ext-event": "For better performance. " + }, + "type": "library", + "autoload": { + "files": [ + "./src/support/helpers.php" + ], + "psr-4": { + "Webman\\": "./src", + "Support\\": "./src/support", + "support\\": "./src/support", + "Support\\View\\": "./src/support/view", + "Support\\Bootstrap\\": "./src/support/bootstrap", + "Support\\Exception\\": "./src/support/exception" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "walkor", + "email": "walkor@workerman.net", + "homepage": "https://www.workerman.net", + "role": "Developer" + } + ], + "description": "High performance HTTP Service Framework.", + "homepage": "https://www.workerman.net", + "keywords": [ + "High Performance", + "http service" + ], + "support": { + "email": "walkor@workerman.net", + "forum": "https://wenda.workerman.net/", + "issues": "https://github.com/walkor/webman/issues", + "source": "https://github.com/walkor/webman-framework", + "wiki": "https://doc.workerman.net/" + }, + "time": "2026-10-25T09:46:46+00:00", + "published-time": "2026-10-25T09:47:02+00:00" + }, + { + "name": "workerman/workerman", + "version": "v5.2.4", + "source": { + "type": "git", + "url": "https://github.com/walkor/workerman.git", + "reference": "4c817dec82c9ea223879b019600db58f62199abc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/walkor/workerman/zipball/4c817dec82c9ea223879b019600db58f62199abc", + "reference": "4c817dec82c9ea223879b019600db58f62199abc", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=8.1", + "workerman/coroutine": "^1.1 || dev-main" + }, + "conflict": { + "ext-swow": " false, + 'error_reporting' => E_ALL, + 'default_timezone' => 'Asia/Shanghai', + 'request_class' => support\Request::class, + 'public_path' => base_path() . '/public', + 'runtime_path' => base_path() . '/runtime', + 'controller_suffix' => 'Controller', + 'controller_reuse' => false, +]; diff --git a/config/bootstrap.php b/config/bootstrap.php new file mode 100644 index 0000000..23cde40 --- /dev/null +++ b/config/bootstrap.php @@ -0,0 +1,3 @@ + support\exception\Handler::class]; diff --git a/config/log.php b/config/log.php new file mode 100644 index 0000000..aa4eb27 --- /dev/null +++ b/config/log.php @@ -0,0 +1,12 @@ + [ + 'handlers' => [ + [ + 'class' => Monolog\Handler\RotatingFileHandler::class, + 'constructor' => [runtime_path() . '/logs/webman.log', 14, Monolog\Level::Info], + ], + ], + ], +]; diff --git a/config/process.php b/config/process.php new file mode 100644 index 0000000..b164151 --- /dev/null +++ b/config/process.php @@ -0,0 +1,15 @@ + [ + 'handler' => Webman\App::class, + 'listen' => getenv('LAYSENSE_LISTEN') ?: 'http://127.0.0.1:8787', + 'count' => max(1, (int) (getenv('LAYSENSE_WORKERS') ?: 2)), + 'constructor' => [ + 'requestClass' => support\Request::class, + 'logger' => support\Log::channel('default'), + 'appPath' => app_path(), + 'publicPath' => public_path(), + ], + ], +]; diff --git a/config/route.php b/config/route.php new file mode 100644 index 0000000..90a2a1c --- /dev/null +++ b/config/route.php @@ -0,0 +1,33 @@ + View::redirect('/articles', 301)); +Route::get('/main/category/{id:[0-9]+}.html', [SiteController::class, 'legacyCategory']); +Route::get('/main/tag/{tag:[^/]+}', [SiteController::class, 'legacyTag']); +Route::get('/news/id/{id:[0-9]+}.html', [SiteController::class, 'legacyArticle']); +Route::get('/robots.txt', [SiteController::class, 'robots']); +Route::get('/sitemap.xml', [SiteController::class, 'sitemap']); + +Route::add(['GET', 'POST'], '/admin/login', [AdminController::class, 'login']); +Route::post('/admin/logout', [AdminController::class, 'logout']); +Route::get('/admin', [AdminController::class, 'dashboard']); +Route::get('/admin/articles', [AdminController::class, 'articles']); +Route::add(['GET', 'POST'], '/admin/articles/new', [AdminController::class, 'article']); +Route::add(['GET', 'POST'], '/admin/articles/{id:[0-9]+}', [AdminController::class, 'article']); +Route::add(['GET', 'POST'], '/admin/pages/{slug:[a-z0-9-]+}', [AdminController::class, 'page']); +Route::add(['GET', 'POST'], '/admin/pages/{slug:[a-z0-9-]+}/{key:[a-z0-9-]+}', [AdminController::class, 'section']); +Route::post('/admin/preview', [AdminController::class, 'preview']); + +Route::fallback(static fn (Request $request) => (new SiteController())->missing($request)); diff --git a/config/server.php b/config/server.php new file mode 100644 index 0000000..083d25c --- /dev/null +++ b/config/server.php @@ -0,0 +1,10 @@ + runtime_path() . '/webman.pid', + 'status_file' => runtime_path() . '/webman.status', + 'stdout_file' => runtime_path() . '/logs/stdout.log', + 'log_file' => runtime_path() . '/logs/workerman.log', + 'stop_timeout' => 4, + 'max_package_size' => 2 * 1024 * 1024, +]; diff --git a/config/session.php b/config/session.php new file mode 100644 index 0000000..83330db --- /dev/null +++ b/config/session.php @@ -0,0 +1,14 @@ + 'file', + 'handler' => Webman\Session\FileSessionHandler::class, + 'config' => ['file' => ['save_path' => runtime_path() . '/sessions']], + 'session_name' => 'LAYSENSE_CMS', + 'lifetime' => 8 * 60 * 60, + 'cookie_lifetime' => 0, + 'cookie_path' => '/admin', + 'http_only' => true, + 'secure' => getenv('LAYSENSE_SECURE_COOKIES') !== '0', + 'same_site' => 'Lax', +]; diff --git a/config/static.php b/config/static.php new file mode 100644 index 0000000..7132f83 --- /dev/null +++ b/config/static.php @@ -0,0 +1,3 @@ + true, 'middleware' => []]; diff --git a/public/assets/admin.css b/public/assets/admin.css new file mode 100644 index 0000000..c3bbb32 --- /dev/null +++ b/public/assets/admin.css @@ -0,0 +1,51 @@ +.admin-body { background: var(--paper); min-height: 100vh; } +.admin-wrap { width: min(calc(100% - 2rem), 67rem); margin-inline: auto; } +.admin-bar { background: var(--white); border-bottom: 1px solid var(--line); } +.admin-bar-inner, .admin-bar nav { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.15rem; } +.admin-bar-inner { justify-content: space-between; min-height: 4.5rem; padding-block: .45rem; } +.admin-bar nav > a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; font-weight: 550; } +.admin-main { padding-block: clamp(1.65rem, 4vw, 3.25rem); } +.admin-main h1 { font-size: clamp(2rem, 4vw, 3.1rem); margin: 0; } +.admin-main h2 { font-size: 1.38rem; margin-bottom: 1rem; } +.admin-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; margin: 0 0 1.2rem; } +.admin-heading.compact h2, .admin-heading p { margin: 0; } +.admin-heading p { margin-top: .4rem; } +.admin-panel, .login-box { border: 1px solid var(--line); padding: clamp(1rem, 3vw, 2rem); background: var(--white); border-radius: var(--radius); margin-bottom: 1.15rem; } +.login-box { max-width: 27rem; margin: clamp(1.5rem, 6vw, 5rem) auto; } +.login-box p { margin-block: .6rem 1.25rem; } +.admin-form { display: grid; gap: 1rem; } +.admin-form label { display: grid; gap: .4rem; font-weight: 570; color: var(--ink); } +.admin-form :where(input:not([type=hidden]), select, textarea) { + background: white; + color: var(--ink); + width: 100%; + border: 1px solid #b9c7dd; + border-radius: .5rem; + padding: .6rem .75rem; + font-size: 1rem; + font-weight: 400; + min-height: 44px; +} +.admin-form textarea { resize: vertical; } +.admin-form small, .field-note { color: var(--muted); font-size: .875rem; font-weight: 400; } +.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; } +.form-submit { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; } +.form-submit label { min-width: 10rem; } +.admin-list { margin: 0; padding: 0; list-style: none; } +.admin-list li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; padding-block: .7rem; border-top: 1px solid var(--line); } +.admin-list small { display: block; color: var(--muted); font-size: .875rem; } +.feedback { padding: .8rem 1rem; border-radius: .5rem; } +.feedback.error { background: #feebeb; color: #9c252a; } +.feedback.success { background: #e5f6ed; color: #126044; } +.editor { display: grid; gap: .45rem; } +.editor-toolbar { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: space-between; padding: .45rem; border: 1px solid var(--line); background: var(--paper); border-radius: .5rem; } +.editor-toolbar > div { display: flex; flex-wrap: wrap; gap: .25rem; } +.editor-toolbar button { border: 1px solid var(--line); background: var(--white); border-radius: .35rem; min-height: 44px; padding: .45rem .7rem; color: var(--ink); } +.editor-toolbar button:hover { border-color: var(--accent); color: var(--accent); } +.editor textarea { font-family: var(--mono); font-size: .95rem; line-height: 1.55; } +.editor-preview { padding: 1rem; border: 1px solid var(--line); border-radius: .5rem; } +.field-note { margin: 0; } +@media (max-width: 38rem) { + .form-grid { grid-template-columns: 1fr; } + .admin-bar nav { gap: .3rem .85rem; } +} diff --git a/public/assets/admin.js b/public/assets/admin.js new file mode 100644 index 0000000..77e5a88 --- /dev/null +++ b/public/assets/admin.js @@ -0,0 +1,55 @@ +'use strict'; + +const formats = { + markdown: { + heading: ['## ', '', '小标题'], + bold: ['**', '**', '粗体文字'], + list: ['- ', '', '列表项'], + link: ['[', '](https://)', '链接文字'] + }, + html: { + heading: ['

', '

', '小标题'], + bold: ['', '', '粗体文字'], + list: ['', '列表项'], + link: ['', '', '链接文字'] + } +}; + +for (const editor of document.querySelectorAll('[data-editor]')) { + const area = editor.querySelector('textarea'); + const format = editor.dataset.format; + const preview = editor.querySelector('.editor-preview'); + const previewButton = editor.querySelector('[data-preview-button]'); + const form = editor.closest('form'); + + for (const button of editor.querySelectorAll('[data-insert]')) { + button.addEventListener('click', () => { + const [before, after, example] = formats[format][button.dataset.insert]; + const start = area.selectionStart; + const end = area.selectionEnd; + const selection = area.value.slice(start, end) || example; + area.setRangeText(before + selection + after, start, end, 'end'); + area.focus(); + area.setSelectionRange(start + before.length, start + before.length + selection.length); + }); + } + + previewButton.addEventListener('click', async () => { + const show = preview.hidden; + preview.hidden = !show; + previewButton.textContent = show ? '收起预览' : '预览正文'; + previewButton.setAttribute('aria-expanded', String(show)); + if (!show) return; + + preview.textContent = '正在加载预览…'; + try { + const body = new URLSearchParams({body: area.value, format, csrf: form.elements.csrf.value}); + const response = await fetch('/admin/preview', {method: 'POST', body, redirect: 'error'}); + if (!response.ok) throw new Error('Preview could not be loaded'); + const markup = await response.text(); + preview.innerHTML = markup; + } catch { + preview.textContent = '预览无法加载,请刷新后重试。'; + } + }); +} diff --git a/public/assets/favicon.png b/public/assets/favicon.png new file mode 100644 index 0000000..dea3bd5 Binary files /dev/null and b/public/assets/favicon.png differ diff --git a/public/assets/geist-OFL.txt b/public/assets/geist-OFL.txt new file mode 100644 index 0000000..5e83a47 --- /dev/null +++ b/public/assets/geist-OFL.txt @@ -0,0 +1,93 @@ +Copyright 2026 The Geist Project Authors (https://github.com/vercel/geist-font) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/public/assets/geist.woff2 b/public/assets/geist.woff2 new file mode 100644 index 0000000..991445d Binary files /dev/null and b/public/assets/geist.woff2 differ diff --git a/public/assets/original/10-1.png b/public/assets/original/10-1.png new file mode 100644 index 0000000..d0c398e Binary files /dev/null and b/public/assets/original/10-1.png differ diff --git a/public/assets/original/10-2.png b/public/assets/original/10-2.png new file mode 100644 index 0000000..b52f9c0 Binary files /dev/null and b/public/assets/original/10-2.png differ diff --git a/public/assets/original/10-3.png b/public/assets/original/10-3.png new file mode 100644 index 0000000..dc61aa2 Binary files /dev/null and b/public/assets/original/10-3.png differ diff --git a/public/assets/original/1s.png b/public/assets/original/1s.png new file mode 100644 index 0000000..9bd0c53 Binary files /dev/null and b/public/assets/original/1s.png differ diff --git a/public/assets/original/DNSPod.svg b/public/assets/original/DNSPod.svg new file mode 100644 index 0000000..990e00d --- /dev/null +++ b/public/assets/original/DNSPod.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/original/IP.png b/public/assets/original/IP.png new file mode 100644 index 0000000..a80e834 Binary files /dev/null and b/public/assets/original/IP.png differ diff --git a/public/assets/original/IdealShark_B.png b/public/assets/original/IdealShark_B.png new file mode 100644 index 0000000..721577a Binary files /dev/null and b/public/assets/original/IdealShark_B.png differ diff --git a/public/assets/original/RAM.png b/public/assets/original/RAM.png new file mode 100644 index 0000000..d9e5605 Binary files /dev/null and b/public/assets/original/RAM.png differ diff --git a/public/assets/original/Redis.png b/public/assets/original/Redis.png new file mode 100644 index 0000000..ab50a60 Binary files /dev/null and b/public/assets/original/Redis.png differ diff --git a/public/assets/original/backup.png b/public/assets/original/backup.png new file mode 100644 index 0000000..0294cd9 Binary files /dev/null and b/public/assets/original/backup.png differ diff --git a/public/assets/original/chinadomain.png b/public/assets/original/chinadomain.png new file mode 100644 index 0000000..0cd9728 Binary files /dev/null and b/public/assets/original/chinadomain.png differ diff --git a/public/assets/original/component-element.mp4 b/public/assets/original/component-element.mp4 new file mode 100644 index 0000000..ac29dad Binary files /dev/null and b/public/assets/original/component-element.mp4 differ diff --git a/public/assets/original/copyright-wechat.png b/public/assets/original/copyright-wechat.png new file mode 100644 index 0000000..95d41ec Binary files /dev/null and b/public/assets/original/copyright-wechat.png differ diff --git a/public/assets/original/copyright.webp b/public/assets/original/copyright.webp new file mode 100644 index 0000000..2b8469d Binary files /dev/null and b/public/assets/original/copyright.webp differ diff --git a/public/assets/original/download.png b/public/assets/original/download.png new file mode 100644 index 0000000..84e498b Binary files /dev/null and b/public/assets/original/download.png differ diff --git a/public/assets/original/drag-in-components.mp4 b/public/assets/original/drag-in-components.mp4 new file mode 100644 index 0000000..d887041 Binary files /dev/null and b/public/assets/original/drag-in-components.mp4 differ diff --git a/public/assets/original/edit-components.mp4 b/public/assets/original/edit-components.mp4 new file mode 100644 index 0000000..ab2120b Binary files /dev/null and b/public/assets/original/edit-components.mp4 differ diff --git a/public/assets/original/fast.png b/public/assets/original/fast.png new file mode 100644 index 0000000..eb3e96c Binary files /dev/null and b/public/assets/original/fast.png differ diff --git a/public/assets/original/fw-banner.svg b/public/assets/original/fw-banner.svg new file mode 100644 index 0000000..03ccf4d --- /dev/null +++ b/public/assets/original/fw-banner.svg @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/original/highspeaker-logo-optimized.webp b/public/assets/original/highspeaker-logo-optimized.webp new file mode 100644 index 0000000..bd906f5 Binary files /dev/null and b/public/assets/original/highspeaker-logo-optimized.webp differ diff --git a/public/assets/original/highspeaker-ui-optimized.webp b/public/assets/original/highspeaker-ui-optimized.webp new file mode 100644 index 0000000..4028c0a Binary files /dev/null and b/public/assets/original/highspeaker-ui-optimized.webp differ diff --git a/public/assets/original/highspeakerrz-optimized.webp b/public/assets/original/highspeakerrz-optimized.webp new file mode 100644 index 0000000..2887373 Binary files /dev/null and b/public/assets/original/highspeakerrz-optimized.webp differ diff --git a/public/assets/original/home-hero.webp b/public/assets/original/home-hero.webp new file mode 100644 index 0000000..a92e1c2 Binary files /dev/null and b/public/assets/original/home-hero.webp differ diff --git a/public/assets/original/icon_rewrite.png b/public/assets/original/icon_rewrite.png new file mode 100644 index 0000000..3f33bf4 Binary files /dev/null and b/public/assets/original/icon_rewrite.png differ diff --git a/public/assets/original/jeo-optimized.webp b/public/assets/original/jeo-optimized.webp new file mode 100644 index 0000000..1ac2dab Binary files /dev/null and b/public/assets/original/jeo-optimized.webp differ diff --git a/public/assets/original/locate.png b/public/assets/original/locate.png new file mode 100644 index 0000000..43d7a2c Binary files /dev/null and b/public/assets/original/locate.png differ diff --git a/public/assets/original/logo_img.png b/public/assets/original/logo_img.png new file mode 100644 index 0000000..87dd929 Binary files /dev/null and b/public/assets/original/logo_img.png differ diff --git a/public/assets/original/mimirlib.png b/public/assets/original/mimirlib.png new file mode 100644 index 0000000..6187e35 Binary files /dev/null and b/public/assets/original/mimirlib.png differ diff --git a/public/assets/original/nonat-optimized.webp b/public/assets/original/nonat-optimized.webp new file mode 100644 index 0000000..9d2c4a0 Binary files /dev/null and b/public/assets/original/nonat-optimized.webp differ diff --git a/public/assets/original/oneprovider_invert.svg b/public/assets/original/oneprovider_invert.svg new file mode 100644 index 0000000..00b53e2 --- /dev/null +++ b/public/assets/original/oneprovider_invert.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/original/orange-optimized.webp b/public/assets/original/orange-optimized.webp new file mode 100644 index 0000000..a14358c Binary files /dev/null and b/public/assets/original/orange-optimized.webp differ diff --git a/public/assets/original/pagepan-editor-optimized.webp b/public/assets/original/pagepan-editor-optimized.webp new file mode 100644 index 0000000..7142d9e Binary files /dev/null and b/public/assets/original/pagepan-editor-optimized.webp differ diff --git a/public/assets/original/pagepan-example.webp b/public/assets/original/pagepan-example.webp new file mode 100644 index 0000000..e8bf0b7 Binary files /dev/null and b/public/assets/original/pagepan-example.webp differ diff --git a/public/assets/original/pagepan-wechat.png b/public/assets/original/pagepan-wechat.png new file mode 100644 index 0000000..e90ecc7 Binary files /dev/null and b/public/assets/original/pagepan-wechat.png differ diff --git a/public/assets/original/papepan-logo.svg b/public/assets/original/papepan-logo.svg new file mode 100644 index 0000000..d18f9a3 --- /dev/null +++ b/public/assets/original/papepan-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/original/payment-alipay.png b/public/assets/original/payment-alipay.png new file mode 100644 index 0000000..6a19afe Binary files /dev/null and b/public/assets/original/payment-alipay.png differ diff --git a/public/assets/original/payment-taobao.png b/public/assets/original/payment-taobao.png new file mode 100644 index 0000000..249f4c5 Binary files /dev/null and b/public/assets/original/payment-taobao.png differ diff --git a/public/assets/original/payment-wechat.png b/public/assets/original/payment-wechat.png new file mode 100644 index 0000000..a9841a6 Binary files /dev/null and b/public/assets/original/payment-wechat.png differ diff --git a/public/assets/original/qywx.png b/public/assets/original/qywx.png new file mode 100644 index 0000000..c7cdbbf Binary files /dev/null and b/public/assets/original/qywx.png differ diff --git a/public/assets/original/shnu-hero.webp b/public/assets/original/shnu-hero.webp new file mode 100644 index 0000000..169cfe6 Binary files /dev/null and b/public/assets/original/shnu-hero.webp differ diff --git a/public/assets/original/smartroute.png b/public/assets/original/smartroute.png new file mode 100644 index 0000000..fc0565e Binary files /dev/null and b/public/assets/original/smartroute.png differ diff --git a/public/assets/original/sorting-components.mp4 b/public/assets/original/sorting-components.mp4 new file mode 100644 index 0000000..214b496 Binary files /dev/null and b/public/assets/original/sorting-components.mp4 differ diff --git a/public/assets/original/teo-optimized.webp b/public/assets/original/teo-optimized.webp new file mode 100644 index 0000000..26dffdd Binary files /dev/null and b/public/assets/original/teo-optimized.webp differ diff --git a/public/assets/original/traffic.png b/public/assets/original/traffic.png new file mode 100644 index 0000000..92b0272 Binary files /dev/null and b/public/assets/original/traffic.png differ diff --git a/public/assets/original/waf.png b/public/assets/original/waf.png new file mode 100644 index 0000000..b23226d Binary files /dev/null and b/public/assets/original/waf.png differ diff --git a/public/assets/site.css b/public/assets/site.css new file mode 100644 index 0000000..3c5e288 --- /dev/null +++ b/public/assets/site.css @@ -0,0 +1,373 @@ +@font-face { + font-family: Geist; + src: url("/assets/geist.woff2") format("woff2"); + font-style: normal; + font-weight: 100 900; + font-display: swap; +} + +:root { + color-scheme: light; + --paper: #f5f7fb; + --white: #fff; + --ink: #111a2e; + --muted: #505d73; + --accent: #214ed7; + --accent-deep: #173bae; + --accent-light: #e8efff; + --navy: #101c34; + --line: #dbe3f0; + --radius: 1.125rem; + --space-section: clamp(4.25rem, 9vw, 8.5rem); + --edge: clamp(1.25rem, 5.3vw, 5.5rem); + --sans: Geist, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; + --mono: "SFMono-Regular", Consolas, monospace; + font: 400 100%/1.6 var(--sans); + color: var(--ink); + background: var(--white); +} + +*, *::before, *::after { box-sizing: border-box; } +html { scroll-behavior: smooth; scroll-padding-top: 6rem; } +body { margin: 0; } +[hidden] { display: none !important; } +img, video { display: block; max-width: 100%; } +img { height: auto; } +button, input, select, textarea { font: inherit; } +button { cursor: pointer; } +h1, h2, h3, h4, p, ul, ol { margin-top: 0; } +h1, h2, h3, h4 { line-height: 1.18; } +h1, h2 { text-wrap: balance; } +h1 { font-size: clamp(2.75rem, 6vw, 5.75rem); letter-spacing: -.055em; font-weight: 650; } +h2 { font-size: clamp(2rem, 4.15vw, 3.65rem); letter-spacing: -.042em; font-weight: 640; } +h3 { font-size: clamp(1.18rem, 2vw, 1.65rem); letter-spacing: -.024em; font-weight: 650; } +p { color: var(--muted); } +a { color: var(--accent); text-underline-offset: .23em; text-decoration-thickness: .075em; } +a:hover { color: var(--accent-deep); } +a, button, summary { -webkit-tap-highlight-color: transparent; } +:focus-visible { outline: 3px solid #4477f9; outline-offset: 4px; } +address { font-style: normal; } +.wrap { width: min(calc(100% - var(--edge) * 2), 82.5rem); margin-inline: auto; } +.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } +.skip-link { + position: fixed; + z-index: 20; + top: .8rem; + left: .8rem; + padding: .65rem 1rem; + border-radius: .45rem; + transform: translateY(-200%); + color: var(--ink); + background: var(--white); +} +.skip-link:focus { transform: translateY(0); } + +.masthead { position: sticky; z-index: 5; top: 0; background: var(--white); border-bottom: 1px solid var(--line); } +.masthead-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.25rem; min-height: 4.75rem; } +.wordmark { display: inline-flex; align-items: center; min-height: 44px; width: fit-content; } +.wordmark img { width: 8.125rem; height: auto; } +.primary-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1rem, 3vw, 2.75rem); } +.primary-nav a { min-height: 44px; display: grid; align-items: center; color: var(--muted); text-decoration: none; font-size: .9375rem; font-weight: 550; } +.primary-nav a:hover, .primary-nav a[aria-current] { color: var(--accent); } +.masthead-action { justify-self: end; } +.primary-nav .mobile-contact { display: none; } +.menu-toggle { display: none; } +.button { + min-height: 46px; + display: inline-flex; + align-items: center; + justify-content: center; + padding: .65rem 1.18rem; + border: 1px solid transparent; + border-radius: .62rem; + font-size: .9375rem; + font-weight: 640; + line-height: 1.25; + text-align: center; + text-decoration: none; + transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease; +} +.button:hover { transform: translateY(-2px); } +.button:active { transform: translateY(1px); } +.button-primary { color: white; background: var(--accent); border-color: var(--accent); } +.button-primary:hover { color: white; background: var(--accent-deep); border-color: var(--accent-deep); } +.button-outline { color: var(--ink); background: transparent; border-color: #c8d4e7; } +.button-outline:hover { color: var(--accent); background: var(--white); border-color: var(--accent); } +.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; } +.actions > a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; font-weight: 550; } +.overline { color: var(--accent); font-size: .875rem; font-weight: 650; letter-spacing: .075em; } + +.hero { background: var(--paper); border-bottom: 1px solid var(--line); } +.hero-inner { + display: grid; + grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); + align-items: center; + gap: clamp(1.6rem, 4vw, 4.5rem); + min-height: clamp(34rem, 48vw, 48rem); + padding-block: clamp(3.25rem, 7vw, 7rem); +} +.hero-home .hero-inner { + min-height: max(33.5rem, calc(100svh - 12rem)); + padding-block: clamp(3.25rem, 6vw, 6.75rem); +} +.hero-home { + background: radial-gradient(ellipse at 82% 42%, #e5edff 0, transparent 52%), #f5f7fb; +} +.hero-label { margin-bottom: 1.4rem; } +.hero h1 { margin-bottom: 1.5rem; text-wrap: initial; } +.hero h1 span { color: var(--accent); } +.hero-home h1 { font-size: clamp(3.2rem, 7.4vw, 7.3rem); line-height: 1.08; letter-spacing: -.09em; margin: 0 0 1.5rem -.065em; padding-right: .08em; } +.hero-lead { margin-bottom: 1.8rem; max-width: 35rem; font-size: clamp(1.03rem, 1.58vw, 1.28rem); line-height: 1.78; } +.hero-home .hero-lead { max-width: 28rem; } +.hero-actions .button { min-height: 50px; padding-inline: 1.35rem; } +.hero-visual { min-width: 0; position: relative; } +.hero-visual img { width: 100%; object-fit: contain; } +.hero-illustration { + isolation: isolate; + border: 1px solid #cad9f6; + border-radius: 1.8rem; + background: + radial-gradient(circle, #a9bce9 1px, transparent 1.3px) 0 0 / 20px 20px, + #eaf0fd; + padding: clamp(.45rem, 1.8vw, 1.7rem); + box-shadow: 0 22px 85px -44px #204dba65; +} +.hero-illustration img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 1.15rem; mix-blend-mode: multiply; } +.app-frame, .hero-service-art { + border: 1px solid #c9d7ef; + border-radius: var(--radius); + background: #e7eefd; + padding: clamp(.5rem, 1.4vw, 1.2rem); + box-shadow: 0 28px 60px -42px #204ea791; +} +.app-frame img, .hero-service-art img { border-radius: calc(var(--radius) / 2); } +.hero-pagepan .app-frame img, .hero-highspeaker .app-frame img { aspect-ratio: 16/9; object-fit: contain; height: auto; } +.hero-shnu-sc .hero-service-art img { aspect-ratio: 1916/821; object-fit: contain; height: auto; } +.hero-sc .hero-service-art img { aspect-ratio: 1586/992; object-fit: contain; height: auto; } +.hero-pagepan h1 { font-size: clamp(2.8rem, 6vw, 6.1rem); } +.hero-highspeaker h1 { font-size: clamp(2.7rem, 5.1vw, 5.05rem); } +.hero-sc, .hero-shnu-sc { background: #f7f8fb; } +.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; font-size: .9rem; color: var(--muted); margin-bottom: 1.35rem; } +.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--muted); } +.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; } +.crumb-divider { color: #74859d; } +.hero-directory { + display: grid; + grid-template-columns: minmax(0, .9fr) repeat(4, minmax(0, 1fr)); + border: 1px solid var(--line); + border-radius: .85rem .85rem 0 0; + background: #ffffffb8; + min-height: 7rem; + border-bottom: 0; +} +.hero-directory > * { display: flex; flex-direction: column; justify-content: center; gap: .12rem; padding: .75rem clamp(.6rem, 2vw, 1.85rem); } +.hero-directory a { color: var(--ink); text-decoration: none; border-inline-start: 1px solid var(--line); transition: background-color 160ms ease, color 160ms ease; } +.hero-directory a:hover { color: var(--accent); background: #fff; } +.hero-directory a span { font-size: 1.12rem; font-weight: 670; } +.hero-directory small { color: var(--muted); font-size: .875rem; } +.hero-copy, .hero-visual { animation: enter 560ms cubic-bezier(.2,.7,.3,1) both; } +.hero-visual { animation-delay: 80ms; } +@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } + +.section-nav { background: var(--white); border-bottom: 1px solid var(--line); } +.section-nav-inner { display: flex; flex-wrap: wrap; gap: .2rem clamp(1rem, 4vw, 2.8rem); padding-block: .3rem; } +.section-nav a { color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; font-size: .95rem; text-decoration: none; } +.section-nav a:hover { color: var(--accent); text-decoration: underline; } + +.section { padding-block: var(--space-section); } +.section + .section { border-top: 1px solid var(--line); } +.section-tinted, .network { background: var(--paper); } +.section-heading { margin-bottom: clamp(1.75rem, 4.3vw, 3.75rem); } +.section-heading h1, .section-heading h2 { margin: 0; } +.section-heading p { font-size: clamp(1.02rem, 1.55vw, 1.2rem); margin: .9rem 0 0; max-width: 45rem; } +.inline-heading { display: flex; flex-wrap: wrap; gap: .9rem 1.75rem; justify-content: space-between; align-items: center; } +.rich > :last-child, .rich article > :last-child, .rich article > div > :last-child { margin-bottom: 0; } +.rich h3 { margin-bottom: .65rem; } +.rich p { line-height: 1.78; } +.rich strong { color: var(--ink); } +.rich ul, .rich ol { padding-left: 1.3rem; } +.rich :where(a,img,video) { transition: transform 180ms ease, color 180ms ease; } +.rich a:not(.button):hover { text-decoration-thickness: .14em; } +.rich img { border-radius: .45rem; } +.rich > img { max-width: min(100%, 46rem); } +.rich > p:not([class]) { max-width: 47rem; } +.rich a > img:hover, .project > div:first-child:hover img { transform: scale(1.02); } +.project-stack { display: grid; gap: 2.15rem; } +.project { + display: grid; + grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); + align-items: center; + gap: clamp(1.4rem, 5vw, 5rem); + border: 1px solid var(--line); + border-radius: var(--radius); + padding: clamp(1rem, 2.4vw, 2.15rem); +} +.project:nth-child(even) { grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); } +.project:nth-child(even) > div:first-child { order: 2; } +.project > div:first-child { overflow: hidden; border-radius: .75rem; background: #edf2fe; } +.project img { width: 100%; border-radius: .75rem; } +.project h3 { font-size: clamp(1.7rem, 3.15vw, 3rem); margin: .55rem 0 .75rem; } +.project p { margin-bottom: 1rem; } +.section-about { position: relative; overflow: hidden; isolation: isolate; color: white; background: var(--navy); } +.section-about::before { + content: ""; + position: absolute; + z-index: -1; + inset: 0; + background: repeating-radial-gradient(circle at 90% 72%, transparent 0 33px, #5e8ff822 34px 35px, transparent 36px 60px), linear-gradient(135deg, #111f3b, #142b5f); + pointer-events: none; +} +.section-about.moment-active::before { animation: iris 900ms ease-out both; } +@keyframes iris { from { clip-path: circle(14% at 80% 60%); } to { clip-path: circle(100% at 70% 57%); } } +.section-about .section-heading { margin-bottom: 1.45rem; } +.section-about .rich p { color: #dbe7ff; font-size: clamp(1.2rem, 2.4vw, 1.7rem); max-width: 50rem; } +.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.65rem; } +.content-card { + border: 1px solid var(--line); + background: var(--white); + border-radius: var(--radius); + padding: clamp(1.15rem, 2.5vw, 2.1rem); + min-width: 0; + line-height: 1.65; +} +.content-card > img:first-child, .content-card > a:first-child img { width: 2.75rem; height: 2.75rem; object-fit: contain; margin-bottom: 1rem; } +.feature-card p { margin-bottom: .9rem; } +.feature-card a { display: inline-flex; align-items: center; min-height: 44px; } +.price-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); } +.price-card { display: flex; flex-direction: column; min-width: 0; } +.price-card h3 { margin-bottom: .55rem; } +.price-card .price-value { color: var(--accent); font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.15; margin: .4rem 0 .85rem; font-weight: 650; } +.price-value small { font-weight: 450; font-size: .9rem; color: var(--muted); } +.price-note { font-size: .875rem; } +.price-card ul { margin-block: .75rem 1.2rem; } +.price-card li + li { margin-top: .35rem; } +.price-card > .button, .price-card > .availability { margin-top: auto; align-self: start; } +.price-card .availability { color: var(--muted); font-size: .9rem; } +.contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } +.contact-card img { max-width: 10rem; } +.contact-card > img:first-child { width: 3rem; } +.contact-card a { min-height: 44px; display: inline-flex; align-items: center; } +.testimonials .content-card h3 + h3 { font-size: .96rem; color: var(--muted); font-weight: 500; } +.demo-row { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr); align-items: center; gap: 2.1rem; padding: 1.4rem 0; border-top: 1px solid var(--line); } +.demo-row video { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); } +.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: .85rem; background: var(--white); } +.table-scroll table { width: 100%; min-width: 39rem; border-collapse: collapse; text-align: left; font-size: .94rem; } +th, td { padding: .85rem 1rem; line-height: 1.55; vertical-align: top; border-bottom: 1px solid var(--line); } +th { font-weight: 650; } +thead { background: var(--accent-light); } +tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; } +.section-description, .fine-print { color: var(--muted); font-size: .9rem; } +.progress-note { margin-top: 1.75rem; max-width: 34rem; } +.progress-note label { display: block; margin-bottom: .6rem; font-weight: 600; } +progress { width: 100%; height: .8rem; accent-color: var(--accent); } +.contact-panel { display: flex; flex-wrap: wrap; gap: 1.4rem 3rem; align-items: center; } +.contact-panel img { width: 10rem; border: 1px solid var(--line); } +.resource-box { max-width: 46rem; } +.faq { max-width: 62rem; border-top: 1px solid var(--line); } +.faq details { border-bottom: 1px solid var(--line); } +.faq summary { cursor: pointer; padding: 1.05rem 2.5rem 1.05rem 0; min-height: 48px; position: relative; list-style: none; font-weight: 630; } +.faq summary::-webkit-details-marker { display: none; } +.faq summary::after { content: "+"; position: absolute; right: .5rem; top: .75rem; font-size: 1.4rem; color: var(--accent); } +.faq details[open] summary::after { content: "−"; } +.faq details > div { max-width: 55rem; padding-bottom: .95rem; } + +.article-list, .network-list { list-style: none; margin: 0; padding: 0; } +.article-row { display: grid; grid-template-columns: 5rem minmax(0, 1fr) auto; gap: .8rem 1.3rem; align-items: baseline; color: var(--ink); padding: 1.3rem .2rem; text-decoration: none; border-block-start: 1px solid var(--line); min-height: 55px; transition: background-color 160ms ease, transform 160ms ease; } +.article-list li:last-child .article-row { border-bottom: 1px solid var(--line); } +.article-row:hover { background: var(--paper); transform: translateY(-2px); } +.article-category { font-weight: 640; color: var(--accent); font-size: .875rem; } +.article-row-title { font-weight: 630; font-size: clamp(1.05rem, 2vw, 1.34rem); } +.article-row-title small { display: block; margin-top: .4rem; color: var(--muted); font-size: .93rem; font-weight: 400; } +.article-row time { color: var(--muted); font-size: .875rem; font-family: var(--mono); } +.network-group + .network-group { margin-top: 2.2rem; } +.network-group h3 { margin-bottom: .8rem; } +.network-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .7rem; } +.network-list li > * { display: flex; align-items: center; gap: .75rem; min-height: 4rem; height: 100%; border-radius: .65rem; background: var(--white); border: 1px solid var(--line); color: var(--ink); text-decoration: none; padding: .75rem; transition: transform 160ms ease, border-color 160ms ease; } +.network-list a:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); } +.network-list img { max-width: 3rem; max-height: 1.8rem; object-fit: contain; object-position: left; } +.network-list img[src$="oneprovider_invert.svg"] { background: #29354a; border-radius: .25rem; padding: .21rem; } +.article-page { min-height: 44vh; background: var(--white); } +.article-page h1 { font-size: clamp(2.45rem, 5.25vw, 4.7rem); } +.reading-wrap { max-width: 55rem; } +.back-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .95rem; font-weight: 600; } +.article-meta { display: flex; gap: 1.15rem; color: var(--muted); align-items: center; margin-block: 1rem .85rem; } +.prose { overflow-wrap: anywhere; } +.prose h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); margin-top: 2rem; } +.prose pre { overflow-x: auto; padding: 1rem; background: var(--paper); border-radius: .5rem; } +.prose code { font-family: var(--mono); } +.filter-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0; } +.filter-nav a { display: inline-flex; align-items: center; min-height: 44px; background: var(--paper); color: var(--muted); padding: .3rem .85rem; border: 1px solid var(--line); border-radius: .5rem; text-decoration: none; } +.filter-nav a:hover, .filter-nav a[aria-current] { color: var(--accent); background: var(--accent-light); border-color: #b8cafa; } +.pagination { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; } +.empty-state { background: var(--paper); padding: 1rem; border-radius: .6rem; } + +.site-footer { padding: clamp(2.5rem, 5.8vw, 5.5rem) 0 2rem; background: #edf2fa; border-top: 1px solid var(--line); } +.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, .75fr)); gap: 1.5rem 3rem; } +.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; } +.footer-grid a, .footer-meta a { color: var(--muted); text-decoration: none; overflow-wrap: anywhere; } +.footer-grid a:hover, .footer-meta a:hover { color: var(--accent); text-decoration: underline; } +.footer-grid a { min-height: 44px; display: inline-flex; align-items: center; } +.footer-company p, .footer-label { color: var(--ink); font-weight: 640; margin: .2rem 0 .35rem; } +.footer-company p { margin-top: .6rem; } +.footer-company address { color: var(--muted); max-width: 26rem; font-size: .95rem; } +.footer-meta { display: flex; flex-wrap: wrap; gap: .6rem 1.8rem; padding-top: 1.2rem; margin-top: 1.25rem; border-top: 1px solid var(--line); font-size: .875rem; } +.footer-meta p { margin: 0; } +.footer-terms { flex-basis: 100%; } + +@media (max-width: 62rem) { + .masthead-inner { gap: .85rem; } + .primary-nav { gap: clamp(.75rem, 2.3vw, 1.45rem); } + .hero-inner { min-height: 33rem; } + .hero-home .hero-inner { min-height: 32rem; } + .hero-directory { min-height: 6rem; } + .hero-directory a span { font-size: 1rem; } + .hero-directory small { font-size: .81rem; } + .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } +} +@media (max-width: 44rem) { + html { scroll-padding-top: 5rem; } + .masthead-inner { grid-template-columns: 1fr auto; min-height: 4rem; } + .masthead-action { display: none; } + .primary-nav .mobile-contact { display: grid; } + .primary-nav { grid-column: 1 / -1; justify-content: flex-start; } + .primary-nav.has-toggle { display: none; width: 100%; padding-bottom: .75rem; } + .primary-nav.has-toggle.is-open { display: grid; gap: .15rem; } + .primary-nav.is-open a { padding-inline: .65rem; } + .menu-toggle { display: grid; place-content: center; gap: 5px; width: 44px; height: 44px; padding: 0; background: white; border: 1px solid var(--line); border-radius: .5rem; } + .menu-toggle span:not(.sr-only) { display: block; width: 17px; height: 2px; background: var(--ink); border-radius: 1px; transition: transform 160ms ease; } + .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); } + .menu-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); } + .hero-inner, .hero-home .hero-inner { grid-template-columns: 1fr; min-height: auto; padding-block: 2.75rem 2.1rem; gap: 1.8rem; } + .hero-home h1 { font-size: clamp(3.25rem, 13vw, 5.5rem); } + .hero-label { margin-bottom: .85rem; } + .hero h1 { margin-bottom: 1rem; } + .hero-lead { margin-bottom: 1.3rem; } + .hero-illustration { border-radius: 1.15rem; } + .hero-illustration img { border-radius: .8rem; } + .hero-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .2rem; } + .hero-directory > .overline { grid-column: 1 / -1; } + .hero-directory a { border-top: 1px solid var(--line); min-height: 4rem; padding-inline: .8rem; } + .hero-directory a:nth-child(even) { border-inline-start: 0; } + .section-nav-inner { column-gap: 1.1rem; } + .section-nav a { font-size: .875rem; } + .project, .project:nth-child(even) { grid-template-columns: 1fr; gap: 1rem; } + .project > div:first-child, .project:nth-child(even) > div:first-child { order: 2; } + .card-grid { grid-template-columns: 1fr; } + .demo-row { grid-template-columns: 1fr; gap: .55rem; } + .article-row { grid-template-columns: minmax(0, 1fr) auto; } + .article-category { grid-column: 1; grid-row: 1; } + .article-row-title { grid-column: 1 / -1; grid-row: 2; } + .article-row time { grid-column: 2; grid-row: 1; } + .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; } + .footer-company { grid-column: 1 / -1; } +} +@media (max-width: 23rem) { + .hero-actions .button { width: 100%; } + .hero-highspeaker h1 { font-size: clamp(2.4rem, 12vw, 2.7rem); } +} +@media (prefers-reduced-motion: reduce) { + *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } +} + +.payment-methods { display: flex; gap: .65rem; align-items: center; margin-block: .5rem; } +.payment-methods img { width: 1.625rem; height: 1.625rem; object-fit: contain; } diff --git a/public/assets/site.js b/public/assets/site.js new file mode 100644 index 0000000..f2bc2f4 --- /dev/null +++ b/public/assets/site.js @@ -0,0 +1,44 @@ +'use strict'; + +const toggle = document.querySelector('.menu-toggle'); +const nav = document.querySelector('.primary-nav'); +if (toggle && nav) { + toggle.hidden = false; + nav.classList.add('has-toggle'); + + const closeMenu = () => { + toggle.setAttribute('aria-expanded', 'false'); + nav.classList.remove('is-open'); + }; + + toggle.addEventListener('click', () => { + const open = toggle.getAttribute('aria-expanded') === 'true'; + if (open) { + closeMenu(); + } else { + toggle.setAttribute('aria-expanded', 'true'); + nav.classList.add('is-open'); + } + }); + + nav.addEventListener('click', closeMenu); + document.addEventListener('keydown', (event) => { + if (event.key === 'Escape' && toggle.getAttribute('aria-expanded') === 'true') { + closeMenu(); + toggle.focus(); + } + }); +} + +if ('IntersectionObserver' in window && !matchMedia('(prefers-reduced-motion: reduce)').matches) { + const observer = new IntersectionObserver((entries) => { + for (const entry of entries) { + if (entry.isIntersecting) { + entry.target.classList.add('moment-active'); + observer.unobserve(entry.target); + } + } + }, {threshold: 0.35}); + + document.querySelectorAll('[data-moment]').forEach((section) => observer.observe(section)); +} diff --git a/public/assets/wordmark.webp b/public/assets/wordmark.webp new file mode 100644 index 0000000..580cfcb Binary files /dev/null and b/public/assets/wordmark.webp differ diff --git a/resources/schema.sql b/resources/schema.sql new file mode 100644 index 0000000..eb9a754 --- /dev/null +++ b/resources/schema.sql @@ -0,0 +1,60 @@ +CREATE TABLE IF NOT EXISTS site_settings ( + id INTEGER PRIMARY KEY CHECK (id = 1), + payload TEXT NOT NULL +); +CREATE TABLE IF NOT EXISTS pages ( + slug TEXT PRIMARY KEY, + name TEXT NOT NULL, + title TEXT NOT NULL, + description TEXT NOT NULL, + heading TEXT NOT NULL, + accent TEXT NOT NULL, + lead TEXT NOT NULL, + image TEXT NOT NULL, + alt TEXT NOT NULL, + actions TEXT NOT NULL, + quicklinks TEXT NOT NULL, + partners TEXT NOT NULL, + updated_at TEXT, + version INTEGER NOT NULL DEFAULT 0 +); +CREATE TABLE IF NOT EXISTS sections ( + page_slug TEXT NOT NULL REFERENCES pages(slug) ON DELETE CASCADE, + key TEXT NOT NULL, + title TEXT NOT NULL, + lead TEXT NOT NULL, + style TEXT NOT NULL DEFAULT 'plain', + body TEXT NOT NULL, + position INTEGER NOT NULL, + version INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (page_slug, key) +); +CREATE TABLE IF NOT EXISTS articles ( + id INTEGER PRIMARY KEY, + slug TEXT NOT NULL UNIQUE, + title TEXT NOT NULL, + category TEXT NOT NULL CHECK (category IN ('announcement','news','product')), + summary TEXT NOT NULL, + body TEXT NOT NULL, + tags TEXT NOT NULL, + status TEXT NOT NULL CHECK (status IN ('draft','published')), + published_at TEXT, + updated_at TEXT NOT NULL, + legacy_path TEXT UNIQUE, + version INTEGER NOT NULL DEFAULT 0 +); +CREATE INDEX IF NOT EXISTS articles_public ON articles (status, published_at DESC, id DESC); +CREATE TABLE IF NOT EXISTS article_redirects ( + slug TEXT PRIMARY KEY, + article_id INTEGER NOT NULL REFERENCES articles(id) ON DELETE CASCADE +); +CREATE TABLE IF NOT EXISTS users ( + id INTEGER PRIMARY KEY, + email TEXT NOT NULL UNIQUE COLLATE NOCASE, + password_hash TEXT NOT NULL +); +CREATE TABLE IF NOT EXISTS login_attempts ( + address TEXT PRIMARY KEY, + attempts INTEGER NOT NULL, + expires_at INTEGER NOT NULL +); diff --git a/resources/seed.json b/resources/seed.json new file mode 100644 index 0000000..2987d90 --- /dev/null +++ b/resources/seed.json @@ -0,0 +1,483 @@ +{ + "site": { + "name": "上海来笙信息科技有限公司", + "email": "public@laysense.cn", + "address": "中国(上海)自由贸易试验区世博村路231号2单元3层328室", + "registration": "沪ICP备2024051698号-1", + "copyright": "© Shanghai Laysense Information Technology Co. Ltd.", + "terms": "本网站中产品价格仅作展示,不作为订立合同、邀约或要约邀请的有效因素。" + }, + "pages": [ + { + "slug": "home", + "name": "来笙 Laysense", + "title": "来笙 Laysense|互联网基础软件与开发者工具", + "heading": "构建更好", + "accent": "互联网", + "description": "上海来笙信息科技有限公司研发互联网基础软件和开发者工具,提供 PAGEPAN 可视化建站、HighSpeaker 智能 DNS 和软件著作权代理服务。", + "lead": "来笙研发互联网基础软件与开发者工具,提供自托管建站、智能 DNS 和软件著作权服务。", + "image": "/assets/original/home-hero.webp", + "alt": "", + "actions": [ + [ + "/#product", + "浏览产品与服务" + ], + [ + "/#about", + "了解来笙" + ] + ], + "quicklinks": [], + "sections": [ + { + "key": "product", + "title": "产品与服务", + "lead": "", + "body": "
\"PAGEPAN
可视化建站

PAGEPAN 小飞页

自托管拖拽建站工具。由 UI 中国签约的飞屋设计团队打造,可在自己的服务器上运行。

无需代码,五分钟 DIY 网站,每一处细节都可定制。提供永久免费版本,VIP 版本最低 ¥79/年。

\"HighSpeaker
开源基础软件

HighSpeaker DNS

新一代智能 DNS 系统。企业和云服务商可以私有化或内网部署,也可二次开发,提供多租户、可分销的 SaaS 服务。

100% 开源免费。

探索 HighSpeaker
", + "style": "projects" + }, + { + "key": "about", + "title": "关于来笙", + "lead": "", + "body": "

来笙是由上海师范大学、华东理工大学、沈阳建筑大学、华南师范大学等多所高校学生发起的合作跨校的自主创业项目。致力于提供独特、优质的企行业软件和面向开发者的个人工具软件。

来笙致力于通过研发互联网基础软件和产品,解决互联网基础产品痛点痒点,为构建更好互联网持续做出努力。

", + "style": "about" + } + ], + "partners": [ + { + "name": "HighSpeaker DNS", + "image": "/assets/original/highspeaker-logo-optimized.webp", + "url": "/highspeaker", + "group": "来笙支持项目" + }, + { + "name": "FW Network", + "image": "/assets/original/fw-banner.svg", + "url": "https://fw.ac.cn/", + "group": "来笙合作伙伴" + }, + { + "name": "IdealShark", + "image": "/assets/original/IdealShark_B.png", + "url": "", + "group": "来笙支持项目" + }, + { + "name": "MimirLib", + "image": "/assets/original/mimirlib.png", + "url": "", + "group": "来笙支持项目" + }, + { + "name": "NoNat", + "image": "/assets/original/nonat-optimized.webp", + "url": "https://nonat.eu.org/", + "group": "来笙支持项目" + }, + { + "name": "PAGEPAN", + "image": "/assets/original/papepan-logo.svg", + "url": "https://pagepan.com/", + "group": "来笙合作伙伴" + }, + { + "name": "LayFi", + "image": "", + "url": "https://www.layfi.de", + "group": "来笙支持项目" + }, + { + "name": "OneProvider", + "image": "/assets/original/oneprovider_invert.svg", + "url": "https://oneprovider.com/", + "group": "来笙合作伙伴" + } + ] + }, + { + "slug": "pagepan", + "name": "PAGEPAN 小飞页", + "title": "PAGEPAN 小飞页|自托管可视化建站工具 · 来笙", + "heading": "PAGEPAN", + "accent": "小飞页", + "description": "无需代码,通过拖拽组件搭建响应式网站。查看 PAGEPAN 功能演示、价格、免费下载和企业微信购买方式。", + "lead": "无需代码,用可视化编辑器把设计变成响应式网站。由 UI 中国签约的飞屋设计团队打造,30 个页面以内永久免费。", + "image": "/assets/original/pagepan-editor-optimized.webp", + "alt": "PAGEPAN 可视化编辑器产品界面", + "actions": [ + [ + "#download", + "免费下载" + ], + [ + "#pricing", + "查看版本与价格" + ] + ], + "quicklinks": [ + [ + "#demo", + "功能演示" + ], + [ + "#features", + "工具与功能" + ], + [ + "#pricing", + "版本与价格" + ], + [ + "#download", + "下载与购买" + ] + ], + "sections": [ + { + "key": "demo", + "title": "拖拽组件,做出一个网站", + "lead": "编辑、排序和定制组件,所见即所得。", + "body": "

拖入组件

几百种组件,五秒钟拖入,所见即所得

编辑组件

就像在用Word一样,随时编辑,所见即所得,没有任何上手的技术成本!

排序组件

拖拽随心排序,妈妈再也不用看我改HTML到头皮发麻了!

组件元素

如同在用Word的插入功能和编辑功能。强大编辑器让你无需一行代码就可以对页面里的所有内容尽情进行定制和修改!

", + "style": "demos" + }, + { + "key": "features", + "title": "建站工具与功能", + "lead": "", + "body": "\"用

字体管理器

\n

几千种开源字体随意添加选用。附带字体压缩功能和缓存器功能,再也不用为加载字体付出高额流量费!

文件管理器

\n

什么年代了还需要FTP?不存在的。图片、文档、视频、压缩包,全都由可视化的文件管理器来管理,随时取用~

代码编辑器

\n

PAGEPAN已经不能满足你了?没关系。每一个组件,包括公共页头页脚你都可以打开Html编辑器修改其代码,依旧所见即所得。你甚至可以编写PHP脚本。

COS、CDN

\n

可以将所有静态内容传入腾讯云COS,或接入任意CDN。让你的网站快如闪电!

Sitemap一键生成

\n

自动挖掘Sitemap,一键即可生成!

All for SEO

\n

SEO优化友好,加快网站收录速度。

动态组件(CMS)

\n

无论是新闻、列表、博客、文章、产品,都可以通过动态内容来实现类似于CMS的体验。支持Html和Markdown双编辑器自由切换。不是CMS,但是超越CMS!

渐变色调色器

\n

自带渐变调色器。任何组件任何文字都可以设置为魅力十足的渐变色。

多语言支持

\n

一个站点,多种语言,任意切换,实现面向全球!

访问 PAGEPAN 官网

", + "style": "plain" + }, + { + "key": "pricing", + "title": "版本与价格", + "lead": "", + "body": "

免费版

¥0

    \n
  • \n30个页面自由拼装\n
  • \n
  • \n社群快速响应\n
  • \n
  • \n拖放组件灵活布局页面\n
  • \n
  • \n一键升级到最新版本\n
  • \n提供部分模板\n
  • \n
免费使用

年付版

官网价:¥99/年 -20/年

¥79 /年/域名[ 限时优惠 ]

    \n
  • \n无限页面自由拼装\n
  • \n
  • \n社群快速响应\n
  • \n
  • \n拖放组件灵活布局页面\n
  • \n
  • \n一键升级最新版本\n
  • \n
  • \n动态组件更快完成页面\n
  • \n
  • \n利用已有的模板快速建站\n
  • \n
  • \n一对一服务快速解决问题\n
  • \n
现在购买

永久版

官网价:¥699 -¥130

¥569 /每域名授权

    \n
  • \n无限页面自由拼装\n
  • \n
  • \n社群快速响应\n
  • \n
  • \n拖放组件灵活布局页面\n
  • \n
  • \n一键升级最新版本\n
  • \n
  • \n动态组件更快完成页面\n
  • \n
  • \n利用已有的模板快速建站\n
  • \n
  • \n一对一服务快速解决问题\n
  • \n
现在购买

SaaS*

By London LayCat Ltd

$5.9 /月

    \n
  • \n年付版全部权益\n
  • \n
  • \n100%托管,无需运维和安装\n
  • \n
  • \n服务器位于法国·巴黎\n
  • \n
  • \n免费全球CDN服务\n
  • \n
  • \n高达1Gbps宽带\n
  • \n
  • \n免备案\n
  • \n
现在购买

*    SaaS的服务器等由London LayCat Ltd.提供,与上海来笙信息科技有限公司无关。我司仅提供混合权益下的软件授权。 Saas服务中的CDN为按年付费赠送,流量限制为每年200G。目前由Bunny Network提供。节点涵盖了全球6大洲的77个国家。 服务器具体配置和位置可能因库存而调整,具体以付款时为准。1Gbps宽带为合理共享。 免备案指使用境外服务器开设网站目前无需进行ICP备案。 请注意SaaS服务价格以美元(USD)计算。

", + "style": "tinted" + }, + { + "key": "licensing", + "title": "混合权益与批量授权", + "lead": "", + "body": "\n

当您在Laysense来笙或London LayCat Ltd.购买指定且足额商品时,都可以以更实惠的价格购买Pagepan混合权益的授权。
*请注意,使用了混合权益的订单无法退款。且混合权益授权的续订必须与原订单共同续订、不可独立续订。

\n

一次购买5个域名或以上的永久授权,价格为¥459/域名
该批量授权仅适用企业,且不允许更改域名授权绑定。
价格仅供参考,请与我们联系获取报价。

Laysense 混合权益

¥59 /年

购买任意Laysense软件授权超过一年,且价格高于¥200时可以¥59/年加购PAGEPAN混合权益。

现在购买

LayCat 混合权益

$0.99 /月

于LayCat购买任意VPS、CVM、Nat-VPS、LightVM、物理服务器时都可以以$0.99/月架构PAGEPAN混合权益

现在购买
", + "style": "plain" + }, + { + "key": "download", + "title": "下载与购买", + "lead": "", + "body": "
  • \n\n\n\"\"\n\n\n

    免费下载
    用得爽再付款,
    0成本感受PAGEPAN的魅力!

    \n

    点击下方链接您即可前往下载Pagepan。无需任何费用免费体验Pagepan的强大能力——直到您觉得值得为此付费。
    *请注意,通过Pagepan后台付费将以官网原价付费,无法享受Laysense优惠价格和混合权益。

    \n下载安装文件 >>\n\n\n
  • \n\n\n\"\"\n\n\n

    立即购买
    以最优惠的价格
    快速实现个人品牌的展现

    \n

    通过企业微信与我们的客服人员交谈,选择购买的类型,并在线付款、享受企业微信1对1服务。
    不定期掉落大额优惠哦~

    \n企业微信咨询 >>
    \n或 手机微信扫码一键咨询:\n
    \"\"
    \n\n
  • ", + "style": "tinted" + } + ] + }, + { + "slug": "highspeaker", + "name": "HighSpeaker DNS", + "title": "HighSpeaker 高声语|开源智能 DNS 系统 · 来笙", + "heading": "HighSpeaker", + "accent": "高声语 DNS", + "description": "可私有化部署的开源智能 DNS,支持运营商和地域解析、容灾热备、ECS、IPv6、中文域名及 1 秒 TTL。查看源码、下载和商业支持。", + "lead": "面向下一代互联网的开源智能 DNS 系统。支持私有化部署、智能解析以及最低 1 秒 TTL。", + "image": "/assets/original/highspeaker-ui-optimized.webp", + "alt": "HighSpeaker DNS 后台管理界面", + "actions": [ + [ + "#get", + "获取 HighSpeaker" + ], + [ + "https://git.laysense.com/Laysense/HighSpeaker", + "查看源码" + ] + ], + "quicklinks": [ + [ + "#features", + "产品功能" + ], + [ + "#pricing", + "版本价格" + ], + [ + "#comparison", + "方案对比" + ], + [ + "#get", + "下载与源码" + ] + ], + "sections": [ + { + "key": "features", + "title": "智能 DNS 功能", + "lead": "", + "body": "
  • \n\"\"\n

    智能分线路解析

    \n

    可基于运营商,为不同运营商的用户设置不同的响应结果。

    \n
  • \n\"\"\n

    智能地域解析

    \n

    可以获取IPGeo数据,直接计算经纬度,响应物理距离最近的IP。

    \n
  • \n\"\"\n

    容灾与热备

    \n

    当某一记录被检测到宕机后,可以自动进行切换,保障可用性。

    \n
  • \n\"\"\n

    流量统计

    \n

    可对出、入数量和流量进行统计。

    \n
  • \n\"\"\n

    防止Ddos

    \n

    可自动对短时间内多次重复请求的IP进行封禁,防止Ddos攻击。

    \n
  • \n\"\"\n

    IPv6、中文域名支持

    \n

    全面支持中文域名,支持IPv6。

    \n
  • \n\"\"\n

    基于Redis和SQL数据库

    \n

    抛弃传统Zone配置文件,仅需操作数据库即可进行配置,简化学习成本和维护流程。

    \n
  • \n\"\"\n

    1秒TTL

    \n

    本系统最低可以实现1秒的TTL值。

    \n
  • \n\"\"\n

    ECS协议支持

    \n

    本系统支持识别EDNS Client Subnet(ECS)扩展协议,可供获取用户真实IP网段。

    \n
  • \n\"\"\n

    内存二进制缓存

    \n

    本系统自动识别常用请求,直接以二进制形式写入Redis数据库(内存),加快响应速度。

    \n
  • \n\"\"\n

    记录重写覆盖

    \n

    作为LDNS时,可设置黑名单,对名单内域名重写或覆盖,以保护本地网络,防止访问不良网站。

    \n
  • \n\"\"\n

    十万级每秒响应*

    \n

    最高每秒14万次响应、超越AdGuardHome,达到国际顶级水准。

    \n
  • 网之基,高声语 · 拓展边缘智能。

    每秒响应为来笙实验室数据,查看压力测试结果。

    ", + "style": "plain" + }, + { + "key": "pricing", + "title": "版本与价格", + "lead": "我们在不断的完善HighSpeaker,并且不定期推送更新你只需要登录到后台一键就可以完成升级。", + "body": "

    HighSpeaker

    ¥0 /年

    目前免费开源,任何人都可以使用

      \n
    • \n\n智能解析与监控系统\n
    • \n
    • \n\n无域名数量限制\n
    • \n
    • \n\n1秒TTL\n
    • \n
    • \n\nIPv6和中文域名支持\n
    • \n
    免费使用

    HighSpeaker Pro

    ¥599 /月

    为SaaS厂商和大型公司打造

      \n
    • \n\n多用户与SaaS化\n
    • \n
    • \n\n权限管理控制\n
    • \n
    • \n\n多机多节点集群部署\n
    • \n
    • \n\nAI智能解析\n
    • \n
    • \n\nSpeedWow性能遥测\n
    • \n
    • \n\nDNSSec支持\n
    • \n
    即将推出
    ", + "style": "tinted" + }, + { + "key": "support", + "title": "商业支持服务", + "lead": "额外提供的商业化支持服务", + "body": "

    商业支持计划 (按年售卖)

    ¥399 /月

    每月最多8小时的支持服务

      \n
    • \n\n8H内快速响应\n
    • \n
    • \n\n1V1技术客服服务\n
    • \n
    • \n\n每月最多8小时远程支持\n
    • \n

    远程支持服务 (单次)

    ¥199 /小时

    每月最多8小时的支持服务

      \n
    • \n\n远程技术支持\n
    • \n
    • \n\n代运维、安装、修改、优化\n
    • \n

    托管运维 (按年售卖)

    ¥1599 /年

    100%全托管式运维服务

      \n
    • \n\n只需要提供服务器和基础设施\n
    • \n
    • \n\n从安装到配置到部署,100%全托管\n
    • \n
    • \n\n1V1专员服务\n
    • \n
    ", + "style": "plain" + }, + { + "key": "comparison", + "title": "DNS 方案对比", + "lead": "", + "body": "
    \"\"

    HighSpeaker

    ¥1599 /年(商业托管)

      \n
    • \n\n无限域名和记录数量\n
    • \n
    • \n\n本地部署、内网部署\n
    • \n
    • \n\n运营商、地域解析\n
    • \n
    • \n\n国内外均细分至城市\n
    • \n
    • \n\n1秒最低TTL\n
    • \n
    • \n\n最低15秒监控频率\n
    • \n\nPHP脚本定制响应\n
    • \n
    • \n\n全托管服务\n
    • \n
    \"\"

    WdDNS

    ¥9800 /年(旗舰版)

      \n
    • \n\n无限域名和记录数量\n
    • \n
    • \n\n本地部署、内网部署\n
    • \n
    • \n\n运营商、地域解析\n
    • \n
    • \n\n国外只细分到国家\n
    • \n
    • \n\n60秒最低TTL\n
    • \n\n最低30秒监控频率\n
    • \n
    • \n\n策略定制响应\n
    • \n
    • \n\n人工服务\n
    • \n
    \"\"

    DNSPOD

    ¥9000 /年/5个域名

      \n
    • \n    每个域名1800元/年\n
    • \n
    • \n\n云托管,不能内网访问\n
    • \n
    • \n\n运营商、地域解析\n
    • \n
    • \n\n国内到省,国外到州\n
    • \n
    • \n\n1秒最低TTL\n
    • \n\n最低1分钟监控频率\n
    • \n\n无法定制响应\n
    • \n
    • \n\n人工服务\n
    • \n
    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
     HighSpeakerBind9CoreDNSWdDNSDNSPOD
    (SaaS)
    使用价格¥0/年(开源免费)¥0/年(开源免费)¥0/年(开源免费)¥9800/年¥9000/年/5域名
    基础解析支持支持支持支持支持
    监控系统支持不支持不支持支持支持
    智能解析支持需二次开发需插件支持支持
    自定义API支持需二次开发需自行开发插件不支持不支持
    自定义
    PHP脚本
    支持需二次开发需自行开发插件不支持不支持支持
    智能解析基于IPGeo
    延迟、可用性
    经纬度距离
    自定义后端API
    自定义PHP脚本
    需二次开发需自行开发插件IPGeo
    延迟、可用性
    自定义策略
    IPGeo
    延迟、可用性
    部署方式内外网均可
    Docker、二进制、源码
    无需安装,一键启动
    内外网均可
    需要编译、安装
    安装配置复杂
    内外网均可
    二进制或Docker 
    内外网均可
    提供安装脚本
    仅公网可用
    无需安装(SaaS)
    管理方式简单直观的WebGUI
    以及API
    需要编写复杂的配置文件需要编写复杂的配置文件
    WebGUIWebGUI
    商业支持1599/年$5000起/年不提供已包含在内已包含在内
    ", + "style": "tinted" + }, + { + "key": "registration", + "title": "软件著作权登记", + "lead": "", + "body": "\"HighSpeaker", + "style": "plain" + }, + { + "key": "get", + "title": "获取 HighSpeaker", + "lead": "即刻体验面向下一代互联网的 DNS 系统。", + "body": "

    操作系统建议:AlmaLinux 9.2。需求环境:PHP 8.0、Redis 6+、MySQL 8+。

    ", + "style": "tinted" + } + ] + }, + { + "slug": "sc", + "name": "软著代理", + "title": "软件著作权代理服务|材料审核与申请 · 来笙", + "heading": "软件著作权", + "accent": "代理服务", + "description": "来笙提供软件著作权登记代理、材料审核与材料撰写服务,支持合作开发申请,代理申请服务 ¥120 起。", + "lead": "从材料审核到登记申请,来笙提供三档软件著作权服务。已有代码和材料的代理申请方案 ¥120 起。", + "image": "/assets/original/copyright.webp", + "alt": "来笙软件著作权代理服务插图", + "actions": [ + [ + "#pricing", + "查看服务报价" + ], + [ + "/shnu-sc", + "查看 SHNU 学生方案" + ] + ], + "quicklinks": [ + [ + "#materials", + "申请材料" + ], + [ + "#pricing", + "服务报价" + ], + [ + "#faq", + "常见问题" + ], + [ + "#go", + "微信咨询" + ] + ], + "sections": [ + { + "key": "materials", + "title": "申请软著需要哪些材料", + "lead": "", + "body": "

    3000行代码

    3000行以上可以运行的代码是申请软著的基础。

    制作代码文档

    按照特定排版要求排版代码形成代码文档。

    30页用户指南

    除此之外您还需要撰写30页以上的用户手册。

    合作开发合同+文书

    最后如果您是多人合作开发,您还需要编写并签署合作开发合同。此外您还需要一系列文书材料。

    ", + "style": "plain" + }, + { + "key": "why", + "title": "为什么选择来笙", + "lead": "", + "body": "

    手工DIY

    \n

    申请需要繁琐的材料。
    一旦有所错漏哪怕格式不对、甚至点错了按钮,都会造成补正。
    一次补正就要重新排队,至少延迟两周时间。

    其他著作权代理商

    \n

    经常收取高额费用,声称提供所谓“加急”服务
    实则经常盗用各种开源软件、AI代码。
    一旦被版权中心查实,面临终生黑名单,得不偿失!部分黑心商家还收合作申请费!

    选择来笙

    \n

    最低仅需¥120元起,替您处理和审查、优化材料。不收取任何加急费,所有申请均最快60日内下证。
    不收取合作申请费,可多人一起申请。

    ", + "style": "tinted" + }, + { + "key": "options", + "title": "按准备进度选择服务", + "lead": "", + "body": "
  • \n\n\"\"\n

    我已经有项目了!

    \n

    仅需一本书的价格,来笙直接帮您搞定软著!为您全程提供申请代理+材料指导+审核优化,最快60天拿证书!

    \n代理申请服务\n\n
  • \n\n\"\"\n

    我会写代码!

    \n

    无需头疼各种麻烦的材料和手续,来笙为您一次性做齐所有材料,包您下证!

    \n无忧申请\n\n
  • \n\n\"\"\n

    啥也不会也没事!

    \n

    从代码到材料,来笙替您一站式解决。即使不会写代码也能拿到软著!

    \n一价全包\n\n
  • ", + "style": "plain" + }, + { + "key": "pricing", + "title": "服务方案与价格", + "lead": "三种方案,支持多人合作申请。", + "body": "

    代理申请服务

    ¥120 /次

    已有代码和材料,提供申请代理

      \n
    • \n\n代理申请,直至下证\n
    • \n
    • \n\n材料编写辅导\n
    • \n
    • \n\n材料审核优化\n
    • \n
    • \n\n支持合作申请,无额外收费\n
    • \n\n合作申请提供合同模板\n
    • \n\n最快60天下证\n
    • \n
    立刻开始

    无忧申请

    ¥399 /次

    仅有代码,提供申请代理+材料全包式撰写

      \n
    • \n\n代理申请,直至下证\n
    • \n
    • \n\n材料全包代写代办\n
    • \n
    • \n\n支持合作申请,无额外收费\n
    • \n\n合作申请提供合同模板\n
    • \n\n仅需代码,最快60天下证\n
    • \n
    立刻开始

    一价全包

    ¥999 /次

    什么都没?不会代码?来笙替您解决一切

      \n
    • \n\n躺平等下证\n
    • \n
    • \n\n所有资料由来笙提供\n
    • \n
    • \n\n支持合作申请,无额外收费\n
    • \n\n合作申请提供合同模板\n
    • \n\n仅需代码,最快60天下证\n
    • \n
    立刻开始
    ", + "style": "tinted" + }, + { + "key": "fees", + "title": "收费明细", + "lead": "", + "body": "
    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    收费项目备注报价
    申请咨询咨询软著相关事项和材料¥40/次
    包含在上述所有价格包内
    申请代理由来笙代理您的申请
    直至下证
    ¥40/次
    包含在上述所有价格包内
    加急服务来笙不收取任何所谓加急费
    所有申请一律最快60天内下证
    ¥0/次
    合作申请来笙不收取任何所谓的多人合著申请费¥0/次
    申请材料
    审核优化
    由来笙专业技术团队审核并优化您的申请材料
    助您顺畅申请,防止补正
    ¥80/次
    包含在上述所有价格包内
    合作申请
    合同模板
    提供版权中心认可的合作申请模板¥60/次
    包含在上述所有价格包内
    申请材料
    代写
    来笙专业技术团队为您编纂提供包含用户指南在内的申请材料¥280/次
    包含在无忧申请和一价全包中
    ", + "style": "plain" + }, + { + "key": "faq", + "title": "常见问题", + "lead": "", + "body": "
    申请软著有什么好处?

    软件著作权登记证书可以作为软件成果的正式登记凭证。对学生来说,它常用于创新学分认定、综测或评优材料、简历成果展示;对后续发展来说,也可以用于 APP 上架、项目结项、职称评审、成果证明和维权举证等场景。
    需要注意的是,创新学分、综测加分、评优加分等均以学校、学院当期规则和最终审核结果为准。

    \n

    SHNU 同学拿到软著后,一定能认定创新学分吗?

    \n

    不是“拿证 = 自动拿分”。以现行通知来说,软件著作权属于“专利(著作权)授权”相关成果,学生需要按学校要求在系统中提交登记证书等佐证材料,并通过学校最终审核后才能认定。不同年级、不同学院、不同学期的规则可能有变化,建议在申请前先确认自己所在学院和当学期通知。

    申请软著通常需要哪些材料?

    一般需要软件著作权登记申请表、软件鉴别材料和相关证明文件。软件鉴别材料通常包括源程序和软件文档;如果是多人合作开发,还需要明确合作开发关系和权属安排。国家版权局《计算机软件著作权登记办法》规定,软件鉴别材料包括程序和文档,通常由源程序和任一种文档的前、后各连续 30 页组成;不足 60 页的,提交全部材料。

    \n

    简单来说就是:

    \n

    60页代码(中心规定每页不少于50行,即3000行)

    \n

    30~60页文档

    \n

    合作开发合同

    \n

    其他杂项文书、签章签字页

    大概多久可以下证?

    软著登记不是即时出证。根据《计算机软件著作权登记办法》,中国版权保护中心应当自受理日起60个工作日内审查完成;符合规定的,予以登记并发证公告。

    \n

    实际耗时跟据我们的案件经历,跟据版权中心的处理速度不同、案件项目复杂性不同,从30天~90多天的都有。其中涉及节假日(如五一、国庆、春节)则时间还会进一步延长。但绝大多数案件都在60天内完成。

    \n

    我们页面中所说的“最快 60 天”是根据过往案例和正常流程作出的经验判断,实际时间仍会受版权中心审核进度、材料质量、是否补正等因素影响,不构成绝对承诺。

    多人合作申请会额外收费吗?

    不会。来笙不收取所谓“合作申请费”。多人合作申请时,我们可以免费协助整理合作开发信息,并免费提供合作开发合同模板。

    \n

    无论几名著作权人申请,来笙都只收取相同的费用。

    \n

    但多人申请前需要提前确认每位作者的信息、署名顺序、贡献情况和权属比例,避免后续出现权属争议。

    不会代码真的也可以吗?

    我们坚决反对著作权证书的交易、买卖。

    \n

    我们将为您提供来笙低代码平台,按照您的思路原创性地设计一款APP/网页。并辅助您完成从零开始的项目协助。不需要您有程序功底或经验。

    如果申请失败怎么办?

    我们会在服务开始前先做基础可行性判断,明显不符合登记条件或存在权属风险的项目,不建议提交。

    \n

    如果因材料格式或表述问题出现补正,我们会协助修改和继续跟进;如果因您提供虚假信息、权属争议、侵权代码、第三方材料不合规等原因导致无法登记,则需根据具体情况处理。

    \n

    版权登记是一件较为复杂的事情,我们无法保障100%成功。但如若因我们的材料导致无法成功申请,我们可以提供全额退款。

    下证后我会拿到什么?

    登记完成后,您会获得软件著作权登记证书。目前所有软件著作权证书均为电子证书。

    \n

    来笙作为申请代理仅能取得没有数字签名的“副本”,您可以在申请成功后登录版权中心自行下载带有版权中心数字签名、有法律效益的“正本”。

    \n

    您可以将其用于学校创新学分申请、综测或评优材料、简历展示、APP 上架、项目成果证明等场景。

    \n

    但所有外部用途均以对应平台、学校、学院、单位或评审机构的最终审核规则为准。

    证书上的著作权人可以写谁?可以和我的舍友/npy一起申请吗?

    可以根据实际情况写个人、多人、单位或合作开发主体,但必须真实反映软件的开发和权属关系。合作开发的软件可以由全体著作权人协商确定代表办理,但仍应注明其他著作权人。

    \n

    具体而言,如果舍友/npy参与了开发过程,在协商一致的情况下,当然可以共同申请。来笙亦不会收取额外的费用。

    \n

    对 SHNU 同学而言,还需要注意学校对“著作权人”和佐证材料的具体要求。软件著作权的著作权人可为“SHNU”或学生本人姓名;若著作权人为学校,还需提供可证明申请人为本人的其他佐证材料。我们一般推荐直接使用姓名。但若评定创新学分还需要注意前三位和其他成员具体分值不同。

    什么是补正?会不会被补正?后果是什么?

    常见补正原因包括软件名称和版本号不一致、代码或文档格式不符合要求、申请表填写不规范、签名错误或不可识别、合作开发权属不清、材料前后表述矛盾等。

    \n

    常见造成补正的大部分都是申请表、申请材料填写不规范不专业造成。一旦发生补正,即意味着要重新提交材料并重新开始排队等待审批。跟据既往经验,一次补正至少会浪费2周左右的时间。因此,申请者应当极力避免补正的出现。

    \n

    对此,来笙会在提交前进行材料审核和格式优化。当然我们不能100%保证避免出现补正。但如果后续出现补正,我们会协助您按要求修改并继续跟进。

    ", + "style": "plain" + }, + { + "key": "go", + "title": "咨询软著申请", + "lead": "", + "body": "

    通过企业微信联系来笙,沟通申请条件、材料与服务方案。

    加企业微信
    \"来笙软著服务企业微信二维码\"
    ", + "style": "tinted" + }, + { + "key": "terms", + "title": "申请与费用说明", + "lead": "", + "body": "最快60天内下证为来笙跟据过往大量案例得到的经验判断,具体时间受版权中心繁忙程度和具体项目审核难度而定。来笙亦不对此做出保证。
    ", + "style": "plain" + } + ] + }, + { + "slug": "shnu-sc", + "name": "SHNU 软著服务", + "title": "上海师范大学学生软著申请|来笙 SHNU 服务", + "heading": "SHNU 学生", + "accent": "软著申请", + "description": "面向上海师范大学学生的软件著作权申请服务。了解学生方案、所需材料、费用与创新学分审核规则。", + "lead": "由 SHNU 学长学姐协助申请软件著作权,提供材料审核、撰写和申请代理。代理申请方案页面价 ¥66/次,创新学分以学校审核为准。", + "image": "/assets/original/shnu-hero.webp", + "alt": "上海师范大学学生软件著作权服务", + "actions": [ + [ + "#pricing", + "查看学生方案" + ], + [ + "#go", + "咨询申请" + ] + ], + "quicklinks": [ + [ + "#materials", + "申请材料" + ], + [ + "#pricing", + "学生方案" + ], + [ + "#faq", + "常见问题" + ], + [ + "#go", + "微信咨询" + ] + ], + "sections": [ + { + "key": "benefits", + "title": "软件著作权证书的用途", + "lead": "登记证书可作为软件成果证明,学校按当期规则审核创新学分。", + "body": "\n

    软件著作权证书能够证明您作为著作人对软件的著作权受到法律保护。
    除此之外,更重要的是:

    \n\n\n\n\n\"\"", + "style": "plain" + }, + { + "key": "materials", + "title": "申请软著需要哪些材料", + "lead": "", + "body": "

    3000行代码

    3000行以上可以运行的代码是申请软著的基础。

    制作代码文档

    按照特定排版要求排版代码形成代码文档。

    30页用户指南

    除此之外您还需要撰写30页以上的用户手册。

    合作开发合同+文书

    最后如果您是多人合作开发,您还需要编写并签署合作开发合同。此外您还需要一系列文书材料。

    ", + "style": "plain" + }, + { + "key": "why", + "title": "为什么选择来笙", + "lead": "", + "body": "

    手工DIY

    \n

    申请需要繁琐的材料。
    一旦有所错漏哪怕格式不对、甚至点错了按钮,都会造成补正。
    一次补正就要重新排队,至少延迟两周时间。

    其他著作权代理商

    \n

    经常收取高额费用,声称提供所谓“加急”服务
    实则经常盗用各种开源软件、AI代码。
    一旦被版权中心查实,面临终生黑名单,得不偿失!部分黑心商家还收合作申请费!

    选择来笙

    \n

    最低仅需¥66元起,替您处理和审查、优化材料。不收取任何加急费,所有申请均最快60日内下证。
    不收取合作申请费,可多人一起申请。

    ", + "style": "tinted" + }, + { + "key": "options", + "title": "按准备进度选择服务", + "lead": "", + "body": "
  • \n\n\"\"\n

    我已经有项目了!

    \n

    仅需一本书的价格,来笙直接帮您搞定软著!为您全程提供申请代理+材料指导+审核优化,最快60天拿证书!

    \n代理申请服务\n\n
  • \n\n\"\"\n

    我会写代码!

    \n

    无需头疼各种麻烦的材料和手续,来笙为您一次性做齐所有材料,包您下证!

    \n无忧申请\n\n
  • \n\n\"\"\n

    啥也不会也没事!

    \n

    从代码到材料,来笙替您一站式解决。即使不会写代码也能拿到软著!

    \n一价全包\n\n
  • ", + "style": "plain" + }, + { + "key": "pricing", + "title": "服务方案与价格", + "lead": "三种方案,支持多人合作申请。", + "body": "

    代理申请服务

    ¥ 120 66 /次 SHNU学生专享价^

    已有代码和材料,提供申请代理

      \n
    • \n\n代理申请,直至下证\n
    • \n
    • \n\n材料编写辅导\n
    • \n
    • \n\n材料审核优化\n
    • \n
    • \n\n支持合作申请,无额外收费\n
    • \n\n合作申请提供合同模板\n
    • \n\n最快60天下证\n
    • \n
    立刻开始

    无忧申请

    ¥ 399 289 /次 SHNU学生专享价^

    仅有代码,提供申请代理+材料全包式撰写

      \n
    • \n\n代理申请,直至下证\n
    • \n
    • \n\n材料全包代写代办\n
    • \n
    • \n\n支持合作申请,无额外收费\n
    • \n\n合作申请提供合同模板\n
    • \n\n仅需代码,最快60天下证\n
    • \n
    立刻开始

    一价全包

    ¥ 999 799 /次 SHNU学生专享价^

    什么都没?不会代码?来笙替您解决一切

      \n
    • \n\n躺平等下证\n
    • \n
    • \n\n所有资料由来笙提供\n
    • \n
    • \n\n支持合作申请,无额外收费\n
    • \n\n合作申请提供合同模板\n
    • \n\n仅需代码,最快60天下证\n
    • \n
    立刻开始
    ", + "style": "tinted" + }, + { + "key": "fees", + "title": "收费明细", + "lead": "", + "body": "
    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    收费项目备注报价
    申请咨询咨询软著相关事项和材料¥40/次
    包含在上述所有价格包内
    申请代理由来笙代理您的申请
    直至下证
    ¥40/次
    包含在上述所有价格包内
    加急服务来笙不收取任何所谓加急费
    所有申请一律最快60天内下证
    ¥0/次
    合作申请来笙不收取任何所谓的多人合著申请费¥0/次
    申请材料
    审核优化
    由来笙专业技术团队审核并优化您的申请材料
    助您顺畅申请,防止补正
    ¥80/次
    包含在上述所有价格包内
    合作申请
    合同模板
    提供版权中心认可的合作申请模板¥60/次
    包含在上述所有价格包内
    申请材料
    代写
    来笙专业技术团队为您编纂提供包含用户指南在内的申请材料¥280/次
    包含在无忧申请和一价全包中
    ", + "style": "plain" + }, + { + "key": "stories", + "title": "客户案例", + "lead": "", + "body": "
    \"Orange\"\n

    Orange

    \n

    OUC大学

    \n

    大一随手拿了高中写的一个玩具在来笙代理了软著,两个月就搞定了,学期末直接美美拿去申综测分,奖学金直接到手。

    \"Teo\"\n

    Teo

    \n

    高级工程师

    \n

    软著证书对我评职称帮助特别大。随便写了个小东西找了来笙之后差点都忘了这件事,一个多月之后就告诉我下证了。

    \"Jeo\"\n

    Jeo

    \n

    某重点大学

    \n

    前一家黑心公司报价1700块钱,到了来笙,只用两百多块就搞定了。全程丝滑,什么也不用操心,只要提供代码和文档,一个半月就能拿证了。

    ", + "style": "tinted" + }, + { + "key": "faq", + "title": "常见问题", + "lead": "", + "body": "
    申请软著有什么好处?

    软件著作权登记证书可以作为软件成果的正式登记凭证。对学生来说,它常用于创新学分认定、综测或评优材料、简历成果展示;对后续发展来说,也可以用于 APP 上架、项目结项、职称评审、成果证明和维权举证等场景。
    需要注意的是,创新学分、综测加分、评优加分等均以学校、学院当期规则和最终审核结果为准。

    \n

    SHNU 同学拿到软著后,一定能认定创新学分吗?

    \n

    不是“拿证 = 自动拿分”。以现行通知来说,软件著作权属于“专利(著作权)授权”相关成果,学生需要按学校要求在系统中提交登记证书等佐证材料,并通过学校最终审核后才能认定。不同年级、不同学院、不同学期的规则可能有变化,建议在申请前先确认自己所在学院和当学期通知。

    申请软著通常需要哪些材料?

    一般需要软件著作权登记申请表、软件鉴别材料和相关证明文件。软件鉴别材料通常包括源程序和软件文档;如果是多人合作开发,还需要明确合作开发关系和权属安排。国家版权局《计算机软件著作权登记办法》规定,软件鉴别材料包括程序和文档,通常由源程序和任一种文档的前、后各连续 30 页组成;不足 60 页的,提交全部材料。

    \n

    简单来说就是:

    \n

    60页代码(中心规定每页不少于50行,即3000行)

    \n

    30~60页文档

    \n

    合作开发合同

    \n

    其他杂项文书、签章签字页

    大概多久可以下证?

    软著登记不是即时出证。根据《计算机软件著作权登记办法》,中国版权保护中心应当自受理日起60个工作日内审查完成;符合规定的,予以登记并发证公告。

    \n

    实际耗时跟据我们的案件经历,跟据版权中心的处理速度不同、案件项目复杂性不同,从30天~90多天的都有。其中涉及节假日(如五一、国庆、春节)则时间还会进一步延长。但绝大多数案件都在60天内完成。

    \n

    我们页面中所说的“最快 60 天”是根据过往案例和正常流程作出的经验判断,实际时间仍会受版权中心审核进度、材料质量、是否补正等因素影响,不构成绝对承诺。

    多人合作申请会额外收费吗?

    不会。来笙不收取所谓“合作申请费”。多人合作申请时,我们可以免费协助整理合作开发信息,并免费提供合作开发合同模板。

    \n

    无论几名著作权人申请,来笙都只收取相同的费用。

    \n

    但多人申请前需要提前确认每位作者的信息、署名顺序、贡献情况和权属比例,避免后续出现权属争议。

    不会代码真的也可以吗?

    我们坚决反对著作权证书的交易、买卖。

    \n

    我们将为您提供来笙低代码平台,按照您的思路原创性地设计一款APP/网页。并辅助您完成从零开始的项目协助。不需要您有程序功底或经验。

    如果申请失败怎么办?

    我们会在服务开始前先做基础可行性判断,明显不符合登记条件或存在权属风险的项目,不建议提交。

    \n

    如果因材料格式或表述问题出现补正,我们会协助修改和继续跟进;如果因您提供虚假信息、权属争议、侵权代码、第三方材料不合规等原因导致无法登记,则需根据具体情况处理。

    \n

    版权登记是一件较为复杂的事情,我们无法保障100%成功。但如若因我们的材料导致无法成功申请,我们可以提供全额退款。

    下证后我会拿到什么?

    登记完成后,您会获得软件著作权登记证书。目前所有软件著作权证书均为电子证书。

    \n

    来笙作为申请代理仅能取得没有数字签名的“副本”,您可以在申请成功后登录版权中心自行下载带有版权中心数字签名、有法律效益的“正本”。

    \n

    您可以将其用于学校创新学分申请、综测或评优材料、简历展示、APP 上架、项目成果证明等场景。

    \n

    但所有外部用途均以对应平台、学校、学院、单位或评审机构的最终审核规则为准。

    证书上的著作权人可以写谁?可以和我的舍友/npy一起申请吗?

    可以根据实际情况写个人、多人、单位或合作开发主体,但必须真实反映软件的开发和权属关系。合作开发的软件可以由全体著作权人协商确定代表办理,但仍应注明其他著作权人。

    \n

    具体而言,如果舍友/npy参与了开发过程,在协商一致的情况下,当然可以共同申请。来笙亦不会收取额外的费用。

    \n

    对 SHNU 同学而言,还需要注意学校对“著作权人”和佐证材料的具体要求。软件著作权的著作权人可为“SHNU”或学生本人姓名;若著作权人为学校,还需提供可证明申请人为本人的其他佐证材料。我们一般推荐直接使用姓名。但若评定创新学分还需要注意前三位和其他成员具体分值不同。

    什么是补正?会不会被补正?后果是什么?

    常见补正原因包括软件名称和版本号不一致、代码或文档格式不符合要求、申请表填写不规范、签名错误或不可识别、合作开发权属不清、材料前后表述矛盾等。

    \n

    常见造成补正的大部分都是申请表、申请材料填写不规范不专业造成。一旦发生补正,即意味着要重新提交材料并重新开始排队等待审批。跟据既往经验,一次补正至少会浪费2周左右的时间。因此,申请者应当极力避免补正的出现。

    \n

    对此,来笙会在提交前进行材料审核和格式优化。当然我们不能100%保证避免出现补正。但如果后续出现补正,我们会协助您按要求修改并继续跟进。

    ", + "style": "plain" + }, + { + "key": "go", + "title": "咨询软著申请", + "lead": "", + "body": "

    通过企业微信联系来笙,沟通申请条件、材料与服务方案。

    加企业微信
    \"来笙软著服务企业微信二维码\"
    ", + "style": "tinted" + }, + { + "key": "terms", + "title": "申请与费用说明", + "lead": "", + "body": "^划线白色价格为来笙正常对外提供服务时使用的刊例价。橙色价格仅限全日制在读本科生和研究生。您需要提供相应证明(如学生证或学信网),否则来笙有权拒绝以该价格向您提供服务。当您使用该价格时,来笙可能会收集您的学生信息(如专业、年级、院系)。

    最快60天内下证为来笙跟据过往大量案例得到的经验判断,具体时间受版权中心繁忙程度和具体项目审核难度而定。来笙亦不对此做出保证。

    *跟据SHNU现行的创新学分评定标准,经过学校审查的软著可以作为评定依据。请与学校确认相关情况,我司不对此做出任何保证。
    **各个学校和学院规则不同。请与学校确认相关情况,我司不对此做出任何保证。
    ", + "style": "plain" + } + ] + } + ], + "articles": [ + { + "slug": "global-server-deployment", + "title": "来笙关于即将减少全球服务器部署的公告", + "category": "announcement", + "summary": "", + "body": "", + "tags": [ + "公告", + "来笙全球服务器部署" + ], + "date": "2024-11-10 14:39:31", + "status": "published", + "legacy": "/news/id/4.html" + } + ] +} diff --git a/start.php b/start.php new file mode 100755 index 0000000..f89201a --- /dev/null +++ b/start.php @@ -0,0 +1,15 @@ +#!/usr/bin/env php +