npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mura-impersonate-nuxt

v1.0.2

Published

A package that allows a Mura super user to impersonate other Mura users.

Downloads

3

Readme

mura-impersonate-nuxt

A package that allows a Mura super user to impersonate other Mura users.

Before you start

Create a Mura-Nuxt project by following the instructions at https://github.com/murasoftware/mura-nuxtjs-decoupled.git

Once you have your Mura-Nuxt implementation working, you can follow the below steps.

Getting started

Here's a video of me going through the below steps: https://www.loom.com/share/6b1ae4fccf474e12923a794961dac87f

  1. Install mura-impersonate-nuxt into your nuxtjs directory
cd /path/to/nuxtjs
npm install --save mura-impersonate-nuxt
  1. Download the tarball and extract it into your mura directory
cd /path/to/mura
tar xvzf /path/to/file/nuxtutils.tar
  1. Adjust the CFMLServlet in your web.xml to include the custom API paths by adding this line: <url-pattern>/nuxtutils/index.cfm/*</url-pattern>:
<servlet-mapping>
	<servlet-name>CFMLServlet</servlet-name>
	<url-pattern>*.cfm</url-pattern>
	<url-pattern>*.cfml</url-pattern>
	<url-pattern>*.cfc</url-pattern>
	<url-pattern>/nuxtutils/index.cfm/*</url-pattern>
	<url-pattern>/index.cfm/*</url-pattern>
	<url-pattern>/index.cfc/*</url-pattern>
	<url-pattern>/index.cfml/*</url-pattern>
</servlet-mapping>
  1. In the mura service within your docker-compose.yml, load in the new nuxtutils directory and web.xml file:
volumes:
	#- ../../mura/core:/var/www/core
	- ./nuxtutils:/var/www/nuxtutils
	- ./web.xml:/usr/local/tomcat/conf/web.xml
	- mura_nuxtjs_decoupled_plugins:/var/www/plugins
	- mura_nuxtjs_decoupled_themes:/var/www/themes
	- mura_nuxtjs_decoupled_sites:/var/www/sites
  1. Rebuild and restart your Docker containers:
docker-compose down
docker-compose up -d
  1. Log in to Mura admin. In the site settings, create a new REST service called s2usertoken. Copy the generated "Basic ..." auth string for the basicAuthS2Token variable in the next step.

  2. Create a env property in your nuxt.config.js file if you don't already have one. Add the following variables:

env: {
	rootpath: "http://localhost:8888",
	impersonateDomain: ".localhost",
	s2usertoken: "s2usertoken",
	basicAuthS2Token:
		"Basic ...authStringfromPreviousStep...",
}
  1. In your nuxt.config.js add mura-impersonate-nuxt to the modules section:
modules: [
	"mura-impersonate-nuxt"
]
  1. In your nuxtjs directory, create the pages/impersonate.vue page:
<template>
<div>
	<main role="main" class="container">
		<h1 class="mt-5">Impersonate a user</h1>
		<input v-model="targetUsername" type="text" />
		<p>Target: {{targetUsername}}</p>
		<button @click="$impersonateUser(targetUsername)">CLICK TO IMPERSONATE USER</button>
	</main>
</div>
</template>

<script>
export default {
	data() {
		return {
			targetUsername: "",
		}
	},
}
</script>
  1. Start your Nuxt dev server
npm run dev
  1. Login to Mura as a super user, then visit the /impersonate page and enter another user's username.

Relevant directory structure

.
├── mura
│   ├── nuxtutils
│   │   ├── beans
│   │   │   └── nuxtUtilsService.cfc
│   │   └── index.cfm
│   ├── docker-compose.yml
│   ├── Dockerfile
│   └── web.xml
└── nuxtjs
    ├── pages
    │   ├── impersonate.vue
    │   └── index.vue
    └── nuxt.config.js