Vous souhaitez servir un fichier statique à la racine de votre serveur Discourse ?
Voici la marche à suivre. Au bas de votre fichier app.yml, dans la section des commandes personnalisées, ajoutez quelque chose comme ceci :
## Rappelez-vous, il s'agit de la syntaxe YAML - vous ne pouvez avoir qu'un seul bloc avec un nom
run:
- exec: echo "Début des commandes personnalisées"
- file:
path: /var/www/discourse/public/myfile.txt
chmod: "+r"
contents: |
Le contenu du fichier va ici.
- exec: echo "Fin des commandes personnalisées"
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.
Very interesting and useful. Can this be tweaked to allow many files to be dumped into a folder for access? Say you want to make /var/www/discourse/public/img so that yourserver.tld/img/step_1.png can be served up easily and any number of subsequent files that are scp’d or uploaded in some way to the server?