1
0
Fork 0
Yet another ARTEMiS frontend. for Chinese WIP
Go to file
shiromimochi 719a4a1517 fix: chuni: 修正B30和R10标题过长超出方块 2024-04-29 19:52:56 +08:00
.idea chuni: import note counts and chart credits 2024-04-13 02:29:08 -04:00
.vscode chuni: add score calculator 2024-04-17 04:48:35 -04:00
migrations fix: incorrect dashboard column type 2024-04-17 07:26:04 -04:00
public/assets/fonts chuni: change badge/rating font 2024-03-14 21:22:17 -04:00
scripts fix: chuni: scripts: default values for chuni charts 2024-04-18 06:14:33 -04:00
src fix: chuni: 修正B30和R10标题过长超出方块 2024-04-29 19:52:56 +08:00
.db-migraterc initial commit 2024-03-12 06:40:53 -04:00
.dockerignore add docker files 2024-04-07 03:59:11 -04:00
.env initial commit 2024-03-12 06:40:53 -04:00
.env.development initial commit 2024-03-12 06:40:53 -04:00
.env.local.example update .env.local.example 2024-04-07 02:53:14 -04:00
.env.production initial commit 2024-03-12 06:40:53 -04:00
.eslintrc.json suppress no-img-element warning 2024-03-31 23:29:32 -04:00
.gitignore initial commit 2024-03-12 06:40:53 -04:00
Dockerfile add docker files 2024-04-07 03:59:11 -04:00
LICENSE.txt add some license info 2024-04-07 06:04:56 -04:00
README.md 叠个盾先 2024-04-20 17:45:22 +08:00
compress.mjs add static gzip/brotli utility 2024-04-07 02:53:00 -04:00
db-migrate.cjs add message about db encoding 2024-04-16 19:57:46 -04:00
docker-compose.yml fix: docker compose port order 2024-04-07 06:44:25 -04:00
docker-transfer-next-static.sh add docker files 2024-04-07 03:59:11 -04:00
empty.cjs bump deps 2024-04-12 05:17:41 -04:00
next-env.d.ts initial commit 2024-03-12 06:40:53 -04:00
next.config.js bump deps 2024-04-12 05:17:41 -04:00
package-lock.json bump deps 2024-04-12 05:17:41 -04:00
package.json add message about db encoding 2024-04-16 19:57:46 -04:00
postcss.config.js initial commit 2024-03-12 06:40:53 -04:00
process-db.js initial commit 2024-03-12 06:40:53 -04:00
resize-observer.cjs remove resize observer polyfill 2024-04-11 00:05:46 -04:00
tailwind.base.ts fix: correctly show chuni heaven judge counts in playlog 2024-04-13 02:28:02 -04:00
tailwind.config.ts initial commit 2024-03-12 06:40:53 -04:00
tsconfig.json chuni: add recent/top ratings to board 2024-03-12 23:19:26 -04:00

README.md

Actaeon

An ARTEMiS frontend.
本中文Fork版本为自己用的,如果你看到了也想使用的话也没问题。毕竟英语不太好借助chatgpt才勉勉强强的能让文本能看如果你觉得奇怪的地方也请见谅同时如果原作者更新了我会尽量跟上速度

注意: 请保存你的数据库

我不对由于配置错误导致的数据库问题负责. 在对数据库进行任何更改前,你应当备份你的数据库.

注意:: 你的默认数据库编码必须为Unicode

你可以使用这个命令来更改数据库的编码格式 ALTER DATABASE aime CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

创建数据库表

在运行数据库导入脚本之前,你必须在你的数据库中创建表格. 这个可以通过启用 AUTOMIGRATE(见下文)运行一次服务器来完成, 或者使用 npm run migrate 指令(确保首先运行了 npm i 并设置了 DATABASE_URL 环境变量来完成 如果你使用的是Mysql数据库则可能需要运行这个指令→ SET GLOBAL log_bin_trust_function_creators = 1;

构建

确保你已经正确设置好了 构建时所需的变量.

使用Docker构建

运行 docker compose build

不使用 Docker 进行构建

你可以通过修改 .env.local 来指定 运行时变量

  1. 运行 npm i
  2. 运行 npm run build

运行

确保你已经 创建了表 并运行了 数据库导入和资源提取脚本.

使用 Docker 运行

  1. docker-compose.yml 中修改 运行时环境变量
  2. 运行 docker compose up (或者使用 docker compose up -d 来分离输出)

不使用 Docker运行

  1. .env.local 中设置任何尚未设置的 运行时环境变量.
  2. 运行 npm run start

提升权限为所有者

为了使用 Actaeon 的所有功能, 你需要拥有所有者权限. 你可以将 aime_user 表中的 permissions 列设置为 255, 或者将 ACTAEON_OWNER_ID 设置为你的用户ID. 当用户成为所有者, 他们也可以通过 Actaeon Web 界面将其他用户也晋升为所有者. 你可以通过查看你的 ARTEMiS logs来了解自己的ID:

Aimedb | INFO | access_code ******************** -> user_id 10000

配置

环境变量可以通过 .env.local 文件或者环境添加. 至少你需要将 NEXT_PUBLIC_*_EXTENSION 变量设置为由 asset-extract.py 脚本 生成的相应文件的扩展名,以及 DATABASE_URLNEXTAUTH_SECRET 变量.

构建变量

这些变量只能在构建时通过 .env.local 设置,在运行 npm run build 或构建 Docker 镜像之前。

变量 介绍 示例 必须
BASE_PATH 如果你希望与你的 artemis 服务器在同一域名的话可以 通过Nginx来代理你的网站. (默认: /web) /web
ASSET_URL 你的资源将在通常情况下是托管在本地的. 你需要将其设置为这样的格式 $BASE_PATH/assets(可以是绝对或者相对路径)同时也支持使用URL来导入资源. (默认为: /web/assets) /web/assets, /assets
NEXT_PUBLIC_JACKET_EXTENSION 曲封的图扩展名 .webp, .png, .avif
NEXT_PUBLIC_IMAGE_EXTENSION 图片的扩展名 .webp, .png, .avif
NEXT_PUBLIC_MUSIC_EXTENSION 音乐的扩展名 .opus, .m4a
NEXT_PUBLIC_AUDIO_EXTENSION 音频的扩展名 .opus, .m4a

运行变量

这些变量可以通过环境或 .env.local 文件在运行时设置。

变量 介绍 示例 必须
DATABASE_URL 指向Artemis数据库的URL格式为 mysql://user:pass@host:port/db_name mysql://aime:aime@127.0.0.1:3306/aime
NEXTAUTH_SECRETAUTH_SECRET 将其设置为长随机字符串(可以通过在命令行上运行openssl rand-Base64 32npx auth secret来生成该字符串)
AUTOMIGRATE 自动在服务器上运行新的迁移 startup true, false
ACTAEON_OWNER_ID 将其设置为用户ID可自动授予此用户所有者用户组 10000
COOKIE_SECURE 覆盖身份验证Cookie上的安全标志(默认情况下,使用主机协议或x-Forwarded-Prototype标头来确定这一点) true, false
BCRYPT_ROUNDS 对密码进行哈希处理的bcrypt轮数(默认值12) 12, 14

配置 nginx 以在与 ARTEMiS 相同的域名上使用 Actaeon

Nginx 可以配置为在相同域名上同时使用 Actaeon 和 ARTEMiS 服务。为了实现这一点必须将 BASE_PATH 变量设置为非根基本路径 (例如, /web).

你的nginx配置可能如下:

server {
	listen 80;
	server_name your.hostname.here;

	location / {
		# ...
		proxy_pass http://127.0.0.1:8080/;
	}
}

server {
	listen 443 ssl;
	server_name your.hostname.here;

	# ...

	location / {
		# ...
		proxy_pass http://127.0.0.1:8080/;
	}
}

你可以通过添加一些额外的位置块来提供 Actaeon 服务。Nginx 还必须对 Actaeon 的资源具有读取访问权限。以下配置假设基本路径为 /web

server {
	listen 80;
	server_name your.hostname.here;

	# redirect to https
	location = / {
		return 301 https://$host/;
	}

	location /web/ {
		return 301 https://$host$request_uri;
	}

	location / {
		# ...
		proxy_pass http://127.0.0.1:8080/;
	}
}

server {
	listen 443 ssl;
	server_name your.hostname.here;

	# ...

	# redirect root to web
	rewrite ^/$ /web/ last;

	# serve assets
	location /web/assets/ {
		# modify this path
		alias /path/to/actaeon/public/assets/;
		try_files $uri =404;
	}

	# uncomment if you want nginx to server nextjs static files
	# you will have to run ./docker-transfer-next-static.sh if running through docker
	#location /web/_next/static/ {
	#	# uncomment this if you have ngx_http_gzip_static_module
	#	#gzip_static on;
	#	#gzip_vary on;
	#	# uncomment this if you have ngx_http_brotli_static_module
	#	#brotli_static on;
	#
	#	# modify this path
	#	alias /path/to/actaeon/.next/static/;
	#	try_files $uri =404;
	#}

	# actaeon
	location /web {
		proxy_set_header X-Forwarded-Host $host;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto https;
		proxy_pass http://127.0.0.1:1430;
	}

	location / {
		# ...
		proxy_pass http://127.0.0.1:8080/;
	}
}