君玉自牧 君玉自牧
首页
  • Linux
  • Nginx
  • MySQL
  • Redis
  • Kafka
  • Docker
  • Jenkins
  • Oneindex
  • Bitwarden
  • Confluence
  • Photogallery
  • 智能手机
  • 上古卷轴
  • 健身记录
  • 站点相关
  • 未完待续
GitHub (opens new window)
首页
  • Linux
  • Nginx
  • MySQL
  • Redis
  • Kafka
  • Docker
  • Jenkins
  • Oneindex
  • Bitwarden
  • Confluence
  • Photogallery
  • 智能手机
  • 上古卷轴
  • 健身记录
  • 站点相关
  • 未完待续
GitHub (opens new window)
  • 应用服务

    • 同步工具:Resilio Sync
    • 免费文本生成语音
    • 安装 Confluence 构建知识库
    • 内网穿透:frp
    • 使用 bitwarden_rs 搭建自用密码服务器
    • 安卓手机 Magisk & Xposed 模块
    • 部署 Oneindex 搭建个人网盘
    • 使用 Cloudflare Workers 创建短网址程序
    • 苹果自动化:Workflow
    • 保存 Windows 10「聚焦」功能的精美壁纸
    • 记忆辅助软件:Anki
    • Photogallery X3
      • 安装
        • Nginx 伪静态
      • 授权
        • 修改引用文件
        • 简单模式
    • 跨平台网络优化:Surge
    • 使用 IFW 调教安卓应用
  • 网页浏览

  • 诗词歌赋

  • 其他收藏

目录

Photogallery X3

# 安装

最新版是 3.30.1,官网下载链接 (opens new window)

安装环境:PHP 5.3 或更高,需要PHP扩展 GD 和 Mcrypt 安装过程接不多说了,参考官方详细文档

需要注意的的伪静态设置是,如果原来配置文档有涉及 js,css 的设置建议先删除。(宝塔需要删除原来配置文档里面 location ~js jpg 部分)

# Nginx 伪静态

location / {
    if (!-e $request_filename){
      # Rewrite any calls to html|json|xml|atom|rss if a folder matching * exists
      rewrite (.+)\.(html|json|xml|atom|rss)$ $1/ last;
      # Rewrite any calls to /render to the X3 image resizer
      rewrite ^/render/. /app/parsers/slir/ last;
      # Rewrite routes to X3 application index.php if they are non-existent files/dirs
      rewrite ^(.*)$ /index.php?$1 last;
    }
  }
  # Prevent web access to X3 /config and /_cache directories
  location ~ /(config|_cache) {
    deny all;
  }
1
2
3
4
5
6
7
8
9
10
11
12
13
14

# 授权

以这个版本为例,把验证网址 https://auth.photo.gallery/ 改成 /auth,再在 /auth 目录下放入自己的授权文件

  • 修改 /app/public/js/3.30.1/x3.min.js
搜索 aHR0cHM6Ly9hdXRoLg== 替换为 Lw==
搜索 cGhvdG8uZ2FsbGVyeQ== 替换为 YXV0aA==
1
2

代码为 base64 加密,解密后对应

aHR0cHM6Ly9hdXRoLg== -> https://auth
cGhvdG8uZ2FsbGVyeQ== -> photo.gallery
Lw== -> /
YXV0aA== -> auth
1
2
3
4
  • 修改 /panel/filemanager_js/x3_panel.js
搜索 aHR0cHM6Ly9hdXRoLnBob3RvLmdhbGxlcnkv 替换为 L2F1dGgv
1

代码为 base64 加密,解密后对应

aHR0cHM6Ly9hdXRoLnBob3RvLmdhbGxlcnkv -> https://auth.photo.gallery/
L2F1dGgv -> /auth/
1
2
  • 修改使用本地 x3.min.js

# 修改引用文件

修改 /app/templates/cc/29/202264ab201d0d43a63882c31b1c06ae7e7992a5c371c52f885633d0acfa.php 大概第71行

$context["core_js"] = (("https://cdn.jsdelivr.net/npm/x3.photo.gallery@" . $this->getAttribute((isset($context["page"]) ? $context["page"] : null), "x3_version")) . "/js/x3.min.js");      
修改为:
$context["core_js"] = ("/app/public/js/3.30.1/x3.min.js");
1
2
3

或者从后台设置取消 cdn,全部使用本地静态:设置 -> 高级 -> CDN,取消勾选

  • 新建验证文件 /auth/index.php

# 简单模式

<?php 
header('Access-Control-Allow-Origin: *');
header('content-type:application/json');
echo '{"status":200,"message":"License is valid.","parameters":{"type":"1"}}';
?>
1
2
3
4
5

###指定域名

<? php 
header('Access-Control-Allow-Origin: *');
header('content-type:application/json');
$allowed_hosts = array('pg.yuwei.cc', 'p2.btu.pp.ua');
if (in_array($_SERVER['SERVER_NAME'], $allowed_hosts)) {
    echo '{"status":200,"message":"License is valid [btu.pp.ua]","parameters":{"type":"1"}}';
}else{
    echo '{"status":301,"message":"License not Found"}';
}
?>
1
2
3
4
5
6
7
8
9
10

这样应该可以了

好像 POST 授权网址后,只要 status 返回的代码不是 301,它就不会判断是不是正版,不再进行下一步的弹窗和跳转了 目前个人使用遇到最大问题

文件夹不支持 #$%^&*()+=[]'”/|{}`~!@.

网页编辑 (opens new window)
最近提交: 2023/03/22, 11:52:35
记忆辅助软件:Anki
跨平台网络优化:Surge

← 记忆辅助软件:Anki 跨平台网络优化:Surge→

Theme by Vdoing | Copyright © 2011-2023 | 君玉自牧
粤ICP备15057965号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式