-
Locate your gitea install working directory. The default for a linux service is WorkingDirectory=/var/lib/gitea/
-
Under the $GITEA_WORK_DIR/custom
directory create new folders public/css
-
Upload your theme’s .css
file in to this css directory
-
Edit your app.ini
. The default location is /etc/gitea/app.ini
-
In the [ui]
section add the THEMES
variable. Add both of these if they are missing. Include all themes, starting with the default ones.
EXAMPLE: THEMES = gitea,arc-green,arc-blue
-
Restart gitea: sudo service gitea restart
-
Log in to your instance web interface
-
Click on your user icon in the upper right corner
-
Go Settings > Account tab > Select default theme section
Your new theme should be selectable in the dropdown menu. Hit Update Theme
button to test. If it works you could optionally set this to the default theme for the instance using the app.ini
file.
EXAMPLE:
[ui]
DEFAULT_THEME = arc-blue
THEMES = gitea,arc-green,arc-blue
1 Like
Thanks, This is exactly what I needed
1 Like
So I got the container Gitea running and it works, mounted this way:
volumes:
- ./gitea-data:/data
According to gitea docs:
Add a CSS file to $GITEA_PUBLIC/public/css/theme-<theme-name>.css. The value of $GITEA_PUBLIC of your instance can be queried by calling gitea help and looking up the value of “CustomPath”.
Add <theme-name> to the comma-separated list of setting THEMES in app.ini
Calling the cli and gitea help gives me: CustomPath: /data/gitea (GITEA_CUSTOM)
So if ./gitea-data:/data
then /data/gitea
→ ./gitea-data/gitea/
which follows that
$GITEA_PUBLIC/public/css/
→ ./gitea-data/gitea/public/css
.
Which I have, and this what I put the files in app.ini
[ui]
DEFAULT_THEME = arc-green
THEMES = gitea,gitea-blue,arc-green,arc-blue,gitea-modern,github,github-dark
and I have it to choose from in gitea web
Only problem is: They do nothing.
On a side note: The path has changed in Gitea 1.15, there the file needs to be placed in $GITEA_CUSTOM/public/assets/css
I have public/css
and public/assets/css
. Both not working.
It sounds like you are using a container, like docker. If you can get on a shell session please verify that the files are in the correct place, relative to the container.
If you list the files from inside the container, do you see the theme .css
files?
ll /data/gitea/public/css