Meteor beginner, tearing my hair out about this one...
I have a meteor web app (a little game) where I would like to disable everything client-side while I manually update the database and run some checks. So, for a very short space of time, I just need to disable anything coming from my users and render a template that says "Game scores are being updated, come back later etc. etc."
My first thought was just to have this template based on something like Session.set("serverUpdating", true) but then that's something that could just be reset by anyone in their browser, right?
What is the best way to achieve what I want, securely? Any guidance much appreciated!
One way would be to create an admin collection that contains this state information. Publish it to all clients and have your master layout or router use it to switch to a maintenance page when it's set. Make sure you have deny rules setup to avoid any clients modifying it. Then when you want to go into maintenance just use the mongo console to update that collection and revert when you're done.
Related
I have a running Kentico 11 portal engine site and need to update the transformations in my navigation menu control. Something I have done many times before.
Today I went through all of the steps and the save button does not update the code. It never displays the change were saved messaging.
When I open the browser dev tools I see several errors on the page:
errors
A couple of things to check.
Is this happening in different browsers, also?
Can you save other transformations?
On this particular web part, if you select a different transformation, will that save successfully?
And, is the event log registering any errors?
Sounds like it may be a caching issue. What I'd suggest is the following:
restarting IIS
Open a private browser window and log in
attempt to make an edit to the code in question
If this does not resolve the issue, have you made any changes recently to the web.config, in particular the CMSHashstringsalt value? If so, this will cause your macros to become invalidated. You'll need to go to System > Macros > Signatures and check both boxes and resign the macros. It may take some time depending on your site but this could also help resolve your issue.
I have a collection of 15k+ objects(database) that I want to send to the client(an application). This can take up to 30sec to sync.
I would like a way to keep cache between user visits so I only need to sync the difference since my last visit.
It would be also nice to be able to share that local cache between browser tabs.
In theory I don't see why it would be hard to do so, but I am uncertain how to do it.
*As pointed out by #zeroasterisk it is a database cache I am looking for, not simply static files.
Have you looked at the smart package "appcache" ?
code: https://github.com/awwx/meteor-appcache
info: http://docs.meteor.com/#appcache
more: https://github.com/meteor/meteor/wiki/AppCache
The appcache package stores the static parts of a Meteor application (the client side Javascript, HTML, CSS, and images) in the browser's application cache. To enable caching simply add the appcache package to your project.
It doesn't currently support data in collections, which is what I think you were asking about, but it might be something you could extend. If I mis-understood the question and you just need to store static objects (JS files, etc) this will work great.
more on this here: Can Meteor's Appcache also store database data?
note: it is disabled by default in FF because of user prompts...
This has been asked in similar forms here and here but it seems pretty important, and the framework is under rapid development, so I'm going to raise it again:
Assuming your login page needs to face the public internet, how do you prevent Meteor from sending all of the authenticated user templates to a non-authenticated client?
Example use case: You have some really unique analytics / performance indicators that you want to keep secret. You've built templates to visualize each one. Simply by visiting the login page, Meteor will send any rando the templates which, even unpopulated, disclose a ton of proprietary information.
I've seen two suggestions:
Break admin into a separate app. This doesn't address the issue assuming admin login faces the public internet, unless I'm missing something.
Put the templates in the public folder or equivalent and load them dynamically. This doesn't help either, since the file names will be visible from other templates which will be sent to the client.
The only thing I can think of is to store the template strings in the server folder and have the client call a Meteor.method after login to retrieve and render them. And if you want them to behave like normal client templates, you'd have to muck around with the internal API (e.g., Meteor._def_template).
Is there any more elegant way to do this?
I asked a similar question here:
Segmented Meteor App(s) - loading only half the client or two apps sharing a database
Seems to be a common concern, and I certainly think it's something that should be addressed sometime.
Until then, I'm planning on making a smaller "public" app and sharing the DB with an admin app (possibly in Meteor, possibly in something else, depending on size/data for my admin)
These 2 packages try to address this issue:
https://atmospherejs.com/numtel/publicsources
https://atmospherejs.com/numtel/privatesources
It uses an iron-router plug-in to load your specific files on every route.
The main drawback I see here is that you must change your app structure, as the protected files need to be stored in /public or /private folder.
Also you are supposed to use iron-router.
I have been tasked with making my company's Web App available offline. Before I move to the actual development phase, I want to be sure that my current strategy will not turn out to be a bust.
I first thought about using html5 app cache but after doing some tests I found that it seems to not cache the server side operations but the actual html that is rendered (Please correct me if I'm wrong). This will not work because the rendered html depends upon who is currently logged in. From my tests, it always rendered the html as if the last person that logged in (online) is logging in.
My current strategy is this:
I cache only the login page and an offline (.html) page to correspond to each aspx page that will need to be available offline. Every successful login (online) results in creating or updating Web SQL Database or IndexDB (depending on browser) with all data needed for that person to operate offline including a table that will be used for login credentials. In this way the only requirement for logging in offline is logging in with your login credentials at least one time.
My concern is that I am overcomplicating it. In order to make this work, I will need to create an html page for each current page (a lot of pages) and I will have to rewrite everything that is currently being done on the server in JavaScript including validation, database calls, populating controls such as dropdown lists and data grids, etc. Also everything that I change in the future will require a subsequent offline change.
Is there an established best practice for what I am trying to do that I am overlooking or am I venturing into new ground?
Please refer to these links, which gives you some insight on what is to be achieved. I'm not sure these are best practices, but these will be good starting point.
http://www.c-sharpcorner.com/UploadFile/aravindbenator/offline-mvc3-application/
http://www.developerfusion.com/article/84438/isolated-storage/
What are some the items you change in your test environments to make them standout from production, and how do you go about make these changes? I know you can change the PS LOGO, but what else do you change in your test environments? Colors, fonts, etc.
Changing the colour schemes isn't too difficult. If you want to go down that route and need a helping hand I'll be happy to assist.
Other clients just put the environment name in the PIA Greeting. That's easy too:
http://peoplesofttipster.com/2007/06/13/using-the-pia-welcome-message/
I've not heard of anyone changing fonts though.
kind regards
Duncan
When you refresh a db, make sure you change tools tables that have dbname, web urls, and so on. The test db name will appear in the portal menu.
Changing the fonts would require changing all the style sheet definitions, a major headache. I guess you could go in and edit some basic style sheet attributes in app designer, PS_TEXT, et.al. and change those in a test environment. Maybe just changing a few would be enough.
Most test envs also open up security to some degree, simply because testers and developers likely need access to everything. So people's menus are going to be much larger than in production.
This is the relatively small change we made, to replace the "Home" link in the toolbar with the name of the environment eveywhere but prod. It was also incorporated in the refresh scripts to pull in the DBNAME dyanmically.
update psmsgcatdefn set message_text = 'DBNAME', descrlong = 'Environment name home replacement' where message_set_nbr = '95' and message_nbr = '401';
items to watch for:
file paths - if you open files for reading, and especially writing, to communicate with external systems, then you need to make sure you are not stepping on Production toes.
I would assume web services would also need the same re-routing so you don't "hit" live external production web services.
emails. workflow or other subsystems are liable to fire off emails to users or external parties. you need to make sure those emails are tester emails instead, not real addressees.