diff --git a/.gitmodules b/.gitmodules index 429c3354..d09d3e5b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,7 @@ [submodule "assets"] path = assets url = git@github.com:tlecommunity/assets.git + +[submodule "app"] + path = app + url = git@github.com:tlecommunity/app.git diff --git a/app b/app new file mode 160000 index 00000000..14a1464d --- /dev/null +++ b/app @@ -0,0 +1 @@ +Subproject commit 14a1464daeabb8c18ded3ac6d18eb3a636656124 diff --git a/docker-compose.yml b/docker-compose.yml index a3f68f55..8149d6ea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,5 @@ -version: '2' +volumes: + app-node_modules: services: @@ -57,6 +58,7 @@ services: lacuna-mysql-server: container_name: 'lacuna-mysql-server' + platform: linux/amd64 environment: - 'MYSQL_ROOT_PASSWORD=lacuna' image: 'mysql:5.5' @@ -75,7 +77,7 @@ services: environment: - 'PMA_HOST=lacuna-mysql-server' ports: - - '8000:80' + - '8888:80' depends_on: - 'lacuna-mysql-server' links: @@ -92,7 +94,7 @@ services: container_name: 'lacuna-nginx' depends_on: - 'lacuna-server' - image: 'lacuna/lacuna-nginx' + # image: 'lacuna/lacuna-nginx' ports: - '8080:80' - '8443:443' @@ -104,6 +106,9 @@ services: - ./captcha:/home/lacuna/server/captcha - ./assets:/home/lacuna/server/var/www/public/assets - ./var/www/public/api/api.css:/home/lacuna/server/var/www/public/api/api.css + # - ./app/dist/index.html:/home/lacuna/server/var/www/public/index.html + # - ./app/dist/app:/home/lacuna/server/var/www/public/app + - ./app/dist:/home/lacuna/server/var/www/public/app ########### ## REDIS ## @@ -115,6 +120,25 @@ services: ports: - '6379:6379' + + ######### + ## APP ## + ######### + + lacuna-app: + build: + context: . + dockerfile: ./docker/build-app/Dockerfile + container_name: 'lacuna-app' + command: npx vite build + volumes: + - app-node_modules:/usr/src/app/node_modules + - ./app:/usr/src/app + environment: + - 'LACUNA_ASSETS_URL=/assets/' + - 'LACUNA_SERVER_URL=/' + - 'LACUNA_API_KEY=anonymous' + ############ ## SERVER ## ############ @@ -135,7 +159,7 @@ services: - 'TLE_NO_MIDDLEWARE=1' image: 'lacuna/lacuna-server' ports: - - '5000:5000' + - '3050:5000' volumes: - ./bin:/home/lacuna/server/bin - ./captcha:/home/lacuna/server/captcha diff --git a/docker/build-app/Dockerfile b/docker/build-app/Dockerfile new file mode 100644 index 00000000..d78c21a9 --- /dev/null +++ b/docker/build-app/Dockerfile @@ -0,0 +1,6 @@ +FROM node:20 + +WORKDIR /usr/src/app + +COPY ./app/package.json ./app/package-lock.json ./ +RUN npm ci diff --git a/docker/build-server/Dockerfile b/docker/build-server/Dockerfile index 94d3cb52..b1060080 100644 --- a/docker/build-server/Dockerfile +++ b/docker/build-server/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM almalinux:8 RUN yum -y upgrade diff --git a/etc-docker/lacuna.conf b/etc-docker/lacuna.conf index 5113d90b..f8cb5528 100644 --- a/etc-docker/lacuna.conf +++ b/etc-docker/lacuna.conf @@ -59,12 +59,12 @@ }, "map_size" : { "x" : [ - -250, - 250 + -1500, + 1500 ], "y" : [ - -250, - 250 + -1500, + 1500 ] }, "memcached" : [ @@ -105,7 +105,7 @@ "host" : "lacuna-redis", "port" : 6379 }, - "rpc_limit" : 2500, + "rpc_limit" : 10000, "rpc_throttle" : 200, "secret_key" : "XXXX", "self_destruct_after_inactive_days" : 9999999, @@ -125,10 +125,11 @@ "max_colonies" : 2, "zone" : 1, "zone_list" : [ - "-1|-1", - "-1|1", - "1|-1", - "1|1" + "0|0" + # "-1|-1", + # "-1|1", + # "1|-1", + # "1|1" ], "coord" : 0, "x" : [ -50, 50 ], diff --git a/etc-docker/nginx.conf b/etc-docker/nginx.conf index 70071e46..f1a68bdd 100644 --- a/etc-docker/nginx.conf +++ b/etc-docker/nginx.conf @@ -51,6 +51,9 @@ http { root /home/lacuna/server/var/www/public; index README.txt; } + location ^~ /app/ { + root /home/lacuna/server/var/www/public; + } location ^~ /starmap/ { root /home/lacuna/server/var/www/public; index index.html; diff --git a/lib/Lacuna/DB/Result/Empire.pm b/lib/Lacuna/DB/Result/Empire.pm index e3f66ef0..ab51f2f5 100644 --- a/lib/Lacuna/DB/Result/Empire.pm +++ b/lib/Lacuna/DB/Result/Empire.pm @@ -904,21 +904,21 @@ sub find_home_planet { $body_search{'me.zone'} = $invite->zone; $star_search{zone} = $invite->zone; } - # elsif ($sz_param and $sz_param->{active}) { - # if ($sz_param->{zone}) { - # $body_search{'me.zone'} = { in => $sz_param->{zone_list} }; - # $star_search{zone} = { in => $sz_param->{zone_list} }; - # } - # if ($sz_param->{coord}) { - # $body_search{'me.x'} = { between => $sz_param->{x} }; - # $body_search{'me.y'} = { between => $sz_param->{y} }; - # $star_search{x} = { between => $sz_param->{x} }; - # $star_search{y} = { between => $sz_param->{y} }; - # } - # } - # else { - # $body_search{'me.usable_as_starter_enabled'} = 1; - # } + elsif ($sz_param and $sz_param->{active}) { + if ($sz_param->{zone}) { + $body_search{'me.zone'} = { in => $sz_param->{zone_list} }; + $star_search{zone} = { in => $sz_param->{zone_list} }; + } + if ($sz_param->{coord}) { + $body_search{'me.x'} = { between => $sz_param->{x} }; + $body_search{'me.y'} = { between => $sz_param->{y} }; + $star_search{x} = { between => $sz_param->{x} }; + $star_search{y} = { between => $sz_param->{y} }; + } + } + else { + $body_search{'me.usable_as_starter_enabled'} = 1; + } @stars = Lacuna->db->resultset('Map::Star')->search(\%star_search)->get_column('id')->all; $body_search{'me.star_id'} = { 'in' => \@stars }; my @bodies = shuffle $planets->search( \%body_search, { join => 'star' } ); diff --git a/var/starnames.txt b/var/starnames.txt index 7eba322b..39212e77 100644 --- a/var/starnames.txt +++ b/var/starnames.txt @@ -1,3 +1,4 @@ +Rose Dillon Knope Vrbsky @@ -1245335,4 +1245336,4 @@ Oackl Ooghaem Jio Slia Poahia Kloa Chia Afleant Stia Yui Xuhea Oah -Kloo Oumicc In \ No newline at end of file +Kloo Oumicc In