diff --git a/.gitmodules b/.gitmodules index b91d4b1..be36170 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,9 @@ [submodule "nitro/nitro-assets"] path = nitro/nitro-assets url = https://git.krews.org/nitro/default-assets.git +[submodule "atom/atom"] + path = atom/atom + url = https://github.com/ObjectRetros/atomcms.git +[submodule "atom/atom-hk"] + path = atom/atom-hk + url = https://github.com/ObjectRetros/atomhk.git diff --git a/README.md b/README.md index 43135a1..ae85be4 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ Nitro docker is a quick-to-setup docker dev environment. It can be run on Window - Wait 5/10 minutes (it's important) - Once nitro accessible on [http://127.0.0.1:1080?sso=123](http://127.0.0.1:1080?sso=123) - you can extract all assets easily with the command `just extract-nitro-assets` +- after extract assets you can run `just config-atom` to configure the cms and housekeeping +- the command above will give you the instalation key required by atom in the initial setup. Access http://localhost:8000, paste it in the required field and have fun. ## More commands - `just restart-arcturus`: restart arcturus emulator @@ -41,4 +43,11 @@ The first database come from mysql/dumps, it's the base Arcturus database for 3. - All extracted assets come from nitro-swf and will be extracted in nitro-assets (the nitro converter use the swf server) - All the configurations for nitro-react are in `nitro/configuration`. If you make some change, just make `just restart-nitro` +### Atom CMS and HK + +- Atom is accessible at [http://localhost:8000](http://localhost:8000/), and Atom HK is accessible at [http://localhost:666](http://localhost:666/). +- All configurations for Atom CMS and Atom HK are in `atom/.env`. +- After the initial setup of the CMS, you can edit some settings in the `website_settings` table of the database. +- To test Atom HK, you will need to add rank 7 (admin) to your user in the `users` table of the database. + ### Have fun <3 diff --git a/atom/.env b/atom/.env new file mode 100644 index 0000000..04cfcc8 --- /dev/null +++ b/atom/.env @@ -0,0 +1,132 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY= +APP_DEBUG=false +APP_URL=http://0.0.0.0 + +LOG_CHANNEL=stack +LOG_DEPRECATIONS_CHANNEL=null +LOG_LEVEL=debug + +# Change those to match your database settings +DB_CONNECTION=mysql +DB_HOST=mysql +DB_PORT=3306 +DB_DATABASE=arcturus +DB_USERNAME=arcturus_user +DB_PASSWORD=arcturus_pw + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +FILESYSTEM_DISK=local +QUEUE_CONNECTION=sync +SESSION_DRIVER=database +SESSION_LIFETIME=120 + +MEMCACHED_HOST=127.0.0.1 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=mailhog +MAIL_PORT=1025 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS="hello@example.com" +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= +AWS_USE_PATH_STYLE_ENDPOINT=false + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_HOST= +PUSHER_PORT=443 +PUSHER_SCHEME=https +PUSHER_APP_CLUSTER=mt1 + +VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +VITE_PUSHER_HOST="${PUSHER_HOST}" +VITE_PUSHER_PORT="${PUSHER_PORT}" +VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" +VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +## Custom variables +RCON_HOST=127.0.0.1 +RCON_PORT=3001 + +# Find retros settings +FINDRETROS_NAME= +FINDRETROS_ENABLED=false + +# Recaptcha settings +GOOGLE_RECAPTCHA_SITE_KEY= +GOOGLE_RECAPTCHA_SECRET_KEY= + +# Turnstile +TURNSTILE_SITE_KEY= +TURNSTILE_SECRET_KEY= + +# If set to true, Atom will rename any colliding table names when migration the first time around +RENAME_COLLIDING_TABLES=false + +# Flash client settings +FLASH_CLIENT_ENABLED=false +EMULATOR_IP=127.0.0.1 +EMULATOR_PORT=3000 +SWF_BASE_PATH=client/flash +HABBO_SWF=Habbo.swf +PRODUCTION_FOLDER=gordon/PRODUCTION +EXTERNAL_FURNIDATA=gamedata/furnidata.xml +EXTERNAL_FIGUREMAP=gamedata/figuremap.xml +EXTERNAL_FIGUREDATA=gamedata/figuredata.xml +EXTERNAL_PRODUCTDATA=gamedata/productdata.txt +EXTERNAL_TEXTS=gamedata/external_flash_texts.txt +EXTERNAL_VARIABLES=gamedata/external_variables.txt +EXTERNAL_OVERRIDE_TEXTS=gamedata/override/external_flash_override_texts.txt +EXTERNAL_OVERRIDE_VARIABLES=gamedata/override/external_override_variables.txt + +# Only enable if you come from a CMS like RevCMS +# This will only work if your password is hashed using md5 +# By default Atom CMS uses bcrypt, this is purely used to ease the process, when switching from a CMS using md5 +CONVERT_PASSWORDS=false + +# Enable this if your site is running through https, but you're experiencing issues with requests being made to "http" +FORCE_HTTPS=false + +# Default language for the site +APP_LOCALE=en + +# Enter the time in minutes that a password reset token can be valid +PASSWORD_RESET_TOKEN_TIME=15 + +# Set this to false if you aren't using Atom HK together with Atom CMS +# This will then disable features that aren't Arcturus MS related. +USING_ATOM_CMS=true + +# General paypal options +PAYPAL_MODE='sandbox' +PAYPAL_PAYMENT_ACTION='Order' +PAYPAL_CURRENCY='USD' +PAYPAL_NOTIFY_URL= +PAYPAL_LOCALE='en_US' +PAYPAL_VALIDATE_SSL=true + +#PayPal Setting & API Credentials - sandbox +PAYPAL_SANDBOX_CLIENT_ID= +PAYPAL_SANDBOX_CLIENT_SECRET= +PAYPAL_SANDBOX_APP_ID= + +#PayPal Setting & API Credentials - live +PAYPAL_LIVE_CLIENT_ID= +PAYPAL_LIVE_CLIENT_SECRET= +PAYPAL_LIVE_APP_ID= + +FORTIFY_PREFIX= \ No newline at end of file diff --git a/atom/Dockerfile b/atom/Dockerfile new file mode 100644 index 0000000..de5b299 --- /dev/null +++ b/atom/Dockerfile @@ -0,0 +1,21 @@ +FROM php:8.2-cli-alpine3.17 + +WORKDIR /app + +RUN apk update +RUN apk add bash +RUN apk add --no-cache linux-headers +RUN apk add npm +RUN apk add mysql-client +RUN apk add supervisor +RUN apk add rsync +RUN apk add --no-cache \ + libpng-dev \ + libjpeg-turbo-dev \ + libwebp-dev \ + libxpm-dev \ + libxml2-dev \ + openssl-dev \ + curl-dev + +RUN docker-php-ext-install curl fileinfo gd pdo_mysql sockets diff --git a/atom/scripts/build.sh b/atom/scripts/build.sh new file mode 100755 index 0000000..2cd9bbd --- /dev/null +++ b/atom/scripts/build.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +supervisord -c /app/supervisor/supervisord.conf + +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +php composer-setup.php +php -r "unlink('composer-setup.php');" +mv composer.phar /usr/local/bin/composer + +cd /app/atom +cp /app/.env /app/atom/.env + +/usr/local/bin/composer install +php artisan key:generate +npm install && npm run build:atom +rm -rf /app/atom/public/client + +chown -R $USER:www-data storage +chown -R $USER:www-data bootstrap/cache +chmod -R 775 storage +chmod -R 775 bootstrap/cache + +cd /app/atom-hk +cp /app/atom/.env /app/atom-hk/.env +/usr/local/bin/composer install +npm install && npm run build + +chown -R $USER:www-data storage +chown -R $USER:www-data bootstrap/cache +chmod -R 775 storage +chmod -R 775 bootstrap/cache + +supervisorctl start atom-cms +supervisorctl start atom-hk +tail -f /dev/null diff --git a/atom/supervisor/supervisord.conf b/atom/supervisor/supervisord.conf new file mode 100755 index 0000000..fdfd620 --- /dev/null +++ b/atom/supervisor/supervisord.conf @@ -0,0 +1,65 @@ +; Sample supervisor config file. + +[unix_http_server] +file=/run/supervisord.sock ; (the path to the socket file) +;chmod=0700 ; socked file mode (default 0700) +;chown=nobody:nogroup ; socket file uid:gid owner +;username=user ; (default is no username (open server)) +;password=123 ; (default is no password (open server)) + +;[inet_http_server] ; inet (TCP) server disabled by default +;port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface) +;username=user ; (default is no username (open server)) +;password=123 ; (default is no password (open server)) + +[supervisord] +logfile=/var/log/supervisord.log ; (main log file;default $CWD/supervisord.log) +;logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) +;logfile_backups=10 ; (num of main logfile rotation backups;default 10) +loglevel=info ; (log level;default info; others: debug,warn,trace) +;pidfile=/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +;nodaemon=false ; (start in foreground if true;default false) +;minfds=1024 ; (min. avail startup file descriptors;default 1024) +;minprocs=200 ; (min. avail process descriptors;default 200) +;umask=022 ; (process file creation umask;default 022) +;user=chrism ; (default is current user, required if root) +;identifier=supervisor ; (supervisord identifier, default is 'supervisor') +;directory=/tmp ; (default is not to cd during start) +;nocleanup=true ; (don't clean up tempfiles at start;default false) +;childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +;environment=KEY=value ; (key value pairs to add to environment) +;strip_ansi=false ; (strip ansi escape codes in logs; def. false) + +; the below section must remain in the config file for RPC +; (supervisorctl/web interface) to work, additional interfaces may be +; added by defining them in separate rpcinterface: sections +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///run/supervisord.sock ; use a unix:// URL for a unix socket +;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket +;username=chris ; should be same as http_username if set +;password=123 ; should be same as http_password if set +;prompt=mysupervisor ; cmd line prompt (default "supervisor") +;history_file=~/.sc_history ; use readline history if available + +; The below sample program section shows all possible program subsection values, +; create one or more 'real' program: sections to be able to control them under +; supervisor. + +[program:atom-cms] +command=/usr/local/bin/php artisan serve --host=0.0.0.0 --port=80 +process_name=atom-cms +directory=/app/atom +priority=999 +autostart=false +autorestart=unexpected + +[program:atom-hk] +command=/usr/local/bin/php artisan serve --host=0.0.0.0 --port=666 +process_name=atom-hk +directory=/app/atom-hk +priority=999 +autostart=false +autorestart=unexpected diff --git a/docker-compose.yaml b/docker-compose.yaml index 6e0d5a8..26356b1 100755 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -42,6 +42,22 @@ services: networks: nitro: + atom: + container_name: atom + build: + context: atom + entrypoint: ["/bin/sh","/app/scripts/build.sh"] + depends_on: + - mysql + - nitro + volumes: + - ./atom/:/app/ + ports: + - 8000:80 + - 666:666 + networks: + nitro: + mysql: container_name: mysql image: mariadb:10.6 diff --git a/justfile b/justfile index 5062b6d..5dbb7cc 100644 --- a/justfile +++ b/justfile @@ -10,13 +10,14 @@ install: # Start Mysql, Arcturus Emulator & Nitro (not in daemon mod) start-all: - docker-compose up + docker-compose up --build # Close docker containers, remove images and clean volumes clean-docker: docker-compose down docker image rm nitro-docker_arcturus -f docker image rm nitro-docker_nitro -f + docker image rm nitro-docker-atom -f docker volume rm nitro-docker_volume-arcturus-maven-repo docker volume rm nitro-docker_volume-arcturus-target docker volume rm nitro-docker_volume-mysql @@ -75,7 +76,6 @@ shell-nitro: watch-nitro: docker exec nitro supervisorctl tail -f nitro-dev-server - # Extract nitro assets from SWF extract-nitro-assets: docker exec -it nitro bash -c "cp /app/configuration/nitro-converter/configuration.json /app/nitro-converter/configuration.json" @@ -83,3 +83,14 @@ extract-nitro-assets: docker exec -it nitro bash -c "echo 'Moving assets...'" docker exec -it nitro bash -c "rsync -r /app/nitro-converter/assets/* /app/nitro-assets/" docker exec -it nitro bash -c "echo 'Done !'" + +# Enter in the Atom's shell: +shell-atom: + docker exec -it atom bash + +# Update nitro client path, hk path, apply hk migrations and get the installation key required in the initial setup +config-atom: + docker exec -it mysql mariadb -u arcturus_user -parcturus_pw arcturus -e "UPDATE arcturus.website_settings SET value = 'http://localhost:1080' WHERE (\`key\` = 'nitro_path');" + docker exec -it mysql mariadb -u arcturus_user -parcturus_pw arcturus -e "UPDATE arcturus.website_settings SET value = 'http://localhost:666' WHERE (\`key\` = 'housekeeping_url');" + docker exec -it atom bash -c "cd /app/atom-hk/; php artisan migrate --seed" + docker exec -it mysql mariadb -u arcturus_user -parcturus_pw arcturus -e "SELECT installation_key FROM arcturus.website_installation;" diff --git a/nitro/configuration/nitro-react/public/renderer-config.json b/nitro/configuration/nitro-react/public/renderer-config.json index 68dd9cf..1996576 100644 --- a/nitro/configuration/nitro-react/public/renderer-config.json +++ b/nitro/configuration/nitro-react/public/renderer-config.json @@ -24,13 +24,17 @@ "furni.rotation.bounce.steps": 20, "furni.rotation.bounce.height": 0.0625, "enable.avatar.arrow": false, - "system.animation.fps": 24, - "system.limits.fps": false, - "system.dispatcher.log": false, - "system.packet.log": false, + "system.log.debug": false, + "system.log.warn": false, + "system.log.error": false, + "system.log.events": false, + "system.log.packets": false, + "system.fps.animation": 24, + "system.fps.max": 60, "system.pong.manually": true, "system.pong.interval.ms": 20000, "room.color.skip.transition": true, + "room.landscapes.enabled": true, "avatar.mandatory.libraries": [ "bd:1", "li:0" @@ -105,4 +109,4 @@ "${images.url}/clear_icon.png", "${images.url}/big_arrow.png" ] -} +} \ No newline at end of file diff --git a/nitro/configuration/nitro-react/public/ui-config.json b/nitro/configuration/nitro-react/public/ui-config.json index dad659d..2187bc0 100644 --- a/nitro/configuration/nitro-react/public/ui-config.json +++ b/nitro/configuration/nitro-react/public/ui-config.json @@ -1,8 +1,8 @@ { "image.library.notifications.url": "${image.library.url}notifications/%image%.png", "achievements.images.url": "${image.library.url}Quests/%image%.png", - "camera.url": "camera-arcturus-url.com", - "thumbnails.url": "https://camera.com/thumbnail/%thumbnail%.png", + "camera.url": "https://camera.url", + "thumbnails.url": "https://camera.url/thumbnail/%thumbnail%.png", "url.prefix": "https://website.com", "habbopages.url": "${url.prefix}/", "group.homepage.url": "${url.prefix}/groups/%groupid%/id", @@ -11,23 +11,81 @@ "widget.dimmer.colorwheel": false, "avatar.wardrobe.max.slots": 10, "user.badges.max.slots": 5, + "user.tags.enabled": false, + "camera.publish.disabled": false, "hc.disabled": false, + "badge.descriptions.enabled": true, + "motto.max.length": 38, + "bot.name.max.length": 15, + "pet.package.name.max.length": 15, + "wired.action.bot.talk.to.avatar.max.length": 64, + "wired.action.bot.talk.max.length": 64, + "wired.action.chat.max.length": 100, + "wired.action.kick.from.room.max.length": 100, + "wired.action.mute.user.max.length": 100, + "game.center.enabled": false, + "guides.enabled": true, + "toolbar.hide.quests": true, + "navigator.room.models": [ + { "clubLevel": 0, "tileSize": 104, "name": "a" }, + { "clubLevel": 0, "tileSize": 94, "name": "b" }, + { "clubLevel": 0, "tileSize": 36, "name": "c" }, + { "clubLevel": 0, "tileSize": 84, "name": "d" }, + { "clubLevel": 0, "tileSize": 80, "name": "e" }, + { "clubLevel": 0, "tileSize": 80, "name": "f" }, + { "clubLevel": 0, "tileSize": 416, "name": "i" }, + { "clubLevel": 0, "tileSize": 320, "name": "j" }, + { "clubLevel": 0, "tileSize": 448, "name": "k" }, + { "clubLevel": 0, "tileSize": 352, "name": "l" }, + { "clubLevel": 0, "tileSize": 384, "name": "m" }, + { "clubLevel": 0, "tileSize": 372, "name": "n" }, + { "clubLevel": 1, "tileSize": 80, "name": "g" }, + { "clubLevel": 1, "tileSize": 74, "name": "h" }, + { "clubLevel": 1, "tileSize": 416, "name": "o" }, + { "clubLevel": 1, "tileSize": 352, "name": "p" }, + { "clubLevel": 1, "tileSize": 304, "name": "q" }, + { "clubLevel": 1, "tileSize": 336, "name": "r" }, + { "clubLevel": 1, "tileSize": 748, "name": "u" }, + { "clubLevel": 1, "tileSize": 438, "name": "v" }, + { "clubLevel": 2, "tileSize": 540, "name": "t" }, + { "clubLevel": 2, "tileSize": 512, "name": "w" }, + { "clubLevel": 2, "tileSize": 396, "name": "x" }, + { "clubLevel": 2, "tileSize": 440, "name": "y" }, + { "clubLevel": 2, "tileSize": 456, "name": "z" }, + { "clubLevel": 2, "tileSize": 208, "name": "0" }, + { "clubLevel": 2, "tileSize": 1009, "name": "1" }, + { "clubLevel": 2, "tileSize": 1044, "name": "2" }, + { "clubLevel": 2, "tileSize": 183, "name": "3" }, + { "clubLevel": 2, "tileSize": 254, "name": "4" }, + { "clubLevel": 2, "tileSize": 1024, "name": "5" }, + { "clubLevel": 2, "tileSize": 801, "name": "6" }, + { "clubLevel": 2, "tileSize": 354, "name": "7" }, + { "clubLevel": 2, "tileSize": 888, "name": "8" }, + { "clubLevel": 2, "tileSize": 926, "name": "9" } + ], "hotelview": { + "show.avatar": true, "widgets": { "slot.1.widget": "promoarticle", - "slot.1.conf": "", + "slot.1.conf": {}, "slot.2.widget": "widgetcontainer", - "slot.2.conf": "image:${image.library.url}web_promo_small/spromo_Canal_Bundle.png,texts:2021NitroPromo,btnLink:https://google.com", + "slot.2.conf": { + "image": "${image.library.url}web_promo_small/spromo_Canal_Bundle.png", + "texts": "2021NitroPromo", + "btnLink": "https://google.com" + }, "slot.3.widget": "promoarticle", - "slot.3.conf": "", + "slot.3.conf": {}, "slot.4.widget": "", - "slot.4.conf": "", + "slot.4.conf": {}, "slot.5.widget": "", - "slot.5.conf": "", + "slot.5.conf": {}, "slot.6.widget": "achievementcompetition_hall_of_fame", - "slot.6.conf": "", + "slot.6.conf": { + "campaign": "habboFameComp" + }, "slot.7.widget": "", - "slot.7.conf": "" + "slot.7.conf": {} }, "images": { "background": "${asset.url}/images/reception/stretch_blue.png", @@ -50,20 +108,30 @@ 0, 5 ], + "catalog.links": { + "hc.buy_hc": "habbo_club", + "hc.hc_gifts": "club_gifts", + "pets.buy_food": "pet_food", + "pets.buy_saddle": "saddles" + }, "hc.center": { "benefits.info": true, "payday.info": true, "gift.info": true, "benefits.habbopage": "habboclub", - "payday.habbopage": "hcpayday", - "catalog.buy": "habbo_club", - "catalog.gifts": "club_gifts" + "payday.habbopage": "hcpayday" + }, + "respect.options": { + "enabled": false, + "sound": "sound_respect_received" }, "currency.display.number.short": false, "currency.asset.icon.url": "${images.url}/wallet/%type%.png", "catalog.asset.url": "${image.library.url}catalogue", "catalog.asset.image.url": "${catalog.asset.url}/%name%.gif", "catalog.asset.icon.url": "${catalog.asset.url}/icon_%name%.png", + "catalog.tab.icons": false, + "catalog.headers": false, "chat.input.maxlength": 100, "chat.styles.disabled": [], "chat.styles": [