Vuoi servire un file statico alla radice del tuo server Discourse?
Ecco cosa fare. Nella parte inferiore del tuo file `app.yml, nella sezione dei comandi personalizzati, fai qualcosa di simile a questo:
## Ricorda, questa è la sintassi YAML: puoi avere solo un blocco con un nome
run:
- exec: echo "Inizio dei comandi personalizzati"
- file:
path: /var/www/discourse/public/myfile.txt
chmod: "+r"
contents: |
Il contenuto del file va qui.
- exec: echo "Fine dei comandi personalizzati"
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.
Molto interessante e utile. Si può modificare per consentire il caricamento di molti file in una cartella per l’accesso? Ad esempio, se si desidera configurare /var/www/discourse/public/img in modo che yourserver.tld/img/step_1.png possa essere servito facilmente, insieme a qualsiasi numero di file successivi copiati via scp o caricati in qualche modo sul server?