Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
132 changes: 132 additions & 0 deletions atom/.env
Original file line number Diff line number Diff line change
@@ -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=
21 changes: 21 additions & 0 deletions atom/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions atom/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -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
65 changes: 65 additions & 0 deletions atom/supervisor/supervisord.conf
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -75,11 +76,21 @@ 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"
docker exec -it nitro bash -c "cd /app/nitro-converter; yarn ts-node-dev --transpile-only src/Main.ts"
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;"
14 changes: 9 additions & 5 deletions nitro/configuration/nitro-react/public/renderer-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -105,4 +109,4 @@
"${images.url}/clear_icon.png",
"${images.url}/big_arrow.png"
]
}
}
Loading