Git Product home page Git Product logo

akkadius / spire Goto Github PK

View Code? Open in Web Editor NEW
44.0 6.0 8.0 86.29 MB

[Spire] A rich, portable server editing and development toolkit for EverQuest Emulator servers

Home Page: https://github.com/Akkadius/spire

Makefile 0.08% Go 33.80% Dockerfile 0.06% Shell 0.10% JavaScript 0.11% CSS 2.59% HTML 0.02% Vue 13.10% TypeScript 50.10% Batchfile 0.02% Perl 0.01%
go golang spire eqemu database tool database-tool everquest emulator editing

spire's Introduction

image

A rich, portable server editing and development toolkit for EverQuest Emulator servers


Vue logo

Powered by Golang and Vue


image

image

image

image

image


Why Spire?

The motive for Spire is simple, to empower creativity in the super fans of EverQuest creating content on emulated servers.

Rich, deep, tooling that leaves no stone un-turned for quality and intuitiveness.

Built for the long haul with code generation to make keeping things up to date far easier.

Using Spire - Locally

Download the latest release. for your operating system.

Place the executable in your EverQuest Emulator Server directory and simply run it.

That's it. No dependencies, no installations, no extra steps.

Spire on your development server instantly.

image

image

Using Spire - Hosted

If you don't want to install Spire, but you just want to have it connected to your database over the internet similar to how EOC worked (If you're familiar with it) - you can do so by using the hosted Spire at http://spire.akkadius.com/ and navigate to the login page @ http://spire.akkadius.com/login

image

Once you've signed in with your Github account, you can manage your server connections. Navigate to Create New to create a new connection. Once you have connections created it is easy to switch between your connections and they are displayed at the bottom left.

image

Using Spire - Locally, but Remote

If you want to run Spire without an EQEmu server installation, place it in an empty folder alongside a eqemu_config.json with database information to connect to your MySQL server and it will connect remotely to the server specified in the configuration.

Spire is currently only to be used as a local development tool, it is not safe to host publicly without protected access until authentication and roles are implemented. (On the roadmap)

Feature Requests

Interested in a feature in Spire? Please file an issue in the issue tracker with the prefix [Feature Request]

Reporting Bugs

Found a bug? Please file an issue in the issue tracker with the prefix [Bug]

Contributing

Want to help contribute to Spire? Anyone can submit pull requests however learning the skills required to work in this project might require some extra help and learning resources.

Contributing - Project Layout - Backend

Path Description
./main.go Application entrypoint
./boot Application dependency injection folder. Where the application gets wired up, Google Wire is ran, wire sets are defined
./boot/app.go Where the application object itself is defined
./boot/wire.go Main Google wire definition file, builds the application from wire sets defined and produces wire_gen.go which is used by main.go
./boot/docs Where Swagger documentation gets automatically generated make generate-swagger (Ran from host). Also where echo-web serves the Swagger documentation which can be navigated at /swagger/index.html (API Docs in left navpane in Spire)
./internal Where core application packages are held. These are internal packages unique to Spire
./internal/models Where GORM models are kept
./internal/pathmgmt Where application path logic is held. Used to detect EQEmu server locations
./internal/unzip Unzip utility
./internal/github Github source downloader utility, used in the Quest API explorer
./internal/permissions Permissions logic
./internal/console Where most application console commands are held
./internal/influx InfluxDB client, used for telemetry
./internal/clientfiles EverQuest client files manipulation package. Currently handles importing and exporting of Spells and DbStr
./internal/desktop Package that handles opening up Spire in desktop environments when the application executable is double clicked
./internal/http Core application HTTP package. Routes, middleware, controllers are held here
./internal/env Env helper package
./internal/connection Database connection package, used for checking and creating database connections in hosted setups
./internal/serverconfig Package used for handling interacting with the eqemu server config
./internal/database Application database package
./internal/updater Package responsible for handling the automatic update routine in Spire. Has both Windows and Linux logic within and is ran on bootup in main.go
./internal/encryption Encryption package. Currently used for encrypting held credentials and sensitive information in the database
./internal/questapi Quest API Explorer package
./internal/generators Package that holds all code generation logic. Currently has generators for the db schema config, models, controllers. Configuration for generators are held in the ./internal/generators/config folder. Used for example to define database relationships

Contributing - Project Layout - Frontend

Path Description
./frontend/src/App.vue Application entrypoint Vue file
./frontend/src/main.ts Application entrypoint Typescript file - Where global CSS, components sheets get imported, Vue instance is constructed
./frontend/src/router.ts Where application routes are defined. Frontend routes get mapped to view *.vue pages (in the ./views folder)
./frontend/src/routes.ts Constants of route definitions. Used in router.ts as well other parts of the app to keep consistent route definitions
./frontend/src/views Where main application pages (Editors etc.) and folders are contained.
./frontend/src/components Where application components are held. These are components that don't necessarily belong to any specific page or tool and are used cross-application.
./frontend/src/app Main Vue app folder. Where business logic is kept for common classes, utilities, domain objects.
./frontend/src/app/api Where Spire's code generated API client is outputted.
./frontend/src/app/constants Where application constant definitions are kept.
./frontend/src/public Where static assets are held. Things not included by webpack, index.html etc. Mainly served here during development. In production the assets are served directly by the backend

Contributing - Learning Resources

Area Topic Resource
Frontend Learning Vue Learn Vue 2 - Step by Step
Backend Learning Go Learn Go Programming - Golang Tutorial for Beginners
Backend Go CLI Library used in Spire Cobra Github
Backend Web Framework Used in Spire Echo Web Labstack Docs
Backend Database Interaction (ORM) Gorm - The fantastic ORM library for Golang
Backend Google Wire - Dependency Injection Google Wire Github - Tutorial
Backend Go Dot Env (.env file loader) joho/godotenv
Backend Echo Swagger - Used to serve swagger docs Echo Swagger Github
Backend Swaggo Generator - Used to code generate swagger documentation Swaggo

Contributing - Cutting a Release

When looking to cut a new release of Spire, a PR will need to be made that resembles the following example here. A version tag will need to be declared in both CHANGELOG.md containing proper release notes and the same version number will need to be updated in package.json.

image

When the changes are committed to master the Drone CI pipeline will automatically take care of the rest and publish the release to the releases page

image

Developer Setup

These are instructions for those who are looking to develop on Spire. If you are just trying to use the tool then see the using Spire sections.

Linux Development Setup

enter image description here

These instructions assume you have git, node, docker already installed. All of the dependencies are taken care of within the docker environment.

  • Git - Install with your package manager
  • Node
  • Docker

Linux - Clone

First clone Spire, copy the base .env.dev file to the .env used by Spire in local development and run make install in one line below.

git clone https://github.com/Akkadius/spire.git

Linux - Install

cd spire && cp .env.dev .env && make install && make install-frontend

Linux - Install - What happens

  • MariaDB container gets initialized with credentials held in .env (make mysql-init)
  • A ProjectEQ database gets seeded into the database container from http://db.projecteq.net/api/v1/dump/latest (make seed-peq-database) to a database called peq
  • Spire tables get installed to a separate spire database (make seed-spire-tables)
  • Installs static assets (icons, images, preview images) (make install-assets) from https://github.com/Akkadius/eq-asset-preview
  • Installs frontend/.env.example which is required in development to properly route API requests to the development backend (VUE_APP_BACKEND_BASE_URL=http://localhost:3010) (make install-frontend)

Linux - Running Development Watchers

Conveniently, there are two make commands that run the development watchers for both the back-end and the front-end.

Linux - Backend Web API Development Watcher

Re-compiles and runs the backend webserver when changes are detected in *.go files.

make watch-be

image

Linux - Frontend Vue Development Watcher

Runs the Vue development webserver and hot-reload's when changes are detected in the ./frontend folder (Ignores node_modules and public). Changes are reflected real-time in the browser.

make watch-fe

image

Linux - Browse

At this point, you should be able to browse to http://localhost:8080 to view the development server.

image

Windows Development Setup

image

For Windows development environment, install the following pre-requisites before proceeding with the next steps

Windows - Pre-Requisites

  • Install Windows Git (For Git Bash)
  • Install Docker you may need to install additional kernel components for WSL2 which will be instructed in the Docker installation

All other necessary software gets automatically installed through the subsequent automated steps

Windows - Docker

Windows for Docker can be terrible on performance, for this reason a lot of the development environment operations are done at the host level to keep things simple, fast.

You can use the workspace bash container but do know it comes with a performance hit. The containerized MariaDB database is also a convenience as well.

You can point the .env to a separate eqemu server installation if you want to avoid Docker altogether and run everything on the host.

Windows - Clone

Clone Spire to a directory of your choosing

git clone https://github.com/Akkadius/spire.git  

Windows - Init

Once you have your pre-requisites installed you will need to run windows-init.bat on the top level folder as administrator

This init step will perform the following automatically

  • Install Choco a package manager for Windows
  • Install Golang
  • Install NodeJS LTS version
  • Install Make for make commands
  • Copies .bashrc .bash_profile files to ~/ home directory
  • Copies .wslconfig to ~/ home directory
  • Initializes the Frontend ./frontend/.env.example.windows as frontend/.env (Tells the development webserver where to route API calls for development)
  • Initializes the Backend .env.dev to .env
  • Launches a Git Bash (MinGW) shell when done for the following steps

Windows - Install Environment

In a MinGW shell, which you should have after Windows Init batch file is done running - you run the following command

make install  

If you don't have a MinGW window already open from the previous step; either click the windows-bash.bat alias or launch a "Git Bash" instance yourself through the Windows Start Menu and cd to the Spire folder

Make install will do the following things automatically

  • Build the workspace docker image; the workspace contains Go and many other utilities installed and fully working out of the box. For windows users we will try to run as many things on the host as much as possible to avoid performance or compatibility issues. This can be bashed into using windows-workspace-bash.bat
  • Build the mysql docker image which will contain a basic mariadb instance with a relatively tuned database configuration
  • Initializes a local MariaDB instance that you can access from localhost port 33066 (Note the extra 6 so we don't conflict with a local install)
  • Creates local databases peq and spire
  • Seeds the latest ProjectEQ database for development purposes to the local peq database
  • Seeds the local Spire database tables to the spire database

At this point the installation should be complete and you should have everything that you need to develop. For good measure and because this is Windows, you should probably reboot

Windows - Running Development Watchers

To run the backend and frontend development servers in Windows; there are simply two top level batch scripts that you can run

  • windows-backend-web.bat This will run the Golang backend web process on port 3001 (in windows) and will reload when any changes are made to the codebase
  • windows-frontend-web-dev.bat This will run the NodeJS Webpack watcher which will serve the frontend web development instance and will hot reload any changes made to the frontend codebase on the fly

Both of these scripts are designed to kill an already running instance when it is ran again

Basic Auth

If you want to run Spire on a hosted webserver with very basic authentication, you now can today until a more robust users, permissions system is built out.

Simply supply two environment variables BASIC_AUTH_USER and BASIC_AUTH_PASSWORD and Spire will only allow requests if you pass the basic authentication gate

spire's People

Contributors

aeadoin avatar akkadius avatar kayeneq avatar kinglykrab avatar knervous avatar xackery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

spire's Issues

[Task Editor: Feature Request]

When using the description editor component and editing activity level descriptions, provide the default activity description to the user for reference.

[Quest API] Add EVENT Examples

When a user navigates to EVENT documentation; have a link on the event to examples as well as show examples when first navigating to the event.

Spire - Saving a Second Activity bug

This bug has bigger implications. A server will stop functioning correctly if the task isn't saved to the DB correctly.

To reproduce:
a. Open Spire
b. Go to Tasks and Create a New task
c. Set your description and rewards.
d. Hit Save
e. Go to the Activities Tab
f. Create your first activity. You can hit save After.
g. Use the + to create another activity. Enter in your details and hit Save.
f. Now that the task has been saved look at the tasks list and select another task.
g. Toggle back to the task you just created. The 2nd activity you just created will revert itself to Kill 1 Orc task.
h. At this point We've noticed on Karana that the task is corrupted. The server (see screenshot)
image
Begins to toggle between 28 and 32,, and you loose connection with the world server. Eventually Clients cease to be able to zone into new zones with a "failed to zone XXXX" message.
I. ... To resolve the server from completely nuking itself, i opened spire again and deleted the newly created task.. After that the server held a 30/30 zone stable and once i rebooted the server we're back in biz.

-Thanks
-ish (mort)

=======Old info Below but might be useful=========
I think there is a bug in Tasks. Essentially making a 2nd activity entry.
Steps: I cloned a task
Click the + Activities to add another Step 1,
Change goal method to kill a few npcs (list) within the Tab I hit save.
Task flashes that it is saved and updated.
However, if you go to another task and go back to the one you just saved the newly added 2nd activity isn't saved.

1
2

[PANIC RECOVER] runtime error: - Just saw this first time launching in a week or so.

[Update] Checking for updates...
[Update] Running as binary [spire-windows-amd64.exe]
[Update] Spire is already up to date @ [v1.13.3]


/ // / ___
/ // / _ / _
/
/_
////___/ v4.7.2
High performance, minimalist Go web framework
https://echo.labstack.com
_____________________________O/
O
⇨ http server started on [::]:8090
method=GET, uri=/, status=200, time=108.5877ms
method=GET, uri=/api/v1/app/env, status=200, time=87.0037ms
method=GET, uri=/api/v1/me, status=200, time=595.7µs
method=GET, uri=/api/v1/me, status=200, time=0s
{"time":"2022-08-12T16:46:21.6622244-07:00","level":"-","prefix":"echo","file":"recover.go","line":"113","message":"[PANIC RECOVER] runtime error: invalid memory address or nil pointer dereference goroutine 31 [running]:\ngithub.com/labstack/echo/v4/middleware.RecoverWithConfig.func1.1.1()\n\t/home/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/recover.go:93 +0x14e\npanic({0xfa7720, 0x2b970b30})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngorm.io/gorm.(*DB).getInstance(0x48e637)\n\t/home/go/pkg/mod/gorm.io/[email protected]/gorm.go:363 +0x18\ngorm.io/gorm.(*DB).Model(...)\n\t/home/go/pkg/mod/gorm.io/[email protected]/chainable_api.go:18\ngithub.com/Akkadius/spire/internal/http/controllers.(*ConnectionsController).list(0xc00021a1b0, {0x2a72ac50, 0xc000156500})\n\t/drone/src/internal/http/controllers/connections_controller.go:141 +0xba\ngithub.com/Akkadius/spire/internal/http/middleware.RateLimiterWithConfig.func1.1({0x2a72ac50, 0xc000156500})\n\t/drone/src/internal/http/middleware/ratelimiter.go:173 +0x86f\ngithub.com/Akkadius/spire/internal/http/middleware.ReadOnlyMiddleware.Handle.func1.1({0x2a72ac50, 0xc000156500})\n\t/drone/src/internal/http/middleware/read_only_middleware.go:33 +0x871\ngithub.com/labstack/echo/v4/middleware.JWTWithConfig.func1.1({0x2a72ac50, 0xc000156500})\n\t/home/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/jwt.go:206 +0xbe\ngithub.com/labstack/echo/v4/middleware.JWTWithConfig.func1.1({0x2a72ac50, 0xc000156500})\n\t/home/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/jwt.go:206 +0xbe\ngithub.com/labstack/echo/v4.(*Echo).add.func1({0x2a72ac50, 0xc000156500})\n\t/home/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:520 +0x51\ngithub.com/Akkadius/spire/internal/http/spa.PackedSpaService.MiddlewareHandler.func1.1({0x2a72ac50, 0xc000156500})\n\t/drone/src/internal/http/spa/spa.go:84 +0x5a5\ngithub.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1({0x2a72ac50, 0xc000156500})\n\t/home/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/cors.go:142 +0x470\ngithub.com/labstack/echo/v4/middleware.RecoverWithConfig.func1.1({0x2a72ac50, 0xc000156500})\n\t/home/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/recover.go:119 +0x10a\ngithub.com/labstack/echo/v4/middleware.LoggerWithConfig.func2.1({0x2a72ac50, 0xc000156500})\n\t/home/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/logger.go:117 +0xe2\ngithub.com/Akkadius/spire/internal/http/middleware.RequestLogMiddleware.Handle.func1.1({0x2a72ac50, 0xc000156500})\n\t/drone/src/internal/http/middleware/request_log_middleware.go:30 +0xb4\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP.func1({0x2a72ac50, 0xc000156500})\n\t/home/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:624 +0x132\ngithub.com/labstack/echo/v4/middleware.RemoveTrailingSlashWithConfig.func1.1({0x2a72ac50, 0xc000156500})\n\t/home/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/slash.go:118 +0x211\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc01045a000, {0x2a6f9d58, 0xc00fb020e0}, 0xc00ffae800)\n\t/home/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:630 +0x3bc\nnet/http.serverHandler.ServeHTTP({0xc010a74ff0}, {0x2a6f9d58, 0xc00fb020e0}, 0xc00ffae800)\n\t/usr/local/go/src/net/http/server.go:2878 +0x43b\nnet/http.(*conn).serve(0xc0000e4500, {0x2a7073a0, 0xc010a74f00})\n\t/usr/local/go/src/net/http/server.go:1929 +0xb08\ncreated by net/http.(*Server).Serve\n\t/usr/local/go/src/net/http/server.go:3033 +0x4e8\n\ngoroutine 1 [chan receive]:\ngithub.com/Akkadius/spire/internal/desktop.(*WebBoot).Boot(0xc00ffa1460)\n\t/drone/src/internal/desktop/web_boot_service.go:57 +0x1c9\nmain.main()\n\t/drone/src/main.go:36 +0x185\n\ngoroutine 15 [IO wait]:\ninternal/poll.runtime_pollWait(0x21c7d7cf5b0, 0x72)\n\t/usr/local/go/src/runtime/netpoll.go:234 +0x89\ninternal/poll.(*pollDesc).wait(0xc00ffa3f40, 0x2ad02830, 0x0)\n\t/usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x32\ninternal/poll.execIO(0xc00017db98, 0x2a5d6070)\n\t/usr/local/go/src/internal/poll/fd_windows.go:175 +0xe5\ninternal/poll.(*FD).Read(0xc00017db80, {0xc00021a9d1, 0x1, 0x1})\n\t/usr/local/go/src/internal/poll/fd_windows.go:441 +0x25f\nnet.(*netFD).Read(0xc00017db80, {0xc00021a9d1, 0xc00ffa3f70, 0x2b9f9201})\n\t/usr/local/go/src/net/fd_posix.go:56 +0x29\nnet.(*conn).Read(0xc0000ce708, {0xc00021a9d1, 0x0, 0x1})\n\t/usr/local/go/src/net/net.\n"}
method=GET, uri=/api/v1/connections, status=422, time=42.9148ms
method=GET, uri=/api/v1/me, status=200, time=0s
method=GET, uri=/api/v1/me, status=200, time=0s
method=GET, uri=/eq-asset-preview-master/assets/wallpaper/spire-wall.jpg, status=200, time=275.4721ms
method=GET, uri=/api/v1/app/changelog, status=200, time=9.0184ms

[Task Editor: Possible Optimization]

Scenario:

You are editing tasks.
You click into "Goal ID"-> The NPC Selector opens.
You start to move the mouse over to the NPC selector to make a selection, etc...BUT...there are several textboxes in between the Goal ID text box and the right side of the screen.
If you mouse-over one of the other text boxes, the npc selector goes poof and you have to start over.

Is there a way to add a hover delay of some sort before anything changes with the selector component?

List of Enhancements / Feedback

Items:

  • Add New Button
  • Delete Button

NPC Spells:

  • Add Button.
  • A Back button (back to main list) when you've already edited a spell.
  • Bulk Edit. Instead of editing each min/max level the main grid to adjust recast times, levels etc might be cool
  • Bot spell editing ability. This isn't in scope but would be great I think

NPC Edits:

  • Pet update section. Add new etc.

Zones:

  • Bulk Edit > Scale all NPC's in Zone.

Goes without saying but I'll say it anyway. Spire is simply amazing.

cannot overwrite non-directory with directory

Trying to install Spire on Debian, following the github steps and eventually get the following error every time:

cp: cannot overwrite non-directory './frontend/public/eq-asset-preview-master' with directory '/tmp/assets/eq-asset-preview-master/'
make[1]: *** [Makefile:186: install-assets] Error 1
make: *** [Makefile:178: install] Error 2

I've removed everything and restarted the install, but keep getting stuck at the same point.

[Quest API] EVENT_ENTER Missing

Source call is different from the others

	for (auto iter = events.begin(); iter != events.end(); ++iter) {
		quest_proximity_event& evt = (*iter);
		if (evt.npc) {
			std::vector<EQ::Any> args;
			parse->EventNPC(evt.event_id, evt.npc, evt.client, "", 0, &args);
		} else {
			std::vector<EQ::Any> args;
			args.push_back(&evt.area_id);
			args.push_back(&evt.area_type);
			parse->EventPlayer(evt.event_id, evt.client, "", 0, &args);
		}
	}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.