Deseja servir um arquivo estático na raiz do seu servidor Discourse?
Veja o que fazer. Na parte inferior do seu arquivo app.yml, na seção de comandos personalizados, faça algo assim:
## Lembre-se, esta é a sintaxe YAML - você só pode ter um bloco com um nome
run:
- exec: echo "Início dos comandos personalizados"
- file:
path: /var/www/discourse/public/myfile.txt
chmod: "+r"
contents: |
O conteúdo do arquivo vai aqui.
- exec: echo "Fim dos comandos personalizados"
Personally i find this really useful. Not to mention that this kind of static file, gives you way more opportunities to use your imagination, files, maybe other website service that you can run as static – etc
I imagine simple text strings work well enough, though I also imagine for this to be more useful, markup, links, images, etc. would be desired. I suspect that the more closely “stuff” approaches being a web page the more difficult it would be to not break.
@pfaffman what is your use case and what degree of complexity have you been able to do successfully?
Well, you’ve seen the actual examples that I know about. There are ways not to need it, but I’ve wanted to do this a few times and finally bothered to figure it out.
Muito interessante e útil. Isso pode ser ajustado para permitir que vários arquivos sejam despejados em uma pasta para acesso? Digamos que você queira criar /var/www/discourse/public/img para que yourserver.tld/img/step_1.png possa ser servido facilmente, além de qualquer número de arquivos subsequentes que sejam transferidos via scp ou carregados de alguma forma no servidor?