Baris Soner Usakli 11 years ago
commit 44d40fba35

2
.gitignore vendored

@ -20,3 +20,5 @@ feeds/recent.rss
# winston? # winston?
error.log error.log
events.log events.log
pidfile

@ -1,5 +1,11 @@
var fork = require('child_process').fork, "use strict";
var nconf = require('nconf'),
fs = require('fs'),
pidFilePath = __dirname + '/pidfile',
start = function() { start = function() {
var fork = require('child_process').fork,
nbb_start = function() {
nbb = fork('./app', process.argv.slice(2), { nbb = fork('./app', process.argv.slice(2), {
env: { env: {
'NODE_ENV': process.env.NODE_ENV 'NODE_ENV': process.env.NODE_ENV
@ -9,18 +15,51 @@ var fork = require('child_process').fork,
nbb.on('message', function(cmd) { nbb.on('message', function(cmd) {
if (cmd === 'nodebb:restart') { if (cmd === 'nodebb:restart') {
nbb.on('exit', function() { nbb.on('exit', function() {
start(); nbb_start();
}); });
nbb.kill(); nbb.kill();
} }
}); });
}, },
stop = function() { nbb_stop = function() {
nbb.kill(); nbb.kill();
if (fs.existsSync(pidFilePath)) {
var pid = parseInt(fs.readFileSync(pidFilePath, { encoding: 'utf-8' }), 10);
if (process.pid === pid) {
fs.unlinkSync(pidFilePath);
}
}
};
process.on('SIGINT', nbb_stop);
process.on('SIGTERM', nbb_stop);
nbb_start();
}, },
nbb; nbb;
process.on('SIGINT', stop); nconf.argv();
process.on('SIGTERM', stop);
if (nconf.get('d')) {
// Check for a still-active NodeBB process
if (fs.existsSync(pidFilePath)) {
console.log('\n Error: Another NodeBB is already running!');
process.exit();
}
// Initialise logging streams
var outputStream = fs.createWriteStream(__dirname + '/logs/output.log');
outputStream.on('open', function(fd) {
// Daemonize
require('daemon')({
stdout: fd
});
// Write its pid to a pidfile
fs.writeFile(__dirname + '/pidfile', process.pid);
start();
});
} else {
start(); start();
}

1
logs/.gitignore vendored

@ -0,0 +1 @@
*.log

@ -6,7 +6,19 @@
case "$1" in case "$1" in
start) start)
node loader "$@" echo "Starting NodeBB";
echo " \"./nodebb stop\" to stop the NodeBB server";
echo " \"./nodebb log\" to view server output";
node loader -d "$@"
;;
stop)
echo "Stopping NodeBB. Goodbye!";
kill `cat pidfile`;
;;
log)
tail -F ./logs/output.log;
;; ;;
upgrade) upgrade)
@ -42,13 +54,17 @@ case "$1" in
*) *)
echo "Welcome to NodeBB" echo "Welcome to NodeBB"
echo $"Usage: $0 {start|dev|watch|upgrade}" echo $"Usage: $0 {start|stop|log|setup|reset|upgrade|dev|watch}"
echo '' echo ''
column -s ' ' -t <<< ' column -s ' ' -t <<< '
start Start NodeBB in production mode start Start the NodeBB server
dev Start NodeBB in development mode stop Stops the NodeBB server
watch Start NodeBB in development mode and watch for changes log Opens the logging interface (useful for debugging)
setup Runs the NodeBB setup script
reset Disables all plugins, restores the default theme.
upgrade Run NodeBB upgrade scripts, ensure packages are up-to-date upgrade Run NodeBB upgrade scripts, ensure packages are up-to-date
dev Start NodeBB in interactive development mode
watch Start NodeBB in development mode and watch for changes
' '
exit 1 exit 1
esac esac

@ -10,6 +10,8 @@
}, },
"main": "app.js", "main": "app.js",
"scripts": { "scripts": {
"start": "./nodebb start",
"stop": "./nodebb stop",
"test": "mocha ./tests" "test": "mocha ./tests"
}, },
"dependencies": { "dependencies": {
@ -43,7 +45,8 @@
"nodebb-theme-vanilla": "~0.0.14", "nodebb-theme-vanilla": "~0.0.14",
"nodebb-theme-cerulean": "~0.0.13", "nodebb-theme-cerulean": "~0.0.13",
"nodebb-theme-lavender": "~0.0.22", "nodebb-theme-lavender": "~0.0.22",
"less": "^1.6.3" "less": "^1.6.3",
"daemon": "~1.1.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"redis": "0.8.3", "redis": "0.8.3",

@ -10,14 +10,16 @@
"500.message": "Oops! deu algo errado!", "500.message": "Oops! deu algo errado!",
"register": "Cadastrar", "register": "Cadastrar",
"login": "Logar", "login": "Logar",
"welcome_back": "Welcome Back ", "please_log_in": "Por favor efetue o login",
"you_have_successfully_logged_in": "You have successfully logged in", "posting_restriction_info": "Postagens esta restritas para membros registrados. clique aqui para logar",
"welcome_back": "Bem vindo de volta",
"you_have_successfully_logged_in": "Você logou com sucesso",
"logout": "Logout", "logout": "Logout",
"logout.title": "Logout com sucesso.", "logout.title": "Logout com sucesso.",
"logout.message": "Logado com Sucesso!", "logout.message": "Logado com Sucesso!",
"save_changes": "Salvar Alterações", "save_changes": "Salvar Alterações",
"close": "Fechar", "close": "Fechar",
"pagination": "Pagination", "pagination": "Paginação",
"header.admin": "Admin", "header.admin": "Admin",
"header.recent": "Recente", "header.recent": "Recente",
"header.unread": "Não Lido", "header.unread": "Não Lido",
@ -52,5 +54,5 @@
"dnd": "Não Perturbe", "dnd": "Não Perturbe",
"invisible": "Invisível", "invisible": "Invisível",
"offline": "Offline", "offline": "Offline",
"privacy": "Privacy" "privacy": "Privacidade"
} }

@ -1,7 +1,7 @@
{ {
"title": "Notificações", "title": "Notificações",
"no_notifs": "You have no new notifications", "no_notifs": "Você não tem nenhuma notificação nova",
"see_all": "See all Notifications", "see_all": "Visualizar todas as Notificações",
"back_to_home": "voltar para home", "back_to_home": "voltar para home",
"outgoing_link": "Link Externo", "outgoing_link": "Link Externo",
"outgoing_link_message": "Você está; saindo para um link externo", "outgoing_link_message": "Você está; saindo para um link externo",

@ -1,7 +1,7 @@
{ {
"home": "Home", "home": "Home",
"unread": "Tópicos Não Lidos", "unread": "Tópicos Não Lidos",
"popular": "Popular Topics", "popular": "Tópicos Populares",
"recent": "Tópicos Recentes", "recent": "Tópicos Recentes",
"users": "Usuários Registrados", "users": "Usuários Registrados",
"notifications": "Notificações", "notifications": "Notificações",

@ -3,5 +3,5 @@
"day": "Dia", "day": "Dia",
"week": "Semana", "week": "Semana",
"month": "Mês", "month": "Mês",
"no_recent_topics": "There are no recent topics." "no_recent_topics": "Nenhum tópico recente."
} }

@ -2,7 +2,7 @@
"topic": "Tópico", "topic": "Tópico",
"topics": "Tópicos", "topics": "Tópicos",
"no_topics_found": "Nenhum tópico encontrado!", "no_topics_found": "Nenhum tópico encontrado!",
"no_posts_found": "No posts found!", "no_posts_found": "Nenhum post encontrado!",
"profile": "Profile", "profile": "Profile",
"posted_by": "Postado por", "posted_by": "Postado por",
"chat": "Bate Papo", "chat": "Bate Papo",
@ -19,19 +19,24 @@
"tools": "Ferramentas", "tools": "Ferramentas",
"flag": "Marcar", "flag": "Marcar",
"flag_title": "Marcar este post para moderação", "flag_title": "Marcar este post para moderação",
"deleted_message": "This thread has been deleted. Only users with thread management privileges can see it.", "deleted_message": "Esta Thread foi deletada. Somente usuários com privilégios administrativos podem ver.",
"watch": "Watch", "following_topic.title": "Seguir Tópico",
"share_this_post": "Share this Post", "following_topic.message": "Você receberá notificações quando alguém responder este tópico.",
"not_following_topic.title": "Não está seguindo Tópico",
"not_following_topic.message": "Você não irá mais receber notificações deste tópico.",
"login_to_subscribe": "Por favor registre ou logue para poder assinar este tópico",
"watch": "Acompanhar",
"share_this_post": "Compartilhar este Post",
"thread_tools.title": "Ferramentas da Thread", "thread_tools.title": "Ferramentas da Thread",
"thread_tools.markAsUnreadForAll": "Marcar como não lido", "thread_tools.markAsUnreadForAll": "Marcar como não lido",
"thread_tools.pin": "Pin Topic", "thread_tools.pin": "Fixar Tópico",
"thread_tools.unpin": "Unpin Topic", "thread_tools.unpin": "Remover Fixação do Tópico",
"thread_tools.lock": "Lock Topic", "thread_tools.lock": "Trancar Tópico",
"thread_tools.unlock": "Unlock Topic", "thread_tools.unlock": "Destrancar Tópico",
"thread_tools.move": "Move Topic", "thread_tools.move": "Mover Tópico",
"thread_tools.fork": "Fork Topic", "thread_tools.fork": "Fork Tópico",
"thread_tools.delete": "Delete Topic", "thread_tools.delete": "Deletar Tópico",
"thread_tools.restore": "Restore Topic", "thread_tools.restore": "Restaurar Tópico",
"load_categories": "Carregando Categorias", "load_categories": "Carregando Categorias",
"disabled_categories_note": "Categorias desabilitadas estão em cinza", "disabled_categories_note": "Categorias desabilitadas estão em cinza",
"confirm_move": "Mover", "confirm_move": "Mover",
@ -41,10 +46,10 @@
"favourites.not_logged_in.title": "Não Logado", "favourites.not_logged_in.title": "Não Logado",
"favourites.not_logged_in.message": "Por Favor logar para favoritar o tópico", "favourites.not_logged_in.message": "Por Favor logar para favoritar o tópico",
"favourites.has_no_favourites": "Você não tem nenhum item favoritado!", "favourites.has_no_favourites": "Você não tem nenhum item favoritado!",
"vote.not_logged_in.title": "Not Logged In", "vote.not_logged_in.title": "Não está logado",
"vote.not_logged_in.message": "Please log in in order to vote", "vote.not_logged_in.message": "Por favor efetuar login para votar",
"vote.cant_vote_self.title": "Invalid Vote", "vote.cant_vote_self.title": "Voto inválido",
"vote.cant_vote_self.message": "You cannot vote for your own post", "vote.cant_vote_self.message": "Você não pode votar o seu próprio post",
"loading_more_posts": "Carregando mais posts", "loading_more_posts": "Carregando mais posts",
"move_topic": "Mover Tó;pico", "move_topic": "Mover Tó;pico",
"move_post": "Mover Post", "move_post": "Mover Post",
@ -55,11 +60,14 @@
"fork_success": "Fork realizado com sucesso!", "fork_success": "Fork realizado com sucesso!",
"reputation": "Reputação", "reputation": "Reputação",
"posts": "Posts", "posts": "Posts",
"composer.title_placeholder": "Enter your topic title here...", "composer.title_placeholder": "Digite seu tópico aqui...",
"composer.write": "Write", "composer.write": "Escreva",
"composer.preview": "Preview", "composer.preview": "Pré Visualização",
"composer.discard": "Discard", "composer.discard": "Descartar",
"composer.submit": "Submit", "composer.submit": "Enviar",
"composer.replying_to": "Replying to", "composer.replying_to": "Respondendo para",
"composer.new_topic": "New Topic" "composer.new_topic": "Novo Tópico",
"composer.drag_and_drop_images": "Clique e arraste imagens aqui",
"composer.content_is_parsed_with": "Conteúdo está separado com",
"composer.upload_instructions": "Mande suas imagens arrastando e soltando."
} }

@ -9,7 +9,7 @@
"age": "Idade", "age": "Idade",
"joined": "Cadastrou", "joined": "Cadastrou",
"lastonline": "Última vez online", "lastonline": "Última vez online",
"profile": "Profile", "profile": "Perfil",
"profile_views": "Visualizações de Profile", "profile_views": "Visualizações de Profile",
"reputation": "Reputação", "reputation": "Reputação",
"posts": "Posts", "posts": "Posts",
@ -19,29 +19,29 @@
"signature": "Assinatura", "signature": "Assinatura",
"gravatar": "Gravatar", "gravatar": "Gravatar",
"birthday": "Aniversário", "birthday": "Aniversário",
"chat": "Chat", "chat": "Bate Papo",
"follow": "Follow", "follow": "Seguir",
"unfollow": "Unfollow", "unfollow": "Deixar de Seguir",
"change_picture": "Alterar Foto", "change_picture": "Alterar Foto",
"edit": "Editar", "edit": "Editar",
"uploaded_picture": "Foto Carregada", "uploaded_picture": "Foto Carregada",
"upload_new_picture": "Carregar novo Foto", "upload_new_picture": "Carregar novo Foto",
"current_password": "Current Password", "current_password": "Senha Atual",
"change_password": "Alterar Senha", "change_password": "Alterar Senha",
"confirm_password": "Confirmar Senha", "confirm_password": "Confirmar Senha",
"password": "Senha", "password": "Senha",
"upload_picture": "Carregar Foto", "upload_picture": "Carregar Foto",
"upload_a_picture": "Carregar Foto", "upload_a_picture": "Carregar Foto",
"image_spec": "You may only upload PNG, JPG, or GIF files", "image_spec": "Você pode usar somente arquivos PNG, JPG ou GIF",
"max": "max.", "max": "max.",
"settings": "Configurações", "settings": "Configurações",
"show_email": "Mostrar meu email", "show_email": "Mostrar meu email",
"has_no_follower": "Ninguém está seguindo esse usuário :(", "has_no_follower": "Ninguém está seguindo esse usuário :(",
"follows_no_one": "Este usuário não está seguindo ninguém :(", "follows_no_one": "Este usuário não está seguindo ninguém :(",
"has_no_posts": "This user didn't post anything yet.", "has_no_posts": "Este usuário não postou nada ainda.",
"email_hidden": "Email Escondido", "email_hidden": "Email Escondido",
"hidden": "Escondido", "hidden": "Escondido",
"paginate_description": "Paginate topics and posts instead of using infinite scroll.", "paginate_description": "Paginação de tópicos e posts ao invés de usar \"scroll infinito\"",
"topics_per_page": "Topics per Page", "topics_per_page": "Tópicos por Página",
"posts_per_page": "Posts per Page" "posts_per_page": "Posts por Página"
} }

@ -10,6 +10,8 @@
"500.message": "Jejda, vyzerá, že sa niečo pokazilo.", "500.message": "Jejda, vyzerá, že sa niečo pokazilo.",
"register": "Registrovať", "register": "Registrovať",
"login": "Prihlásiť sa", "login": "Prihlásiť sa",
"please_log_in": "Prosím Prihláste sa",
"posting_restriction_info": "Prispievanie je obmedzené len pre registrovaných, kliknite pre Prihlásenie sa ",
"welcome_back": "Vitaj naspäť", "welcome_back": "Vitaj naspäť",
"you_have_successfully_logged_in": "Úspešne si sa prihlásil", "you_have_successfully_logged_in": "Úspešne si sa prihlásil",
"logout": "Odhlásiť sa", "logout": "Odhlásiť sa",

@ -1,7 +1,7 @@
{ {
"home": "Home", "home": "Home",
"unread": "Unread Topics", "unread": "Unread Topics",
"popular": "Popular Topics", "popular": "Populárne Témy",
"recent": "Recent Topics", "recent": "Recent Topics",
"users": "Registered Users", "users": "Registered Users",
"notifications": "Notifications", "notifications": "Notifications",

@ -20,6 +20,11 @@
"flag": "Označiť", "flag": "Označiť",
"flag_title": "Označiť príspevok pre moderáciu", "flag_title": "Označiť príspevok pre moderáciu",
"deleted_message": "Toto vlákno bolo vymazané. Iba užívatelia s privilégiami ho môžu vidieť.", "deleted_message": "Toto vlákno bolo vymazané. Iba užívatelia s privilégiami ho môžu vidieť.",
"following_topic.title": "Sledovať Tému",
"following_topic.message": "Budete teraz príjimať notifikácie, ked niekto prispeje do témy.",
"not_following_topic.title": "Nesledujete Tému",
"not_following_topic.message": "Nebudete už dostávať notifikácie z tejto Témy",
"login_to_subscribe": "Prosím Zaregistrujte sa alebo sa Prihláste, aby ste mohli odoberať túto Tému",
"watch": "Sledovať", "watch": "Sledovať",
"share_this_post": "Zdielaj tento príspevok", "share_this_post": "Zdielaj tento príspevok",
"thread_tools.title": "Nástroje", "thread_tools.title": "Nástroje",
@ -61,5 +66,8 @@
"composer.discard": "Zahodiť", "composer.discard": "Zahodiť",
"composer.submit": "Poslať", "composer.submit": "Poslať",
"composer.replying_to": "Odpovedáš ", "composer.replying_to": "Odpovedáš ",
"composer.new_topic": "Nová téma" "composer.new_topic": "Nová téma",
"composer.drag_and_drop_images": "Pretiahni a Pusť Obrázky Sem",
"composer.content_is_parsed_with": "Obsah je vybraný s",
"composer.upload_instructions": "Nahraj obrázky pretiahnutím a pustením ich."
} }

@ -114,20 +114,7 @@ var fs = require('fs'),
if (pluginData.minver && semver.validRange(pluginData.minver)) { if (pluginData.minver && semver.validRange(pluginData.minver)) {
if (!semver.satisfies(pkg.version, pluginData.minver)) { if (!semver.satisfies(pkg.version, pluginData.minver)) {
// If NodeBB is not new enough to run this plugin // If NodeBB is not new enough to run this plugin
if (process.env.NODE_ENV === 'development') {
// Throw a warning in development, but do nothing else
winston.warn('[plugins/' + pluginData.id + '] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.'); winston.warn('[plugins/' + pluginData.id + '] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.');
} else {
if (nconf.get('check-plugins') !== false) {
// Refuse to load this plugin...
winston.error('[plugins/' + pluginData.id + '] This plugin is reportedly incompatible with your version of NodeBB, so it has been disabled.');
winston.error('[plugins/' + pluginData.id + '] Use `--no-check-plugins` if you wish to live dangerously.');
// ... and disable it, too
Plugins.toggleActive(pluginData.id);
return callback();
}
}
} }
} }

@ -52,7 +52,7 @@ var shutdown = function(code) {
db.close(); db.close();
winston.info('[app] Database connection closed.'); winston.info('[app] Database connection closed.');
winston.info('[app] Goodbye!'); winston.info('[app] Shutdown complete.');
process.exit(); process.exit();
}, },
restart = function() { restart = function() {

Loading…
Cancel
Save