core&ui: goodbye, minio (#417)

This commit is contained in:
undefined authored and GitHub committed 2022-08-23 00:40:21 +08:00
1 parent 7abc0a7d1b
commit e06c86e9dd
34 files changed
+410 -322

No files matched your search

-1
View File
@@ -12,7 +12,6 @@ fi
if [ ! -f "$ROOT/first" ]; then
echo "for marking use only!" > "$ROOT/first"
hydrooj cli system set file.endPoint http://oj-minio:9000/
hydrooj cli user create systemjudge@systemjudge.local root rootroot
hydrooj cli user setSuperAdmin 2
+1 -14
View File
@@ -1,16 +1,6 @@
version: '3.7'
services:
oj-minio:
image: minio/minio
container_name: oj-minio
command: server /data
restart: always
volumes:
- ./data/minio:/data
environment:
- MINIO_ACCESS_KEY=CHANGE_THIS
- MINIO_SECRET_KEY=CHANGE_THIS
# Warning: mongodb here is not password-protected.
# DO NOT EXPOSE THIS SERVICE TO THE PUBLIC.
@@ -26,13 +16,10 @@ services:
container_name: oj-backend
restart: always
depends_on:
- oj-minio
- oj-mongo
volumes:
- ./data/file:/data/file
- ./data/backend:/root/.hydro
environment:
- MINIO_ACCESS_KEY=CHANGE_THIS
- MINIO_SECRET_KEY=CHANGE_THIS
ports:
- "0.0.0.0:80:8888" # In docker mode, change THIS port instead of port in system settings!
-15
View File
@@ -20,7 +20,6 @@ const locales = {
'error.nodeVersionPraseFail': '无法解析 Node 版本号,请尝试手动安装。',
'install.pm2': '正在安装 PM2...',
'install.createDatabaseUser': '正在创建数据库用户...',
'install.minio': '正在安装 MinIO...',
'install.compiler': '正在安装编译器...',
'install.hydro': '正在安装 Hydro...',
'install.done': 'Hydro 安装成功!',
@@ -45,7 +44,6 @@ const locales = {
'error.nodeVersionPraseFail': 'Unable to parse Node version, please try to install manually.',
'install.pm2': 'Installing PM2...',
'install.createDatabaseUser': 'Creating database user...',
'install.minio': 'Installing MinIO...',
'install.compiler': 'Installing compiler...',
'install.hydro': 'Installing Hydro...',
'install.done': 'Hydro installation completed!',
@@ -83,8 +81,6 @@ if (!cpuInfoFile.includes('avx2')) {
let migration;
let retry = 0;
log.info('install.start');
const MINIO_ACCESS_KEY = randomstring(32);
const MINIO_SECRET_KEY = randomstring(32);
let DATABASE_PASSWORD = randomstring(32);
// TODO read from args
const CN = true;
@@ -193,13 +189,6 @@ To disable this feature, checkout our sourcecode.`);
skip: () => !exec('pm2 -v').code,
operations: ['yarn global add pm2'],
},
{
init: 'install.minio',
skip: () => !exec('minio -v').code,
operations: [
'nix-env -iA nixpkgs.minio',
],
},
{
init: 'install.compiler',
operations: [
@@ -249,8 +238,6 @@ To disable this feature, checkout our sourcecode.`);
operations: [
['pm2 stop all', { ignore: true }],
() => fs.writefile(`${__env.HOME}/.hydro/mount.yaml`, mount),
`echo "MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}\nMINIO_SECRET_KEY=${MINIO_SECRET_KEY}" >/root/.hydro/env`,
`pm2 start "MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY} MINIO_SECRET_KEY=${MINIO_SECRET_KEY} minio server /data/file" --name minio`,
'pm2 start mongod --name mongodb -- --auth --bind_ip 0.0.0.0',
() => sleep(1000),
`pm2 start bash --name hydro-sandbox -- -c "ulimit -s unlimited && hydro-sandbox -mount-conf ${__env.HOME}/.hydro/mount.yaml"`,
@@ -291,8 +278,6 @@ To disable this feature, checkout our sourcecode.`);
() => log.info('extra.restartTerm'),
() => log.info('extra.dbUser'),
() => log.info('extra.dbPassword', DATABASE_PASSWORD),
() => log.info('MINIO_ACCESS_KEY=%s', MINIO_ACCESS_KEY),
() => log.info('MINIO_SECRET_KEY=%s', MINIO_SECRET_KEY),
],
},
];
-1
View File
@@ -15,7 +15,6 @@ in pkgs.dockerTools.buildImage {
name = "hydro-web";
paths = [
hydro.mongodb4
pkgs.minio
pkgs.nodejs
pkgs.yarn
];
-1
View File
@@ -6,7 +6,6 @@ in pkgs.buildEnv {
name = "hydro-env";
paths = [
mongo
pkgs.minio
pkgs.nodejs
pkgs.yarn
pkgs.git
+1 -2
View File
@@ -15,7 +15,6 @@ mongo 127.0.0.1:27017/hydro /tmp/createUser.js
echo "{\"host\":\"127.0.0.1\",\"port\":\"27017\",\"name\":\"hydro\",\"username\":\"hydro\",\"password\":\"$db_password\"}" >~/.hydro/config.json
pm2 stop mongod
pm2 del mongod
pm2 restart minio
pm2 start mongodb
pm2 restart hydrooj
pm2 restart all
pm2 save
-9
View File
@@ -7,8 +7,6 @@ echo "详情请参阅文档 -> https://hydro.js.org"
echo "使用 Ctrl-C 退出该脚本,或是等待十秒后继续。"
echo "Will continue installation in 10 secs, press Ctrl-C to exit"
sleep 10
MINIO_ACCESS_KEY=$(cat /dev/urandom | head -n 10 | md5sum | head -c 20)
MINIO_SECRET_KEY=$(cat /dev/urandom | head -n 10 | md5sum | head -c 20)
# Basic
echo "apt-get update"
@@ -54,11 +52,6 @@ pm2 del mongod >/dev/null
echo 'Starting mongodb'
pm2 start "mongod --auth --bind_ip 0.0.0.0" --name mongodb
# Install MinIO
wget http://dl.minio.org.cn/server/minio/release/linux-amd64/minio
chmod +x minio
pm2 start "MINIO_ACCESS_KEY=$MINIO_ACCESS_KEY MINIO_SECRET_KEY=$MINIO_SECRET_KEY ./minio server /data/file" --name minio
# Install Compiler
echo 'Installing g++'
apt-get install -y g++ >/dev/null
@@ -81,5 +74,3 @@ pm2 save
echo "Done"
echo "Database username: hydro"
echo "Database password: $db_password"
echo "MINIO_ACCESS_KEY=$MINIO_ACCESS_KEY
MINIO_SECRET_KEY=$MINIO_SECRET_KEY" >~/.hydro/env