I don't need to reboot my host or restart docker very often but it has come up a couple times recently.
The problem is that when docker restarts containers are not being assigned the IPs they previously used -- a data container might have been 172.17.0.2 before but is 172.17.0.9 after a reboot. Because of this the web container is unable to connect to a database and I am forced to find my data container's IP, reconfigure and rebuild the web container.
I'd love to avoid this.
Thinking that I could at least avoid the need to look up and reconfigure the ip (skipping straight to launcher rebuild) I have tried linking the containers but I am unable to bootstrap when doing so - it fails when trying to connect to the database, unable to resolve the host; I am using 'data' for the link alias and 'data' for DISCOURSE_DB_HOST/DISCOURSE_REDIS_HOST.
What can I do to make life easier? I'd like to at least have the link work. Better still I'd love to have static IPs for my containers so that regardless of what order things were automatically started in everything would be connected once all containers started.
Hi, everyone! For the past week since we moved to using discourse, our forum installation (http://forum.kirupa.com) is constantly throwing 500 Internal Server error messages. Checking through the logs, nothing seems out of the ordinary. I was watching my processes a few moments ago, and about 5 minutes before the errors started appearing, this is what I saw:
The only workaround I've found is for me to restart the DigitalOcean droplet. That seems to fix things for a few hours before the errors start occurring.
So we were looking at implementing a backend for discourse using a technology other than Ruby (and we are aware of the various discussions made on the topic in the past).
We were pretty sure Discourse relies heavily on REST APIs and as such this change would be relatively easy - basically just ship the statics somehow to the client and then have them talk with our non-Ruby API clone.
However we could have not been more wrong. Discourse seems to be completely view-based and not rely on REST at all.
Are there plans to detach the client bits from the server bits in such a way that would allow implementing more backends? to us, Discourse is more of a client-side and UI magic.
Hi I am trying to modify PHPBB3 import script to create users from a database. Here is my code
require File.expand_path(File.dirname(__FILE__) + "/../../config/environment")
require File.expand_path(File.dirname(__FILE__) + "/base.rb")
#require_dependency 'url_helper'
#require_dependency 'file_helper'
require "mysql2"
class ImportScripts::AlayaranSO < ImportScripts::Base
include ActionView::Helpers::NumberHelper
PHPBB_DB = "alayaran_so"
BATCH_SIZE = 1000
ORIGINAL_SITE_PREFIX = "oldsite.com" # without http(s)://
NEW_SITE_PREFIX = "http://www.alayaran.com" # with http:// or https://
# Set PHPBB_BASE_DIR to the base directory of your phpBB installation.
# When importing, you should place the subdirectories "files" (containing all
# attachments) and "images" (containing avatars) in PHPBB_BASE_DIR.
# If nil, [attachment] tags and avatars won't be processed.
# Edit AUTHORIZED_EXTENSIONS as needed.
# If you used ATTACHMENTS_BASE_DIR before, e.g. ATTACHMENTS_BASE_DIR = '/var/www/phpbb/files/'
# would become PHPBB_BASE_DIR = '/var/www/phpbb'
# now.
PHPBB_BASE_DIR = '/var/www/phpbb'
AUTHORIZED_EXTENSIONS = ['jpg', 'jpeg', 'png', 'gif', 'zip', 'rar', 'pdf']
# Avatar types to import.:
# 1 = uploaded avatars (you should probably leave this here)
# 2 = hotlinked avatars - WARNING: this will considerably slow down your import
# if there are many hotlinked avatars and some of them unavailable!
# 3 = galery avatars (the predefined avatars phpBB offers. They will be converted to uploaded avatars)
IMPORT_AVATARS = [1, 3]
def initialize
super
@client = Mysql2::Client.new(
host: "172.16.22.1",
username: "sn",
password: "abc@123",
database: PHPBB_DB
)
phpbb_read_config
end
def execute
import_users
#import_posts
end
def import_users
puts '', "creating users"
total_count = mysql_query("SELECT count(*) count FROM user WHERE 1;").first['count']
batches(BATCH_SIZE) do |offset|
results = mysql_query(
"SELECT id, username, name, about, email, loc, createdate,img
FROM user u
WHERE 1
ORDER BY u.id ASC
LIMIT #{BATCH_SIZE}
OFFSET #{offset};")
break if results.size < 1
create_users(results, total: total_count, offset: offset) do |user|
{ id: user['id'],
email: user['email'],
username: user['username'],
name: user['name'],
created_at: Time.zone.at(user['createdate']),
active:"TRUE",
approved:"TRUE"
}
end
end
end
I have install the forum which was bitnami discourse 1.0.3 www.alayaran.com
But the following errors encountered. I dont know how to proceed
/opt/discourse-1.0.3-0/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.7.0/lib/bundler/runtime.rb:76:in `require': cannot load such file -- rb-inotify (LoadError)
from /opt/discourse-1.0.3-0/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.7.0/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /opt/discourse-1.0.3-0/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.7.0/lib/bundler/runtime.rb:72:in `each'
from /opt/discourse-1.0.3-0/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.7.0/lib/bundler/runtime.rb:72:in `block in require'
from /opt/discourse-1.0.3-0/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.7.0/lib/bundler/runtime.rb:61:in `each'
from /opt/discourse-1.0.3-0/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.7.0/lib/bundler/runtime.rb:61:in `require'
from /opt/discourse-1.0.3-0/ruby/lib/ruby/gems/2.0.0/gems/bundler-1.7.0/lib/bundler.rb:133:in `require'
from /opt/discourse-1.0.3-0/apps/discourse/htdocs/config/application.rb:15:in `<top (required)>'
from /opt/discourse-1.0.3-0/ruby/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /opt/discourse-1.0.3-0/ruby/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /opt/discourse-1.0.3-0/apps/discourse/htdocs/config/environment.rb:2:in `<top (required)>'
from /opt/discourse-1.0.3-0/ruby/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /opt/discourse-1.0.3-0/ruby/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from apps/discourse/htdocs/script/import_scripts/alayaran_so.rb:1:in `<main>'
I've saw seen a flurry of tweets about the Google Cloud Contain Engine announcement, especially in reference to Docker. The Container Engine is clearly labelled "Alpha", but apart from that label, is it Discourse-ready?
1) Went to /admin/upgrade 2) Noted that discourse had new commits that could be applied. 3) Clicked upgrade 4) Upgrade stuck on log mentioning a few times (sorry - didn't copy/paste) that vacuuming could only be done by root or db user 5) Stuck on that last message for 1/2 hour. 6) Clicked "Reset Upgrade" 7) That was some time ago and the system is still stuck on "Currently Upgrading..." on the main upgrade page, and "Reset Upgrade" still available on the progress page.
I don't have access to the ssh shell to do diagnostics/anything else.
I will note that I normally do 1-3 daily without a problem - the last time being around this time yesterday.
Anyone any suggestions, or am I basically stuck waiting for someone with ssh access to do something?
This is more nit picky than anything else, but is there a way to way to remove the 'Categories' text from the page title (text in the tab) and in turn, search results?
We have the categories list as the default landing page, so the search result looks like this:
as opposed to just the site title.
I've haven't had time to dig through the code for the solution, but I suspect that I'll have to edit the handlebars templates.
I want these tooltips to work on any topic on the site. I'm mainly a C++ programmer that dabbles with web development, so I think I should be able to figure this out with minimal help. I just don't even know where to start. Any help would be appreciated.
I would like the title of my site to change, according to whether or not there are new replies on the current page that I have not read.
So for example, if I have my browser up, I wouldn't need to be viewing the discourse website to see if a new reply was posted. Instead I would be able to tell by the title (which displays on the tab), if there are new messages to read.
The word censoring stuff seems very inconsistent. We've been playing with it and noticed odd things about when it does or doesn't replace things. The censoring will come and go with alternate edits / rebakes.
I'm curious how others have approached this and if it is a more widespread issue on Discourse forums. I can tell from Google it's a widespread issue on a variety of other forums.
I had the thought that if censored words had an option to block a post that contained a phrase, I could put the phone number from these spam posts in there. Might that be an option in the future? Or more robust spam controls? We're getting 10+ of these a day and that's a slow spam day.
How do you change the base URL that shows up in emails (and possibly other places as well, although I haven't seen it anywhere else yet)? Right now my email address confirmation emails send the user to a link like "http://www.example.com/users/authorize-email/8af4b4f2a9411f7029d39c05b7024c40", but I want to send them to my domain (and not www.example.com).
I'm running w/ Docker on Ubuntu on Digital Ocean. I have tried updating the hostname in the app.yml file then doing a launcher rebuild, but it doesn't change anything. I also tried manually navigating into the directory of the docker container and updating discourse.conf to have the correct hostname and not my IP address, but emails still get sent out with the IP address. What am I missing?
I have just received an email notification for this post:
Looking at the screen shot here - you can see that the feature label is unreadable in GMail due to the colours used.
The styles for the text are:
And here is the source snippet code in the email source: <a href="https://meta.discourse.org/category/feature" style="background-color: #0E76BD; color: #FFFFFF; text-decoration: none; font-weight: bold; color: #006699;">feature</a>
Moderator authority may optionally be assigned for a particular category and its subcategories rather than over the entire site.
This feature does not replace the existing whole-site moderator role.
This feature does not alter the site-global access privileges associated with Trust Levels.
The definition of "staff" (admin or global moderator) does not change with this feature. Category moderators are not considered to be staff.
A moderated category is not necessarily a private category. Restricting general access to the category remains an admin function using the current category security controls.
Authority
A category moderator will have authority to do the following, always restricted to the categories that they moderate:
appoint additional moderators for the categories
create sub-categories within the categories
appoint moderators for any sub-categories
(resign as moderator?)
delete, edit, wikify posts in the categories
delete, close, auto-close, reopen, archive, unlist/list topics in the cateogires
pin topic (category-scope pin, not global)
administer flags within categories they moderate
view activity log? (New feature)
block users from posting within a category? (New feature)
Do NOT allow to change: Email-in address, Fixed position.
Change title and category for a topic, as long as they moderate both source and destination (NB: TL3 permissions will let them move topics anywhere)
change category name
restrict sub-category access
invite new members with access to the category (this does not override the the must_approve_users site setting)
view/export list of users who can post in that category? or are members of any group with write permission for that category? (should not include admin, site moderator, TL4s)
Category moderators will not have authority to:
pin topics globally
banner topics
move a topic to any category they do not moderate (unless also TL3)
administer flags in any category they do not moderate
view activity log for any category they do not moderate (new feature)
impersonate users
Category Moderator authority can also be assigned or removed by an admin or full site moderator. No automatic revocation of authority.
No changes to the standard authority structure for other (non-moderator) users to carry out actions in a moderated category.
UI Implications
UI switches that check if the user is a staff member will have to be reworked, as access to some moderation features can be had without being a full-site moderator.
No special badge for category moderators. Posts by category moderators will not be distinguished in any way from posts by other users.
Category Edit dialog
category moderator can see and use the Edit button & modal on the Category page
on the Security tab (edit_category_security.hbs), add editable list of moderators beneath the current Permissions section; user can appoint new moderators here
Need UI for...
create sub-category under moderated category (available to category moderators)
API Changes
add list of category moderators to JSON representation of a category
category#update options: add moderator appointment & dismissal
Implementation Notes
We already have a CategoryUser class. Add a moderator flag to that. But do not interfere with any existing notification_level setting. Default notification level for a newly-assigned moderator should be the maximum value.
Extend the existing Guardian functionality to cover moderator powers. Try to avoid making a new thing for this.
For the items listed above that relate to permissions and invites:
every moderated category will have one associated group (generate a name for it from the category name?)
these special category groups should not be visible to anyone besides that category moderator
category moderator does not have authority to create additional groups
category moderator may only change permissions for any sub-category, as follows: remove "everyone" access; add access for the category group (per 1. above).
category moderators should not be able to fiddle with permissions for any of the other automatic groups (admins etc.)
category moderator can use the Invite button at the bottom of any topic: such invites will include access to the category group.
category moderator can use the Invite function to invite existing members into the category group, not just unregistered users.
There can be multiple moderators for the same category. Can a moderator dismiss another moderator? Does this ability make a difference to other functionality? Perhaps the dismissal function should be only available to admins, at least in phase 1. If that is the case, then a moderator cannot resign, only be removed by admin.
Can moderator create additional groups within the category? i.e. subcategories with different group permissions.
Perhaps category-specific Trust Levels could be defined. Not in phase 1.
Similar to the Admin Dashboard, but information restricted to a single category.
Users:Active, :New, :Suspended and :Blocked pages would only show users with access permission for that category
Users:Mods page would only show other moderators for that category
Category Moderator UI
Moderator gets a new "Moderator" button in their Profile page header
new Category Moderation page at /users/{username}/moderation
moderation page shows all moderated categories, listed alphabetically, with a summary stats block for each. Each block links to a per-category moderation page.
new Per-Category Moderation page at /users/{username}/moderation/{category-slug}
design TBD for the per-category moderation page: would be nice to put as much info on a single page as possible
I've set up a multiple container install, using an external postgres DB (actually a paid), and a couple Discourse servers. I'm using Gluster to synchronize the uploads directories of the two app servers. Right now, I'm running a Redis instance per app server, and things seem to work except that each of the two app servers maintain independent sessions; meaning that if I use non-sticky load balancing, things will get sketchy.
Do matters pertaining to sessions live in the Redis DB? Would it make sense to pull the Redis instances out of the web servers, and make a separate Redis server? How are y'all handling high availability in those scenarios?